I have a custom binding control as shown below
<DataTemplate DataType="{x:Type vm:EditorTabViewModel}"> <me:MarkdownEditor Options="{Binding Path=Options, RelativeSource={RelativeSource AncestorType=Window}}" /> </DataTemplate>
I found that the binding ( Window1.Options ) is installed (after going through the code in debug mode), the markdown editor options (it is supposed to set fonts, colors, etc.) are not installed, or at least the user interface is not Update. I want something to happen with MarkdownEditor.xaml.cs , but with a different (specified) project. How can I verify that the MarkdownEditor.Options parameter is set at a minimum?
I really tested that the side of MarkdownEditor works below
<Window ...> <Grid> <Button Content="Options" Click="Button_Click" Grid.Row="0" /> <me:MarkdownEditor Options="{Binding Options, RelativeSource={RelativeSource AncestorType=Window}}" Grid.Row="1" /> </Grid> </Window>
Thus, the difference in the latter is MarkdownEditor only in the Grid in the Window . The only missing is the MarkdownEditor within the TabControl associated with the ObservableCollection<TabViewModel>
Visual Studio Solution Replicating the Problem
I am not very good at things, so the simple project that I created is minus all the unnecessary noises loaded in the media fire so you can see what is wrong.
Video showing problem on Screenr
Simple use of the editor in the window / grid.

binding works fine
Then, when used in conjunction with a TabControl bound to an ObservableCollection<EditorTabViewModel> , the binding works as shown in 2 TextBox es, updating its values. but the editor does not update

wpf binding user-controls
Jiew Meng Nov 20 '10 at 6:13 2010-11-20 06:13
source share