I want to create binding between UpDown control in contextmenu and custom control called "FileExplorerControl"(but it can be simulated on any control ... ). When I run the program a open context menu, UpDown is empty, when I put there any number, any effects occurs. Where is the problem ?/
<view:FileExplorerControl Grid.Column="0"
Padding="5"
x:Name="LeftFileExplorer"
DataContext=
"{Binding LeftFileExplorerViewModel}">
<view:FileExplorerControl.ContextMenu>
<ContextMenu>
<StackPanel>
<TextBlock>Font Size</TextBlock>
<xctk:IntegerUpDown Value="{Binding
ElementName=LeftFileExplorer,
Path=FontSize, Mode=TwoWay}"
Minimum="8"
Maximum="32"/>
</StackPanel>
</ContextMenu>
</view:FileExplorerControl.ContextMenu>
</view:FileExplorerControl>
Error message in debug window:
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=LeftFileExplorer'. BindingExpression:Path=FontSize; DataItem=null; target element is 'IntegerUpDown' (Name=''); target property is 'Value' (type 'Nullable`1')