private void Button_Click(object sender, RoutedEventArgs e) { Button ClickedButton = (Button)sender; if ((string)ClickedButton.Tag == "Settings") { Frame0.Navigate(ASettingsPage); LibraryBtn.Background = Brushes.Transparent; SettingsBtn.Background = new SolidColorBrush(Color.FromRgb(36, 00, 70)); StoreBtn.Background = Brushes.Transparent; MenuBtn.Background = Brushes.Transparent; } else if ((string)ClickedButton.Tag == "Library") { ALibraryPage.Check(); Frame0.Navigate(ALibraryPage); LibraryBtn.Background = new SolidColorBrush(Color.FromRgb(36, 00, 70)); SettingsBtn.Background = Brushes.Transparent; StoreBtn.Background = Brushes.Transparent; MenuBtn.Background = Brushes.Transparent; } else if ((string)ClickedButton.Tag == "Close") { if (Properties.Settings.Default.Installing == false) { this.WindowState = WindowState.Minimized; this.ShowInTaskbar = false; } else { this.WindowState = WindowState.Minimized; MessageBox.Show("You can't close Updater while it doing its work."); } } else if ((string)ClickedButton.Tag == "Minimize") { this.WindowState = WindowState.Minimized; } else if ((string)ClickedButton.Tag == "Maximize") { if (this.WindowState == WindowState.Maximized) { this.WindowState = WindowState.Normal; ClickedButton.Content = ""; } else { this.WindowStyle = WindowStyle.SingleBorderWindow; this.WindowState = WindowState.Maximized; ClickedButton.Content = ""; this.WindowStyle = WindowStyle.None; } } else if ((string)ClickedButton.Tag == "Menu") { Frame0.Navigate(AStartPage); LibraryBtn.Background = Brushes.Transparent; SettingsBtn.Background = Brushes.Transparent; StoreBtn.Background = Brushes.Transparent; MenuBtn.Background = new SolidColorBrush(Color.FromRgb(36, 00, 70)); } else if ((string)ClickedButton.Tag == "User") { if (Properties.Settings.Default.UserAuthorizited == true) { Frame0.Navigate(AUserPage); } else { Frame0.Navigate(ALoginPage); } } else if ((string)ClickedButton.Tag == "Back") { if (Frame0.CanGoBack) { Frame0.GoBack(); } } }
private void Button_Click(object sender, RoutedEventArgs e) { Button ClickedButton = (Button)sender; if ((string)ClickedButton.Tag == "Info") { try { //_InfoWindow.Show(); //_InfoWindow.WindowState = WindowState.Normal; } catch { } } else if ((string)ClickedButton.Tag == "Minimize") { this.WindowState = WindowState.Minimized; } else if ((string)ClickedButton.Tag == "Maximize") { if (this.WindowState == WindowState.Maximized) { this.WindowState = WindowState.Normal; MaxiBtn.Content = ""; } else { this.WindowStyle = WindowStyle.SingleBorderWindow; this.WindowState = WindowState.Maximized; MaxiBtn.Content = ""; this.WindowStyle = WindowStyle.None; } } else if ((string)ClickedButton.Tag == "Close") { if (Properties.Settings.Default.AppCanBeClosed == true) { Application.Current.Dispatcher.Invoke(Application.Current.Shutdown); } } else if ((string)ClickedButton.Tag == "Back") { if (Frame0.CanGoBack) { Frame0.GoBack(); } } else if ((string)ClickedButton.Tag == "ShowConsole") { if (ConsoleGrid.Visibility != Visibility.Visible) { ConsoleGrid.Visibility = Visibility.Visible; } else { ConsoleGrid.Visibility = Visibility.Collapsed; } } else if ((string)ClickedButton.Tag == "ClearConsole") { ConsoleTextBox.Text = ""; } else if ((string)ClickedButton.Tag == "EnterConsole") { if (ConsoleTextBox.Text.Length > 0) { _ConsoleClass.Recieved(_this, ConsoleTextBox.Text); } } else if ((string)ClickedButton.Tag == "TabConsole") { if (ConsoleTextBox.Text.Length > 0) { //_ConsoleClass.Sort(_this, ConsoleTextBox.Text); } } }
private void Button_Click(object sender, RoutedEventArgs e) { Button ClickedButton = (Button)sender; if ((string)ClickedButton.Tag == "Minimize") { WindowState = WindowState.Minimized; } else if ((string)ClickedButton.Tag == "Maximize") { if (this.WindowState == WindowState.Maximized) { WindowState = WindowState.Normal; MaxiBtn.Content = ""; WindowBorder.BorderBrush = Brushes.White; } else { this.WindowState = WindowState.Maximized; MaxiBtn.Content = ""; WindowBorder.BorderBrush = Brushes.Transparent; } } else if ((string)ClickedButton.Tag == "Close") { if (Properties.Settings.Default.AppCanBeClosed == true) { Application.Current.Dispatcher.Invoke(Application.Current.Shutdown); } } else if ((string)ClickedButton.Tag == "Back") { if (Frame0.CanGoBack) { Frame0.GoBack(); MainConsoleTextBox.Text = "Frame GoBack\n" + MainConsoleTextBox.Text; } else { BackBtn.Visibility = Visibility.Collapsed; } } else if ((string)ClickedButton.Tag == "EnterConsole") { if (TextConsoleTextBox.Text != "") { _ConsoleLogic.Command(TextConsoleTextBox.Text, this); } } else if ((string)ClickedButton.Tag == "ConsoleOpen") { if (ConsoleGrid.Visibility == Visibility.Collapsed) { ConsoleGrid.Visibility = Visibility.Visible; } else { ConsoleGrid.Visibility = Visibility.Collapsed; } } }