protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (!NavigationContext.QueryString.ContainsKey("newTask")) { if (_task != null) { txtTitle.Text = _task.Title; chkIsDone.IsChecked = _task.IsDone; txtDescription.Text = _task.Description; } } else { _task = new TaskModel {Id = Guid.NewGuid()}; } }
public TaskForm() { InitializeComponent(); _task = App.ViewModel.SelectedTask; }