Esempio n. 1
0
        /// <summary>
        /// Override OnNavigatedTo.
        /// Author: ChuyangLiu
        /// </summary>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            EditTodoPageViewModel vm = e.Parameter as EditTodoPageViewModel;

            if (e != null)
            {
                ViewModel = vm;
            }
            else
            {
                ViewModel = new EditTodoPageViewModel();
            }
            // Update delete button visibility
            if (ViewModel.TodoItem == null)
            {
                deleteBtn.Visibility     = Visibility.Collapsed;
                ShareBtn.Visibility      = Visibility.Collapsed;
                UpdateTileBtn.Visibility = Visibility.Collapsed;
            }
            else
            {
                deleteBtn.Visibility     = Visibility.Visible;
                ShareBtn.Visibility      = Visibility.Visible;
                UpdateTileBtn.Visibility = Visibility.Visible;
            }

            //Add event handler
            dtm = DataTransferManager.GetForCurrentView();
            dtm.DataRequested += dtm_DataRequested;
        }
Esempio n. 2
0
        /// <summary>
        /// Add button click event.
        /// Author: ChuyangLiu
        /// </summary>
        private void AddButton_Click(object sender, RoutedEventArgs e)
        {
            EditTodoPageViewModel vm = new EditTodoPageViewModel {
                TodoItem = null,
                Year     = ViewModel.Year,
                Month    = ViewModel.Month,
                Day      = ViewModel.Day
            };

            Frame.Navigate(typeof(EditTodoPage), vm);
        }
Esempio n. 3
0
        private void ListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            TodoItem item            = e.ClickedItem as TodoItem;
            EditTodoPageViewModel vm = new EditTodoPageViewModel {
                TodoItem = item,
                Year     = ViewModel.Year,
                Month    = ViewModel.Month,
                Day      = ViewModel.Day
            };

            Frame.Navigate(typeof(EditTodoPage), vm);
        }