diff --git a/GroomWise.Application/ViewModels/AppointmentViewModel.cs b/GroomWise.Application/ViewModels/AppointmentViewModel.cs index 8c8a7f2..f4399d8 100644 --- a/GroomWise.Application/ViewModels/AppointmentViewModel.cs +++ b/GroomWise.Application/ViewModels/AppointmentViewModel.cs @@ -100,4 +100,5 @@ private async Task SaveAppointment() } }); } + } diff --git a/GroomWise.Application/ViewModels/CustomerViewModel.cs b/GroomWise.Application/ViewModels/CustomerViewModel.cs index 53f20f0..26f1a83 100644 --- a/GroomWise.Application/ViewModels/CustomerViewModel.cs +++ b/GroomWise.Application/ViewModels/CustomerViewModel.cs @@ -122,4 +122,13 @@ private async Task DeleteCustomer(object param) await Task.Run(() => GroomWiseDbContext.Customers.Delete(observableCustomer.Id)); } } + + [Command] + private async Task CloseDialogs() + { + await Task.Run(() => + { + DialogService.CloseDialogs(NavigationService); + }); + } } diff --git a/GroomWise.WPF/Views/Dialogs/AddAppointmentsView.xaml.cs b/GroomWise.WPF/Views/Dialogs/AddAppointmentsView.xaml.cs index 889c555..c28e10c 100644 --- a/GroomWise.WPF/Views/Dialogs/AddAppointmentsView.xaml.cs +++ b/GroomWise.WPF/Views/Dialogs/AddAppointmentsView.xaml.cs @@ -3,6 +3,8 @@ // Unauthorized copying or redistribution of all files, in source and binary forms via any medium // without written, signed consent from the author is strictly prohibited. +using System.ComponentModel; +using System.Linq; using GroomWise.Infrastructure.Navigation.Interfaces; namespace GroomWise.Views.Dialogs; @@ -14,4 +16,11 @@ public AddAppointmentsView(object viewModel) DataContext = viewModel; InitializeComponent(); } + + protected override void OnClosing(CancelEventArgs e) + { + var parent = App.Current.Windows.OfType().FirstOrDefault(); + parent.Focus(); + base.OnClosing(e); + } } diff --git a/GroomWise.WPF/Views/Dialogs/AddCustomersView.xaml.cs b/GroomWise.WPF/Views/Dialogs/AddCustomersView.xaml.cs index f494bbf..ed56ac4 100644 --- a/GroomWise.WPF/Views/Dialogs/AddCustomersView.xaml.cs +++ b/GroomWise.WPF/Views/Dialogs/AddCustomersView.xaml.cs @@ -3,6 +3,9 @@ // Unauthorized copying or redistribution of all files, in source and binary forms via any medium // without written, signed consent from the author is strictly prohibited. +using System.ComponentModel; +using System.Linq; + namespace GroomWise.Views.Dialogs; public partial class AddCustomersView @@ -12,4 +15,11 @@ public AddCustomersView(object vm) DataContext = vm; InitializeComponent(); } + + protected override void OnClosing(CancelEventArgs e) + { + var parent = App.Current.Windows.OfType().FirstOrDefault(); + parent.Focus(); + base.OnClosing(e); + } } diff --git a/GroomWise.WPF/Views/Templates/CustomerListCardTemplate.xaml b/GroomWise.WPF/Views/Templates/CustomerListCardTemplate.xaml index 9a515a7..61b7648 100644 --- a/GroomWise.WPF/Views/Templates/CustomerListCardTemplate.xaml +++ b/GroomWise.WPF/Views/Templates/CustomerListCardTemplate.xaml @@ -14,15 +14,17 @@ Background="Transparent" mc:Ignorable="d"> - + Text="{Binding FullName, UpdateSourceTrigger=PropertyChanged}" />