private void OnHideCompileBox(object sender, RoutedEventArgs e) { FlowchartEditor flowEditor = tabDynamic.SelectedContent as FlowchartEditor; if (null != flowEditor) { flowEditor._editor.HideCompileBox(); } }
private void OnCompile(object sender, RoutedEventArgs e) { FlowchartEditor flowEditor = tabDynamic.SelectedContent as FlowchartEditor; if (null != flowEditor) { string strCompiledCodeText = flowEditor.GetCompiledCodeText(); flowEditor._editor.ShowCompileBox(strCompiledCodeText); } }
private TabItem AddTabItem() { int count = _tabItems.Count; // create new tab item TabItem tab = new TabItem(); tab.Header = string.Format("NFA{0}", nCurrentTabID); tab.Name = string.Format("tab{0}", nCurrentTabID); nCurrentTabID++; tab.HeaderTemplate = tabDynamic.FindResource("TabHeader") as DataTemplate; // add controls to tab item, this case I added just a textbox FlowchartEditor flowEditor = new FlowchartEditor(); flowEditor.Name = "content"; tab.Content = flowEditor; // insert tab item right before the last (+) tab item _tabItems.Insert(count - 1, tab); return(tab); }