Exemple #1
0
        /// <summary>
        /// Handler invoked when user wishes to remove an event (via context menu)
        /// </summary>
        private void RemoveEvent(object sender, RoutedEventArgs e)
        {
            SelectEventArgs args  = e as SelectEventArgs;
            int             index = App.ViewModel.Items.IndexOf(args.ViewModel);

            MessageBoxResult result = MessageBox.Show(wpweeklyplanner.AppResources.RemoveMessage,
                                                      wpweeklyplanner.AppResources.RemoveTitle,
                                                      MessageBoxButton.OKCancel);

            if (result == MessageBoxResult.OK)
            {
                App.ViewModel.Items.RemoveAt(index);
            }
        }
Exemple #2
0
        /// <summary>
        /// Handler invoked when user wishes to edit an existing event (via context menu)
        /// </summary>
        private void EditEvent(object sender, RoutedEventArgs e)
        {
            SelectEventArgs args = e as SelectEventArgs;

            NavigationService.Navigate(new Uri("/EditPage.xaml?eventIndex=" + App.ViewModel.Items.IndexOf(args.ViewModel), UriKind.Relative));
        }