Call parent component from children user control
Hello, I am trying to call a combobox located in a usercontrol from another usercontrol.
Parent user control:
<ComboBox x:Name="cmbA" Width="100" SelectedIndex="0">
</ComboBox>
<DataGrid>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<local:ucCM />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid>
Child user control (ucCM.xaml):
I have tried with this code, but it isn't working because "this.Parent" returns null.
ComboBox cmbA = (ComboBox)((this.Parent) as UserControl).FindName("cmbA");