Exemple #1
0
        public MainWindow()
        {
            CartComparer = new CartComparer();
            UserDBManager = new UserDBManager();
            UserLoginManager = new UserLoginManager(UserDBManager);

            LoginWindow = new LoginWindow(UserLoginManager);
            LoginWindow.ShowDialog();

            UserDetailsViewModel = new UserDetailsViewModel(UserLoginManager.LoggedInUser.Username);
            DataContext = UserDetailsViewModel;

            InitializeComponent();

            WiseCartManager = new WiseCartManager();

            Task T1 = Task.Factory.StartNew(() => WiseCartManager.InitializeData());

            Task T2 = T1.ContinueWith(t => ProductsDataGridLoaded());
        }
Exemple #2
0
        private void LoginDifferentUserButton_Click(object sender, RoutedEventArgs e)
        {
            LoginWindow.ShowDialog();
            UserDetailsViewModel.Username = UserLoginManager.LoggedInUser.Username;

            UserDetailsViewModel = new UserDetailsViewModel(UserLoginManager.LoggedInUser.Username);
            DataContext = UserDetailsViewModel;
        }