private void Grid_MouseDown(object sender, MouseButtonEventArgs e) { Canvas parentForm = this.Parent as Canvas; Grid parentForm2 = parentForm.Parent as Grid; TabBar parentForm3 = parentForm2.Parent as TabBar; parentForm3.SelectTab(this); }
private async void Me_MouseDown(object sender, MouseButtonEventArgs e) { TabBar tb = this.FindParent <TabBar>(); tb.SelectTab(this); if (form.GetType() == typeof(TabView)) { TabView tv = (form as TabView); await tv.ChangeColor(); } }
private void MainGrid_StateChanged(object sender, EventArgs e) { if (WindowState == WindowState.Maximized) { Grid.Margin = new Thickness(8); TabBar.CalcSizes(); } if (WindowState == WindowState.Normal) { Grid.Margin = new Thickness(0); TabBar.CalcSizes(); } }
private void button_close_Click(object sender, RoutedEventArgs e) { try { Applets.Settings s = form as Applets.Settings; s.SaveSettings(); } catch { } Canvas parentForm = this.Parent as Canvas; Grid parentForm2 = parentForm.Parent as Grid; TabBar parentForm3 = parentForm2.Parent as TabBar; parentForm3.RemoveTab(this); }
private void button_close_Click(object sender, MouseButtonEventArgs e) { if (form.GetType() == typeof(Applets.Settings)) { try { Applets.Settings s = form as Applets.Settings; s.SaveSettings(); } catch (Exception ex) { Console.WriteLine("Save settings error: " + ex.Message + " " + ex.Data + " "); } } TabBar tb = this.FindParent <TabBar>(); tb.RemoveTab(this); }
private void Tab_Loaded(object sender, RoutedEventArgs e) { Dispatcher.BeginInvoke((Action)(() => { TabBar tb = this.FindParent <TabBar>(); mainWindow.container.Children.Add(form); tb.SelectTab(this); if (tb.TabCollection.Count > 0) { for (var i = 0; i < tb.TabCollection.Count - 1; i++) { tb.SelectTab(tb.TabCollection[i + 1]); } } if (this.ActualWidth - (CloseTab.ActualWidth + closeTabMargin) > 0) { label_TabTitle.Width = this.ActualWidth - (CloseTab.ActualWidth + closeTabMargin); } label_TabTitle.Margin = new Thickness(6, 1, 0, 0); })); }
private void Tab_Loaded(object sender, RoutedEventArgs e) { Dispatcher.BeginInvoke((Action)(() => { Canvas parentForm = this.Parent as Canvas; Grid parentForm2 = parentForm.Parent as Grid; TabBar parentForm3 = parentForm2.Parent as TabBar; mainWindow.container.Children.Add(form); parentForm3.SelectTab(this); if (parentForm3.TabCollection.Count > 0) { for (var i = 0; i < parentForm3.TabCollection.Count - 1; i++) { parentForm3.SelectTab(parentForm3.TabCollection[i + 1]); } } if (this.ActualWidth - (CloseTab.ActualWidth + closeTabMargin) > 0) { label_TabTitle.Width = this.ActualWidth - (CloseTab.ActualWidth + closeTabMargin); } label_TabTitle.Margin = new Thickness(6, 1, 0, 0); })); }
private void OpenNewTab(object sender, ExecutedRoutedEventArgs e) { var commandParams = (OpenTabCommandParameters)e.Parameter; TabBar.AddTab(commandParams, this); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.MainGrid = ((WebExpress.MainWindow)(target)); #line 10 "..\..\..\..\Windows\MainWindow.xaml" this.MainGrid.StateChanged += new System.EventHandler(this.MainGrid_StateChanged); #line default #line hidden #line 10 "..\..\..\..\Windows\MainWindow.xaml" this.MainGrid.Activated += new System.EventHandler(this.MainGrid_PreviewMouseDown); #line default #line hidden return; case 2: this.Grid = ((System.Windows.Controls.Grid)(target)); return; case 3: #line 41 "..\..\..\..\Windows\MainWindow.xaml" ((System.Windows.Controls.Grid)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseDown); #line default #line hidden return; case 4: this.TabBar = ((WebExpress.TabBar)(target)); return; case 5: this.Close = ((System.Windows.Controls.Button)(target)); #line 44 "..\..\..\..\Windows\MainWindow.xaml" this.Close.Click += new System.Windows.RoutedEventHandler(this.Close_Click); #line default #line hidden #line 44 "..\..\..\..\Windows\MainWindow.xaml" this.Close.MouseEnter += new System.Windows.Input.MouseEventHandler(this.Close_MouseEnter); #line default #line hidden #line 44 "..\..\..\..\Windows\MainWindow.xaml" this.Close.MouseLeave += new System.Windows.Input.MouseEventHandler(this.Close_MouseLeave); #line default #line hidden return; case 6: this.CloseImage = ((System.Windows.Controls.Image)(target)); return; case 7: this.Maximize = ((System.Windows.Controls.Button)(target)); #line 49 "..\..\..\..\Windows\MainWindow.xaml" this.Maximize.Click += new System.Windows.RoutedEventHandler(this.Maximize_Click); #line default #line hidden #line 49 "..\..\..\..\Windows\MainWindow.xaml" this.Maximize.MouseEnter += new System.Windows.Input.MouseEventHandler(this.Maximize_MouseEnter); #line default #line hidden #line 49 "..\..\..\..\Windows\MainWindow.xaml" this.Maximize.MouseLeave += new System.Windows.Input.MouseEventHandler(this.Maximize_MouseLeave); #line default #line hidden return; case 8: this.MaximizeImage = ((System.Windows.Controls.Image)(target)); return; case 9: this.Minimize = ((System.Windows.Controls.Button)(target)); #line 54 "..\..\..\..\Windows\MainWindow.xaml" this.Minimize.MouseEnter += new System.Windows.Input.MouseEventHandler(this.Minimize_MouseEnter); #line default #line hidden #line 54 "..\..\..\..\Windows\MainWindow.xaml" this.Minimize.MouseLeave += new System.Windows.Input.MouseEventHandler(this.Minimize_MouseLeave); #line default #line hidden #line 54 "..\..\..\..\Windows\MainWindow.xaml" this.Minimize.Click += new System.Windows.RoutedEventHandler(this.Minimize_Click); #line default #line hidden return; case 10: this.MinimizeImage = ((System.Windows.Controls.Image)(target)); return; case 11: this.container = ((System.Windows.Controls.Grid)(target)); #line 61 "..\..\..\..\Windows\MainWindow.xaml" this.container.PreviewMouseDown += new System.Windows.Input.MouseButtonEventHandler(this.container_PreviewMouseDown); #line default #line hidden return; case 12: this.Menu = ((WebExpress.Controls.Menu)(target)); return; case 13: this.Downloads1 = ((WebExpress.Downloads)(target)); return; } this._contentLoaded = true; }