How do I bind a property of a class that is in another assembly in WPF?
In WPF, you can bind a property to a class that is a different assembly for a control that is in a different assembly. Please, help. Thanks to
+2
Ershad
source
to share
1 answer
Yes you can reference this assembly to your wpf project than add namespace to xaml like this
<UserControl xmlns:custom="clr-namespace:SampleClass;assembly=SampleLibrary"...
than adding this class to UserControl resources
<UserControl.Resources>
<custom:SampleClass x:Key="myClass"/>
</UserControl.Resources>
than to bind a property to it
<TextBox Text={Binding Source={StaticResource myClass},Path=MyProperty}/>
+8
Arsen Mkrtchyan
source
to share