private void EditingSnap_OnUiElementsChanged(object sender, EventArgs e) { EditingSnap snap = sender as EditingSnap; var list = snap.GetUiElements(); lbContent.Tag = new TAG_lbContent { EditingSnap = snap, Tuple = list }; lbContent.ItemsSource = list; }
private void SubscribeEditingSnap(EditingSnap snap) { if (lbContent.Tag != null) { UnSubscribeEditingSnap(((TAG_lbContent)lbContent.Tag).EditingSnap); } var list = snap.GetUiElements(); snap.OnUiElementsChanged += EditingSnap_OnUiElementsChanged; lbContent.Tag = new TAG_lbContent { EditingSnap = snap, Tuple = list }; lbContent.ItemsSource = list; }