public UserControlMenuItem(ItemMenu itemMenu, PlotMainWindow context) { InitializeComponent(); _context = context; ExpanderMenu.Visibility = itemMenu.SubItems == null ? Visibility.Collapsed : Visibility.Visible; //ListViewItemMenu.Visibility = itemMenu.SubItems == null ? Visibility.Visible : Visibility.Collapsed; this.DataContext = itemMenu; }
private void button2_Click(object sender, EventArgs e) { Thread t = new Thread(new ThreadStart(() => { PlotMainWindow.application = null; PlotMainWindow plotPlato = new PlotMainWindow(); plotPlato.Show(); System.Windows.Threading.Dispatcher.Run(); })); t.SetApartmentState(ApartmentState.STA); // Make the thread a background thread t.IsBackground = true; // Start the thread t.Start(); }
private void buttonTest_Click(object sender, EventArgs e) { PlotMainWindow plotPlato = new PlotMainWindow(); System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(plotPlato); plotPlato.Show(); }