Hi, Im having requirement of passing reference of control to another custom control . Like I created custom control which contains dependency property associateDatagridProperty
public static readonly DependencyProperty AssociatedDataGridProperty = DependencyProperty.Register( "AssociatedDatagrid", typeof(DataGrid), typeof(CustomControl), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault) );
public Datagrid AssociatedDatagrid
{
get { return (Datagrid )base.GetValue(AssociatedDataGridProperty); }
set { base.SetValue(AssociatedDataGridProperty, value); }
}
In XAML Im assign Value like this
Here Datagrid is Microsoft WPF toolkit datagrid
<CustomControl x:Name="DatagridPaging"
Canvas.Left="24"
Canvas.Top="236"
AssociatedDatagrid="{Binding ElementName=clientsGrid ,Path=Name}">
when i try to access the value of AssociatedDatagrid property it always show null
can any1 tell me is it right way of doing it ?.
With Regards, Mahender