Added functionality to edit persons

This commit is contained in:
Andre Beging
2017-09-12 21:01:51 +02:00
parent 4a6c6ef544
commit ffbf5d7be9
8 changed files with 216 additions and 59 deletions

View File

@@ -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
}
}