private static void OnForeignKeyConstraintChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { DataTableForeignKeyDescription foreignKeyDescription = sender as DataTableForeignKeyDescription; if (foreignKeyDescription != null) { foreignKeyDescription.m_foreignKeyConstraint = e.NewValue as ForeignKeyConstraint; foreignKeyDescription.UpdateValuePath(); foreignKeyDescription.UpdateItemsSource(); } }
private static DataTableForeignKeyDescription GetDataGridForeignKeyDescriptionForForeignKeyConstraint( ForeignKeyConstraint foreignKeyConstraint ) { DataTableForeignKeyDescription foreignKeyDescription = null; if( foreignKeyConstraint != null ) { if( ( foreignKeyConstraint.Columns != null ) && ( foreignKeyConstraint.Columns.Length == 1 ) ) { foreignKeyDescription = new DataTableForeignKeyDescription(); ( ( DataTableForeignKeyDescription )foreignKeyDescription ).ForeignKeyConstraint = foreignKeyConstraint; foreignKeyDescription.IsAutoCreated = true; } } return foreignKeyDescription; }