Added functionality to edit persons
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System.Windows;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using DebtMgr.Extensions;
|
||||
using DebtMgr.Model;
|
||||
|
||||
namespace DebtMgr.View.Dialogs
|
||||
{
|
||||
@@ -9,17 +11,24 @@ namespace DebtMgr.View.Dialogs
|
||||
/// </summary>
|
||||
public partial class NewPersonDialogView : Window
|
||||
{
|
||||
public NewPersonDialogView()
|
||||
public NewPersonDialogView(PersonDialogMode mode, Guid personId = default(Guid))
|
||||
{
|
||||
InitializeComponent();
|
||||
this.CenterOnParent();
|
||||
|
||||
App.Locator.NewPersonDialogView.ClearView();
|
||||
App.Locator.NewPersonDialogView.DialogMode = mode;
|
||||
App.Locator.NewPersonDialogView.EditPersonId = personId;
|
||||
App.Locator.NewPersonDialogView.SetModeSpecifics();
|
||||
|
||||
App.Locator.NewPersonDialogView.RequestClose += (s, e) => Close();
|
||||
DataContext = App.Locator.NewPersonDialogView;
|
||||
|
||||
FirstNameTextBox.Focus();
|
||||
}
|
||||
|
||||
#region TextBox_OnKeyUp()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// <summary> Event handler. Called by TextBox for on key up events. </summary>
|
||||
///
|
||||
@@ -34,6 +43,10 @@ namespace DebtMgr.View.Dialogs
|
||||
App.Locator.NewPersonDialogView.CreatePersonButtonClickCommand.Execute(null);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Window_KeyUp()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// <summary> Event handler. Called by Window for key up events. </summary>
|
||||
///
|
||||
@@ -47,5 +60,7 @@ namespace DebtMgr.View.Dialogs
|
||||
if (e.Key.Equals(Key.Escape))
|
||||
Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user