private void Window_closing(object sender, System.ComponentModel.CancelEventArgs e) { DemoTab dt = null; if (demoTab.Content != null) { dt = (DemoTab)demoTab.Content; dt.abortDemo(); } }
public void RunDemo(object sender, RoutedEventArgs e) { if (demoTab.Visibility == Visibility.Visible) { return; } else { var demoContent = new DemoTab(); demoTab.Content = demoContent; if (helpTab.Visibility == Visibility.Hidden && mainTabControl.Items.IndexOf(helpTab) == 1) { mainTabControl.Items.RemoveAt(2); mainTabControl.Items.Insert(1, demoTab); } demoTab.Visibility = Visibility.Visible; demoTab.Focus(); } }
public void CloseDemo(object sender, RoutedEventArgs e) { if (demoTab.Visibility == Visibility.Visible) { DemoTab dt = (DemoTab)demoTab.Content; dt.abortDemo(); demoTab.Content = null; demoTab.Visibility = Visibility.Hidden; glavniTab.Focus(); if (helpTab.Visibility == Visibility.Visible && mainTabControl.Items.IndexOf(helpTab) == 2) { mainTabControl.Items.RemoveAt(1); mainTabControl.Items.Insert(2, demoTab); helpTab.Focus(); } } else { return; } }