示例#1
0
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (PhotoView.IsSelected)
            {
                AppFrame.Navigate(typeof(Domain.Photo.View));
            }
            if (PairView.IsSelected)
            {
                AppFrame.Navigate(typeof(Domain.Pair.View));
            }
            if (StudentView.IsSelected)
            {
                AppFrame.Navigate(typeof(Domain.Student.View));
            }
            // if (_REPLACEME_View.IsSelected)
            // {
            //     AppFrame.Navigate(typeof(Domain._REPLACEME_.View));
            // }

            string nameOfSelection = ((ListBoxItem)e.AddedItems[0]).Name;

            if (nameOfSelection == "Load")
            {
                AppFrame.Navigate(typeof(OpeningView));
                UserActionPresenter.PresentMessageOkCancel("Are you sure you want to LOAD model data?", "Load", new RelayCommand(AppConfig.Load));
            }
            if (nameOfSelection == "Save")
            {
                AppFrame.Navigate(typeof(OpeningView));
                UserActionPresenter.PresentMessageOkCancel("Are you sure you want to SAVE model data?", "Save", new RelayCommand(AppConfig.Save));
            }
        }
示例#2
0
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (CustomerView.IsSelected)
            {
                AppFrame.Navigate(typeof(Domain.Customer.View));
            }
            if (CarView.IsSelected)
            {
                AppFrame.Navigate(typeof(Domain.Car.View));
            }
            if (SalespersonView.IsSelected)
            {
                AppFrame.Navigate(typeof(Domain.Salesperson.View));
            }
            if (SalesView.IsSelected)
            {
                AppFrame.Navigate(typeof(Domain.Sale.View));
            }
            string nameOfSelection = ((ListBoxItem)e.AddedItems[0]).Name;

            if (nameOfSelection == "Load")
            {
                AppFrame.Navigate(typeof(OpeningView));
                UserActionPresenter.PresentMessageOkCancel("Are you sure you want to LOAD model data?", "Load", new RelayCommand(AppConfig.Load));
            }
            if (nameOfSelection == "Save")
            {
                AppFrame.Navigate(typeof(OpeningView));
                UserActionPresenter.PresentMessageOkCancel("Are you sure you want to SAVE model data?", "Save", new RelayCommand(AppConfig.Save));
            }
            if (nameOfSelection == "Quit")
            {
                AppFrame.Navigate(typeof(OpeningView));
                UserActionPresenter.PresentMessageOkCancel("Are you sure you want to QUIT?", "QUIT", new RelayCommand(Application.Current.Exit));
            }
        }
示例#3
0
 /// <summary>
 /// Relays presentation of a validation error
 /// to the UserActionPresenter class
 /// </summary>
 /// <param name="message">Error message</param>
 /// <param name="undo">Code for undoing invalid change</param>
 protected void PresentValidationError(string message, Action undo)
 {
     UserActionPresenter.PresentMessageOkOnly(message, "Undo", new RelayCommand(undo));
 }