|
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using TaskList.DataModel;
using TaskList.ViewModel;
namespace TaskList
{
/// <summary>
/// Interaction logic for TaskListPage.xaml
/// </summary>
public partial class TaskListPage : Page, ITaskListPageView
{
public TaskListPage()
{
InitializeComponent();
}
private void Page_Loaded(object sender, RoutedEventArgs e)
{
taskList.Focus();
}
#region ITaskListPageView Members
public TaskList.DataModel.Task CreateNewTask()
{
EditTaskPage page = new EditTaskPage();
page.Return += editTaskPage_Return;
NavigationService.Navigate(page);
return null;
}
public void EditTask(Task task)
{
EditTaskPage page = new EditTaskPage(task);
NavigationService.Navigate(page);
}
private void editTaskPage_Return(object sender, ReturnEventArgs<Task> e)
{
if (e != null)
{
TaskListCommands.AddTask.Execute(e.Result, taskList);
}
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Windows developer with 10+ years experience working in the banking industry.