Added functionality to edit persons
This commit is contained in:
@@ -24,10 +24,6 @@ namespace DebtMgr.View.Dialogs
|
||||
App.Locator.AddTransactionView.RequestClose += (s, e) => Close();
|
||||
|
||||
DataContext = App.Locator.AddTransactionView;
|
||||
|
||||
//Uri iconUri = new Uri("pack://application:,,,/Content/money_red.ico", UriKind.RelativeOrAbsolute);
|
||||
|
||||
//this.Icon = BitmapFrame.Create(iconUri);
|
||||
}
|
||||
|
||||
#region TextBox_OnKeyUp()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
mc:Ignorable="d"
|
||||
Name="NewPersonDialogViewWindow"
|
||||
Icon="../../Content/addperson.ico"
|
||||
Title="New Person" Height="205" Width="300"
|
||||
Title="{Binding WindowTitle}" Height="205" Width="300"
|
||||
KeyUp="Window_KeyUp">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
@@ -16,7 +16,7 @@
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Content="New Person" FontWeight="Bold" FontSize="18"></Label>
|
||||
<Label Grid.Row="0" Content="{Binding ElementName=NewPersonDialogViewWindow, Path=Title}" FontWeight="Bold" FontSize="18"></Label>
|
||||
<StackPanel Grid.Row="1" Orientation="Vertical" Margin="10 0">
|
||||
<TextBox KeyUp="TextBox_OnKeyUp" Name="FirstNameTextBox" Text="{Binding FirstNameTextBoxText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 -5"></TextBox>
|
||||
<Label Content="First name"></Label>
|
||||
@@ -30,7 +30,7 @@
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="1" Content="Create Person" FontSize="14" Padding="5" Margin="10 -10" Command="{Binding CreatePersonButtonClickCommand}"></Button>
|
||||
<Button Grid.Column="1" Content="{Binding SaveButtonText}" FontSize="14" Padding="5" Margin="10 -10" Command="{Binding CreatePersonButtonClickCommand}"></Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -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