Skip to content

Commit

Permalink
Code Quality: Refactor Status Center code (#13276)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x5bfa authored Sep 12, 2023
1 parent 53989b9 commit 938de3d
Show file tree
Hide file tree
Showing 33 changed files with 1,462 additions and 893 deletions.
4 changes: 2 additions & 2 deletions src/Files.App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private IHost ConfigureHost()
.AddSingleton<SettingsViewModel>()
.AddSingleton<DrivesViewModel>()
.AddSingleton<NetworkDrivesViewModel>()
.AddSingleton<OngoingTasksViewModel>()
.AddSingleton<StatusCenterViewModel>()
.AddSingleton<AppearanceViewModel>()
).Build();
}
Expand Down Expand Up @@ -315,7 +315,7 @@ private async void Window_Closed(object sender, WindowEventArgs args)
UIHelpers.CloseAllDialogs();

// Close all notification banners except in progress
Ioc.Default.GetRequiredService<OngoingTasksViewModel>().CloseAllBanner();
Ioc.Default.GetRequiredService<StatusCenterViewModel>().RemoveAllCompletedItems();

// Cache the window instead of closing it
MainWindow.Instance.AppWindow.Hide();
Expand Down
20 changes: 20 additions & 0 deletions src/Files.App/Converters/EnumToStringConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Microsoft.UI.Xaml.Data;

namespace Files.App.Converters
{
internal sealed class EnumToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
return value?.ToString() ?? string.Empty;
}

public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}
106 changes: 0 additions & 106 deletions src/Files.App/Data/Items/PostedStatusBanner.cs

This file was deleted.

196 changes: 0 additions & 196 deletions src/Files.App/Data/Items/StatusBanner.cs

This file was deleted.

Loading

0 comments on commit 938de3d

Please sign in to comment.