|
using System.Windows;
using System.Windows.Navigation;
using TaskList.DataModel;
using TaskList.ViewModel;
namespace TaskList
{
/// <summary>
/// Interaction logic for EditTaskPage.xaml
/// </summary>
public partial class EditTaskPage : PageFunction<Task>, IEditTaskPageView
{
private Task task;
public EditTaskPage()
: this(new Task())
{
}
public EditTaskPage(Task task)
{
this.task = task;
InitializeComponent();
this.task.BeginEdit();
}
private void okButton_Click(object sender, RoutedEventArgs e)
{
task.EndEdit();
OnReturn(new ReturnEventArgs<Task>(task));
}
private void cancelButton_Click(object sender, RoutedEventArgs e)
{
task.CancelEdit();
OnReturn(null);
}
private void Page_Loaded(object sender, RoutedEventArgs e)
{
title.Focus();
}
#region IEditTaskPageView Members
public Task Task
{
get { return task; }
}
#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.