public void UpdateSelectableForeignKeys(JoinTableCollection selected) { _selectableForeignKeys.Clear(); Table tbl = Table as Table; foreach (ForeignKeyConstraint cons in tbl.ReferTo) { bool found = false; foreach (JoinTable jt in selected) { if (jt.JoinDirection == JoinDirection.ReferFrom) { continue; } if (!tbl.Equals(jt.Referrer?.Table)) { continue; } if (!cons.Equals(jt.JoinBy)) { continue; } found = true; break; } if (!found) { _selectableForeignKeys.Add(cons); } } OnPropertyChanged("SelectableForeignKeys"); }
private void JoinTablesPropertyChanged(DependencyPropertyChangedEventArgs e) { JoinTableCollection l = (e.OldValue as JoinTableCollection); if (l != null) { l.CollectionChanged += JoinTables_CollectionChanged; } l = (e.NewValue as JoinTableCollection); if (l != null) { l.CollectionChanged += JoinTables_CollectionChanged; } }
//public Trigger SelectedTrigger //{ // get // { // return (Trigger)GetValue(SelectedTriggerProperty); // } // set // { // SetValue(SelectedTriggerProperty, value); // } //} public TableControl() { InitializeComponent(); JoinTables = new JoinTableCollection(); }