c# - wpf, register DP, bindable converter parameter -
[valueconversion(typeof(object), typeof(object))] public class bindableconvertor : dependencyobject, ivalueconverter { public object bindableparameter { { return getvalue(mypropertyproperty); } set { setvalue(mypropertyproperty, value); } } public static readonly dependencyproperty mypropertyproperty = dependencyproperty.register( nameof(bindableparameter), typeof(object), typeof(bindableconvertor), new propertymetadata(string.empty) ); public object convert(object value, type targettype, object parameter, cultureinfo culture) { // actions here... } public object convertback(object value, type targettype, object parameter, cultureinfo culture) { throw new notimplementedexception(); } } xaml: <application.resources> <local:bindableconvertor x:key="myconvertor" bindableparameter="{binding anytargetproperty}" />...