private void AddClick(object sender, RoutedEventArgs e) { pageAdd = new PageAddConsumption(pageFilter); Main.Content = pageAdd; selectedTab = 1; gridCursor.Margin = new Thickness((gridCursor.Width * selectedTab), 0, 0, 0); buttonAdd.Background = Brushes.White; buttonAdd.Foreground = Brushes.Black; buttonFilter.Background = new SolidColorBrush(Color.FromRgb(156, 39, 176)); buttonFilter.Foreground = Brushes.White; }
public MainWindow() { InitializeComponent(); double screenHeight = SystemParameters.FullPrimaryScreenHeight; double screenWidth = SystemParameters.FullPrimaryScreenWidth; this.Top = (screenHeight - this.Height) / 0x00000002; this.Left = (screenWidth - this.Width) / 0x00000002; pageFilter = new PageFilter(); pageAdd = new PageAddConsumption(pageFilter); selectedTab = 0; buttonFilter.Background = Brushes.White; buttonFilter.Foreground = Brushes.Black; Main.Content = pageFilter; gridCursor.Background = new SolidColorBrush(Color.FromRgb(156, 39, 176)); gridCursor.Width = buttonFilter.ActualWidth; }