in my WPF application I refer to a selected value of a combobox with
{Binding Source={x:Reference myComboBox} ,Path=SelectedItem}
I do this inside of DataGrid Columns.
This is throwing a null reference exception at design time (not run time). Is there any way to fix this, or can I access the selected Item somehow other than that?
ComboBox:
<ComboBox x:Name="myComboBox"
ItemsSource="{Binding MyItems}"
DisplayMemberPath="Name"
SelectedItem="{Binding SelectedItem}"
/>
DataGridTextColumn:
<DataGridTextColumn HeaderStyle="{DynamicResource myStyle}" Visibility="{Binding Source={x:Reference myComboBox} ,Path=SelectedItem, Converter={StaticResource ConvertSomething}, ConverterParameter={StaticResource Something}}" Header="MyHeader " Width="*" Binding="{Binding Path=MyBindingName}" />
VisaulStudio
are you using? – Anatoliy Nikolaev