Example #1
0
        public UserMenu(Controller.AppController MyController, Wpf.WindowManager windowManager)
        {
            InitializeComponent();
            this.MyController  = MyController;
            DataContext        = this;
            this.WindowManager = windowManager;
            currentUser        = windowManager.user;
            LoadData();
            userName.Text = currentUser.UserName;

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

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

            //if (paletteHelper.GetThemeManager() is  themeManager)
            //{
            //    themeManager.ThemeChanged += (_, e) =>
            //    {
            //        DarkModeToggleButton.IsChecked = e.NewTheme?.GetBaseTheme() == BaseTheme.Dark;
            //    };
            //}
            if (carAvailableList == null)
            {
                carAvailableList = new CarAvailableList(MyController, this);
            }
            contentControl.Content = carAvailableList;
        }
Example #2
0
        private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch (((ListViewItem)((ListView)sender).SelectedItem).Name)
            {
            case "ItemUserRentHistory":
                if (rentHistory == null)
                {
                    rentHistory = new UserRentHistory();
                }
                contentControl.Content = rentHistory;
                break;

            case "ItemCar":
                if (carAvailableList == null)
                {
                    carAvailableList = new CarAvailableList(MyController, this);
                }
                contentControl.Content = carAvailableList;
                break;

            case "ItemAccount":
                contentControl.Content = new UserAccountDetails(MyController, currentUser, this);
                break;

            case "ItemPassword":
                contentControl.Content = new UserChangePassword(MyController, currentUser, this);
                break;

            default:
                break;
            }
        }
Example #3
0
 public void closeReservationWindow()
 {
     if (carAvailableList == null)
     {
         carAvailableList = new CarAvailableList(MyController, this);
     }
     contentControl.Content = carAvailableList;
     if (makeReservation != null)
     {
         makeReservation = null;
     }
 }