Skip to content

Commit

Permalink
refactor: refactor DialogService, fix DarkMode toggling
Browse files Browse the repository at this point in the history
Signed-off-by: Russell Camo <[email protected]>
  • Loading branch information
russkyc committed Aug 29, 2023
1 parent 8543652 commit d5360d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion GroomWise.Application/ViewModels/AppViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private async Task SetDarkTheme(object param)
{
if (param is bool useDarkTheme)
{
ConfigurationService.DarkMode = true;
ConfigurationService.DarkMode = useDarkTheme;
ThemeManagerService.SetDarkTheme(useDarkTheme);
OnPropertyChanged(nameof(ConfigurationService.DarkMode));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using GroomWise.Views.Dialogs;
using Injectio.Attributes;

namespace GroomWise.Factories;
namespace GroomWise.Services;

[RegisterSingleton<IDialogService, DialogService>]
public class DialogService : IDialogService
Expand All @@ -23,6 +23,7 @@ public class DialogService : IDialogService
() =>
new DialogView(messageBoxText, caption)
{
ShowInTaskbar = false,
WindowStartupLocation = WindowStartupLocation.CenterOwner,
Owner = (Window)navigationService.CurrentWindow!
}.ShowDialog()
Expand All @@ -45,7 +46,9 @@ public void CloseDialogs(INavigationService navigationService)
{ } window
)
{
var owner = navigationService.CurrentWindow as Window;
window.Close();
owner!.Focus();
}
});
});
Expand All @@ -61,9 +64,10 @@ public void CreateAddAppointmentsDialog(object viewModel, INavigationService nav
{
new AddAppointmentsView(viewModel)
{
ShowInTaskbar = false,
WindowStartupLocation = WindowStartupLocation.CenterOwner,
Owner = (Window)navigationService.CurrentWindow!
}.ShowDialog();
}.Show();
}
});
});
Expand Down

0 comments on commit d5360d6

Please sign in to comment.