Exemplo n.º 1
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     ViewModel = ((ViewModels.TodoItemViewModel)e.Parameter);
     if (ViewModel.SelectedItem == null)
     {
         createButton.Content = "Create";
         //var i = new MessageDialog("Welcome!").ShowAsync();
     }
     else
     {
         createButton.Content = "Update";
         title.Text           = ViewModel.SelectedItem.title;
         details.Text         = ViewModel.SelectedItem.description;
         dueDate.Date         = ViewModel.SelectedItem.date;
         BitmapImage pic = myImage.Source as BitmapImage;
         myImage.Source = pic;
     }
 }
Exemplo n.º 2
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (e.Parameter.GetType() == typeof(ViewModels.TodoItemViewModel))
     {
         this.ViewModel = (ViewModels.TodoItemViewModel)(e.Parameter);
     }
     if (ViewModel.SelectedItem == null)
     {
         createButton.Content = "Create";
         //var i = new MessageDialog("Welcome!").ShowAsync();
     }
     else
     {
         createButton.Content = "Update";
         title.Text           = ViewModel.SelectedItem.title;
         details.Text         = ViewModel.SelectedItem.description;
         dueDate.Date         = ViewModel.SelectedItem.date;
         BitmapImage pic = myImage.Source as BitmapImage;
         myImage.Source = pic;
     }
     DataTransferManager.GetForCurrentView().DataRequested += OnShareDataRequested;
 }