I have an entry for a class in a Window. In window.Resources I created :
<local:ColorType x:Key="myClrData" />
In entry, I have 11 textboxes/textblocks and all are bound to the proerties of myClrData :
<TextBox Name="dfTxt" MinWidth="50" Grid.Column="1" Grid.Row="1" Style="{StaticResource numberTextStyle}"
Text="{Binding Source={StaticResource myClrData}, Path=D_F}" />
<TextBlock Name="dfPerc" Grid.Column="2" Grid.Row="1" Style="{StaticResource numberTBStyle}"
Text="{Binding Source={StaticResource myClrData}, Path=D_F_Percent}" />
This works perfectly well, when I want to add a new entry. My concern is I want to update the object details. For that, in my window class, I added :
public ColorTorWindow(ColorType ct)
: this()
{
this.Resources["myClrData"] = ct;
}
But this doesn’t refresh the textboxes/blocks that are bound to it. What is missing here? How do I force to refresh all components again or should I be workign with some other manner.
Any help is highly appreciated.
Thanks
I am using Datacontext and it resolved my problem.
Thanks