Reputation: 957
In WPF, is it possible to bind a property of class which is other assembly to the control which is in different assembly .Please help. Thanks
Upvotes: 3
Views: 4986
Reputation: 50752
Yea, you can reference that assembly to your wpf project, than add a namespace in xaml like this
<UserControl xmlns:custom="clr-namespace:SampleClass;assembly=SampleLibrary"...
than add that class to UserControl's resources
<UserControl.Resources>
<custom:SampleClass x:Key="myClass"/>
</UserControl.Resources>
than bind to it's property
<TextBox Text={Binding Source={StaticResource myClass},Path=MyProperty}/>
Upvotes: 10