private void tw_ctrlbutton_MouseRightButtonUp(object sender, MouseButtonEventArgs e) { if (data.Count == 1) { nowdata.OnExit(); ((MainWindow)Application.Current.MainWindow).DeleteTagWindow(this); } }
private void CtrlButtonRemoveData(TagBase tag, bool destroy = true) { if (tag == nowdata) { ExchangeData(data.Find(x => { return(x != tag); })); } if (destroy) { tag.OnExit(); } data.Remove(tag); tw_grid.Children.Remove(tag.cv); if (data.Count == 1) { IsCtrlBtnFolded = true; FoldCtrlButton(); } else { UpdateRowConfig(); } UpdateCtrlBtnContent(); }