Example #1
0
        private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch (((ListViewItem)((ListView)sender).SelectedItem).Name)
            {
            case "ItemReservations":
                if (reserwationManage == null)
                {
                    reserwationManage = new ReserwationManage(MyController, this);
                }
                contentControl.Content = reserwationManage;
                break;

            case "ItemCars":
                if (carManage == null)
                {
                    carManage = new CarManage(MyController, this);
                }
                contentControl.Content = carManage;
                break;

            case "ItemMarks":
                if (carMarkManage == null)
                {
                    carMarkManage = new CarMarkManage(MyController, this);
                }
                contentControl.Content = carMarkManage;
                break;

            case "ItemModels":
                if (carModelManage == null)
                {
                    carModelManage = new CarModelManage(MyController, this);
                }
                contentControl.Content = carModelManage;
                break;

            case "ItemUsers":
                if (userManage == null)
                {
                    userManage = new UserManage(MyController, this);
                }
                contentControl.Content = userManage;
                break;

            default:
                break;
            }
        }
Example #2
0
        public StaffMenu(Controller.AppController MyController, Wpf.WindowManager windowManager)
        {
            InitializeComponent();
            this.MyController = MyController;
            loadData();
            DataContext        = this;
            this.windowManager = windowManager;
            userName.Text      = windowManager.user.Name;
            if (windowManager.user.Rola == Model.UserRole.Admin)
            {
                //userButton.IsEnabled = true;
                ItemUsers.IsEnabled = true;
            }

            PaletteHelper paletteHelper = new PaletteHelper();
            ITheme        theme         = paletteHelper.GetTheme();

            DarkModeToggleButton.IsChecked = theme.GetBaseTheme() == BaseTheme.Dark;

            reserwationManage      = new ReserwationManage(MyController, this);
            contentControl.Content = reserwationManage;
        }