Code review cleanup: dead code, unused capability, accessibility gap
- Remove unused `using Microsoft.Win32;` from MainPage.xaml.cs (leftover from the WPF OpenFileDialog era; WinUI uses Windows.Storage.Pickers) - Trim App.xaml.cs down to the two usings it actually needs instead of the full WinUI3 template boilerplate list - Change App.MainWindowInstance to an internal setter (only MainWindow itself should assign it) - Add AutomationProperties.Name to the icon-only Settings button so screen readers announce it (it only had a mouse tooltip before) - Delete Assets/AppIcon.ico: unreferenced by both the manifest and code, the real app icon comes from ApplicationIcon (branding/AmiReel.ico) and AppWindow.SetIcon at runtime - Drop the systemAIModels capability from Package.appxmanifest; the app doesn't call any Windows AI API, so declaring it is an unnecessary privilege request Verified: dotnet build produces 0 warnings/errors, app launches unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+3
-17
@@ -1,20 +1,6 @@
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.ApplicationModel.Activation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Microsoft.UI.Xaml.Shapes;
|
||||
using Microsoft.UI.Xaml;
|
||||
using WinRT.Interop;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace AmiReel;
|
||||
|
||||
/// <summary>
|
||||
@@ -24,8 +10,8 @@ public partial class App : Application
|
||||
{
|
||||
private Window? _window;
|
||||
public static IntPtr MainWindowHandle { get; private set; }
|
||||
public static MainWindow? MainWindowInstance { get; set; }
|
||||
|
||||
public static MainWindow? MainWindowInstance { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the singleton application object. This is the first line of authored code
|
||||
/// executed, and as such is the logical equivalent of main() or WinMain().
|
||||
|
||||
Reference in New Issue
Block a user