diff --git a/Community Installers/README.md b/Community Installers/README.md deleted file mode 100644 index fae3b23..0000000 --- a/Community Installers/README.md +++ /dev/null @@ -1 +0,0 @@ -Note: Some of the files included with installer files may use code from outside sources and as such, would not be covered by the open source license. Only the virtual display driver itself is fully FOSS, while other terms may apply based on the installer packaging method used. diff --git a/Community Installers/VDD Panel/.editorconfig b/Community Installers/VDD Panel/.editorconfig deleted file mode 100644 index fd05618..0000000 --- a/Community Installers/VDD Panel/.editorconfig +++ /dev/null @@ -1,202 +0,0 @@ -# Rules in this file were initially inferred by Visual Studio IntelliCode from the Template Studio codebase. -# You can modify the rules from these initially generated values to suit your own policies. -# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference. - -[*.cs] - -#Core editorconfig formatting - indentation - -#use soft tabs (spaces) for indentation -indent_style = space - -#Formatting - new line options - -#place else statements on a new line -csharp_new_line_before_else = true -#require braces to be on a new line for lambdas, methods, control_blocks, types, properties, and accessors (also known as "Allman" style) -csharp_new_line_before_open_brace = all - -#Formatting - organize using options - -#sort System.* using directives alphabetically, and place them before other usings -dotnet_sort_system_directives_first = true - -#Formatting - spacing options - -#require NO space between a cast and the value -csharp_space_after_cast = false -#require a space before the colon for bases or interfaces in a type declaration -csharp_space_after_colon_in_inheritance_clause = true -#require a space after a keyword in a control flow statement such as a for loop -csharp_space_after_keywords_in_control_flow_statements = true -#require a space before the colon for bases or interfaces in a type declaration -csharp_space_before_colon_in_inheritance_clause = true -#remove space within empty argument list parentheses -csharp_space_between_method_call_empty_parameter_list_parentheses = false -#remove space between method call name and opening parenthesis -csharp_space_between_method_call_name_and_opening_parenthesis = false -#do not place space characters after the opening parenthesis and before the closing parenthesis of a method call -csharp_space_between_method_call_parameter_list_parentheses = false -#remove space within empty parameter list parentheses for a method declaration -csharp_space_between_method_declaration_empty_parameter_list_parentheses = false -#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list. -csharp_space_between_method_declaration_parameter_list_parentheses = false - -#Formatting - wrapping options - -#leave code block on separate lines -csharp_preserve_single_line_blocks = false - -#Style - Code block preferences - -#prefer curly braces even for one line of code -csharp_prefer_braces = true:suggestion - -#Style - expression bodied member options - -#prefer expression bodies for accessors -csharp_style_expression_bodied_accessors = true:warning -#prefer block bodies for constructors -csharp_style_expression_bodied_constructors = false:suggestion -#prefer expression bodies for methods -csharp_style_expression_bodied_methods = when_on_single_line:silent -#prefer expression-bodied members for properties -csharp_style_expression_bodied_properties = true:warning - -#Style - expression level options - -#prefer out variables to be declared before the method call -csharp_style_inlined_variable_declaration = false:suggestion -#prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them -dotnet_style_predefined_type_for_member_access = true:suggestion - -#Style - Expression-level preferences - -#prefer default over default(T) -csharp_prefer_simple_default_expression = true:suggestion -#prefer objects to be initialized using object initializers when possible -dotnet_style_object_initializer = true:suggestion - -#Style - implicit and explicit types - -#prefer var over explicit type in all cases, unless overridden by another code style rule -csharp_style_var_elsewhere = true:suggestion -#prefer var is used to declare variables with built-in system types such as int -csharp_style_var_for_built_in_types = true:suggestion -#prefer var when the type is already mentioned on the right-hand side of a declaration expression -csharp_style_var_when_type_is_apparent = true:suggestion - -#Style - language keyword and framework type options - -#prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them -dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion - -#Style - Language rules -csharp_style_implicit_object_creation_when_type_is_apparent = true:warning -csharp_style_var_for_built_in_types = true:warning - -#Style - modifier options - -#prefer accessibility modifiers to be declared except for public interface members. This will currently not differ from always and will act as future proofing for if C# adds default interface methods. -dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion - -#Style - Modifier preferences - -#when this rule is set to a list of modifiers, prefer the specified ordering. -csharp_preferred_modifier_order = public,private,protected,internal,static,async,readonly,override,sealed,abstract,virtual:warning -dotnet_style_readonly_field = true:warning - -#Style - Pattern matching - -#prefer pattern matching instead of is expression with type casts -csharp_style_pattern_matching_over_as_with_null_check = true:warning - -#Style - qualification options - -#prefer events not to be prefaced with this. or Me. in Visual Basic -dotnet_style_qualification_for_event = false:suggestion -#prefer fields not to be prefaced with this. or Me. in Visual Basic -dotnet_style_qualification_for_field = false:suggestion -#prefer methods not to be prefaced with this. or Me. in Visual Basic -dotnet_style_qualification_for_method = false:suggestion -#prefer properties not to be prefaced with this. or Me. in Visual Basic -dotnet_style_qualification_for_property = false:suggestion -csharp_indent_labels = one_less_than_current -csharp_using_directive_placement = outside_namespace:silent -csharp_prefer_simple_using_statement = true:warning -csharp_style_namespace_declarations = file_scoped:warning -csharp_style_expression_bodied_operators = false:silent -csharp_style_expression_bodied_indexers = true:silent -csharp_style_expression_bodied_lambdas = true:silent -csharp_style_expression_bodied_local_functions = false:silent - -[*.{cs,vb}] -dotnet_style_operator_placement_when_wrapping = beginning_of_line -tab_width = 4 -indent_size = 4 -end_of_line = crlf -dotnet_style_coalesce_expression = true:suggestion -dotnet_style_null_propagation = true:suggestion -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion -dotnet_style_prefer_auto_properties = true:silent -dotnet_style_object_initializer = true:suggestion -dotnet_style_collection_initializer = true:suggestion -dotnet_style_prefer_simplified_boolean_expressions = true:suggestion -dotnet_style_prefer_conditional_expression_over_assignment = true:silent -dotnet_style_prefer_conditional_expression_over_return = true:silent -[*.{cs,vb}] - -#Style - Unnecessary code rules -csharp_style_unused_value_assignment_preference = discard_variable:warning - -#### Naming styles #### - -# Naming rules - -dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion -dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface -dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i - -dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.types_should_be_pascal_case.symbols = types -dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case - -dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members -dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case - -# Symbol specifications - -dotnet_naming_symbols.interface.applicable_kinds = interface -dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.interface.required_modifiers = - -dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum -dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.types.required_modifiers = - -dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method -dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.non_field_members.required_modifiers = - -# Naming styles - -dotnet_naming_style.begins_with_i.required_prefix = I -dotnet_naming_style.begins_with_i.required_suffix = -dotnet_naming_style.begins_with_i.word_separator = -dotnet_naming_style.begins_with_i.capitalization = pascal_case - -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = -dotnet_naming_style.pascal_case.capitalization = pascal_case - -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = -dotnet_naming_style.pascal_case.capitalization = pascal_case -dotnet_style_explicit_tuple_names = true:suggestion -dotnet_style_prefer_inferred_tuple_names = true:suggestion -dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion -dotnet_style_prefer_compound_assignment = true:warning -dotnet_style_prefer_simplified_interpolation = true:suggestion diff --git a/Community Installers/VDD Panel/.vsconfig b/Community Installers/VDD Panel/.vsconfig deleted file mode 100644 index 65d1f73..0000000 --- a/Community Installers/VDD Panel/.vsconfig +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": "1.0", - "components": [ - "Microsoft.Component.MSBuild", - "Microsoft.NetCore.Component.Runtime.7.0", - "Microsoft.NetCore.Component.SDK", - "Microsoft.VisualStudio.Component.ManagedDesktop.Core", - "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", - "Microsoft.VisualStudio.Component.NuGet", - "Microsoft.VisualStudio.Component.Windows10SDK.19041", - "Microsoft.VisualStudio.Component.Windows10SDK", - "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging", - "Microsoft.VisualStudio.ComponentGroup.WindowsAppSDK.Cs", - "Microsoft.VisualStudio.Workload.ManagedDesktop" - ] -} diff --git a/Community Installers/VDD Panel/VDD Panel.Core/Contracts/Services/IFileService.cs b/Community Installers/VDD Panel/VDD Panel.Core/Contracts/Services/IFileService.cs deleted file mode 100644 index 3ef6098..0000000 --- a/Community Installers/VDD Panel/VDD Panel.Core/Contracts/Services/IFileService.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace VDD_Panel.Core.Contracts.Services; - -public interface IFileService -{ - T Read(string folderPath, string fileName); - - void Save(string folderPath, string fileName, T content); - - void Delete(string folderPath, string fileName); -} diff --git a/Community Installers/VDD Panel/VDD Panel.Core/Helpers/Json.cs b/Community Installers/VDD Panel/VDD Panel.Core/Helpers/Json.cs deleted file mode 100644 index 0857754..0000000 --- a/Community Installers/VDD Panel/VDD Panel.Core/Helpers/Json.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Newtonsoft.Json; - -namespace VDD_Panel.Core.Helpers; - -public static class Json -{ - public static async Task ToObjectAsync(string value) - { - return await Task.Run(() => - { - return JsonConvert.DeserializeObject(value); - }); - } - - public static async Task StringifyAsync(object value) - { - return await Task.Run(() => - { - return JsonConvert.SerializeObject(value); - }); - } -} diff --git a/Community Installers/VDD Panel/VDD Panel.Core/README.md b/Community Installers/VDD Panel/VDD Panel.Core/README.md deleted file mode 100644 index 906c066..0000000 --- a/Community Installers/VDD Panel/VDD Panel.Core/README.md +++ /dev/null @@ -1,5 +0,0 @@ -*Recommended Markdown Viewer: [Markdown Editor](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.MarkdownEditor2)* - -## Getting Started - -The Core project contains code that can be [reused across multiple application projects](https://docs.microsoft.com/dotnet/standard/net-standard#net-5-and-net-standard). diff --git a/Community Installers/VDD Panel/VDD Panel.Core/Services/FileService.cs b/Community Installers/VDD Panel/VDD Panel.Core/Services/FileService.cs deleted file mode 100644 index f7c0824..0000000 --- a/Community Installers/VDD Panel/VDD Panel.Core/Services/FileService.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Text; - -using Newtonsoft.Json; - -using VDD_Panel.Core.Contracts.Services; - -namespace VDD_Panel.Core.Services; - -public class FileService : IFileService -{ - public T Read(string folderPath, string fileName) - { - var path = Path.Combine(folderPath, fileName); - if (File.Exists(path)) - { - var json = File.ReadAllText(path); - return JsonConvert.DeserializeObject(json); - } - - return default; - } - - public void Save(string folderPath, string fileName, T content) - { - if (!Directory.Exists(folderPath)) - { - Directory.CreateDirectory(folderPath); - } - - var fileContent = JsonConvert.SerializeObject(content); - File.WriteAllText(Path.Combine(folderPath, fileName), fileContent, Encoding.UTF8); - } - - public void Delete(string folderPath, string fileName) - { - if (fileName != null && File.Exists(Path.Combine(folderPath, fileName))) - { - File.Delete(Path.Combine(folderPath, fileName)); - } - } -} diff --git a/Community Installers/VDD Panel/VDD Panel.Core/VDD Panel.Core.csproj b/Community Installers/VDD Panel/VDD Panel.Core/VDD Panel.Core.csproj deleted file mode 100644 index 31792eb..0000000 --- a/Community Installers/VDD Panel/VDD Panel.Core/VDD Panel.Core.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - net7.0 - VDD_Panel.Core - AnyCPU;x64;x86 - x86;x64;arm64;AnyCPU - enable - - - - - - - - - - diff --git a/Community Installers/VDD Panel/VDD Panel.sln b/Community Installers/VDD Panel/VDD Panel.sln deleted file mode 100644 index 7a7c9f7..0000000 --- a/Community Installers/VDD Panel/VDD Panel.sln +++ /dev/null @@ -1,69 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34622.214 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VDD Panel", "VDD Panel\VDD Panel.csproj", "{5FA23A93-E3D0-46A3-89AA-A909685E2784}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VDD Panel.Core", "VDD Panel.Core\VDD Panel.Core.csproj", "{29E3EAF5-65AE-4ACA-B550-983DBCE38E03}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|arm64 = Debug|arm64 - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|arm64 = Release|arm64 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Debug|Any CPU.ActiveCfg = Debug|x64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Debug|Any CPU.Build.0 = Debug|x64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Debug|Any CPU.Deploy.0 = Debug|x64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Debug|arm64.ActiveCfg = Debug|arm64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Debug|arm64.Build.0 = Debug|arm64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Debug|arm64.Deploy.0 = Debug|arm64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Debug|x64.ActiveCfg = Debug|x64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Debug|x64.Build.0 = Debug|x64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Debug|x64.Deploy.0 = Debug|x64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Debug|x86.ActiveCfg = Debug|x86 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Debug|x86.Build.0 = Debug|x86 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Debug|x86.Deploy.0 = Debug|x86 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Release|Any CPU.ActiveCfg = Release|x64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Release|Any CPU.Build.0 = Release|x64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Release|Any CPU.Deploy.0 = Release|x64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Release|arm64.ActiveCfg = Release|arm64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Release|arm64.Build.0 = Release|arm64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Release|arm64.Deploy.0 = Release|arm64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Release|x64.ActiveCfg = Release|x64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Release|x64.Build.0 = Release|x64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Release|x64.Deploy.0 = Release|x64 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Release|x86.ActiveCfg = Release|x86 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Release|x86.Build.0 = Release|x86 - {5FA23A93-E3D0-46A3-89AA-A909685E2784}.Release|x86.Deploy.0 = Release|x86 - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Debug|Any CPU.Build.0 = Debug|Any CPU - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Debug|arm64.ActiveCfg = Debug|arm64 - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Debug|arm64.Build.0 = Debug|arm64 - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Debug|x64.ActiveCfg = Debug|x64 - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Debug|x64.Build.0 = Debug|x64 - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Debug|x86.ActiveCfg = Debug|x86 - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Debug|x86.Build.0 = Debug|x86 - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Release|Any CPU.ActiveCfg = Release|Any CPU - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Release|Any CPU.Build.0 = Release|Any CPU - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Release|arm64.ActiveCfg = Release|arm64 - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Release|arm64.Build.0 = Release|arm64 - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Release|x64.ActiveCfg = Release|x64 - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Release|x64.Build.0 = Release|x64 - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Release|x86.ActiveCfg = Release|x86 - {29E3EAF5-65AE-4ACA-B550-983DBCE38E03}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {81C98471-4829-40B4-B60F-CEB2472667FC} - EndGlobalSection -EndGlobal diff --git a/Community Installers/VDD Panel/VDD Panel/Activation/ActivationHandler.cs b/Community Installers/VDD Panel/VDD Panel/Activation/ActivationHandler.cs deleted file mode 100644 index 5a64409..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Activation/ActivationHandler.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace VDD_Panel.Activation; - -// Extend this class to implement new ActivationHandlers. See DefaultActivationHandler for an example. -// https://github.com/microsoft/TemplateStudio/blob/main/docs/WinUI/activation.md -public abstract class ActivationHandler : IActivationHandler - where T : class -{ - // Override this method to add the logic for whether to handle the activation. - protected virtual bool CanHandleInternal(T args) => true; - - // Override this method to add the logic for your activation handler. - protected abstract Task HandleInternalAsync(T args); - - public bool CanHandle(object args) => args is T && CanHandleInternal((args as T)!); - - public async Task HandleAsync(object args) => await HandleInternalAsync((args as T)!); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Activation/AppNotificationActivationHandler.cs b/Community Installers/VDD Panel/VDD Panel/Activation/AppNotificationActivationHandler.cs deleted file mode 100644 index a823e45..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Activation/AppNotificationActivationHandler.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.UI.Dispatching; -using Microsoft.UI.Xaml; -using Microsoft.Windows.AppLifecycle; -using Microsoft.Windows.AppNotifications; - -using VDD_Panel.Contracts.Services; -using VDD_Panel.ViewModels; - -namespace VDD_Panel.Activation; - -public class AppNotificationActivationHandler : ActivationHandler -{ - private readonly INavigationService _navigationService; - private readonly IAppNotificationService _notificationService; - - public AppNotificationActivationHandler(INavigationService navigationService, IAppNotificationService notificationService) - { - _navigationService = navigationService; - _notificationService = notificationService; - } - - protected override bool CanHandleInternal(LaunchActivatedEventArgs args) - { - return AppInstance.GetCurrent().GetActivatedEventArgs()?.Kind == ExtendedActivationKind.AppNotification; - } - - protected async override Task HandleInternalAsync(LaunchActivatedEventArgs args) - { - // TODO: Handle notification activations. - - //// // Access the AppNotificationActivatedEventArgs. - //// var activatedEventArgs = (AppNotificationActivatedEventArgs)AppInstance.GetCurrent().GetActivatedEventArgs().Data; - - //// // Navigate to a specific page based on the notification arguments. - //// if (_notificationService.ParseArguments(activatedEventArgs.Argument)["action"] == "Settings") - //// { - //// // Queue navigation with low priority to allow the UI to initialize. - //// App.MainWindow.DispatcherQueue.TryEnqueue(DispatcherQueuePriority.Low, () => - //// { - //// _navigationService.NavigateTo(typeof(SettingsViewModel).FullName!); - //// }); - //// } - - App.MainWindow.DispatcherQueue.TryEnqueue(DispatcherQueuePriority.Low, () => - { - App.MainWindow.ShowMessageDialogAsync("TODO: Handle notification activations.", "Notification Activation"); - }); - - await Task.CompletedTask; - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Activation/DefaultActivationHandler.cs b/Community Installers/VDD Panel/VDD Panel/Activation/DefaultActivationHandler.cs deleted file mode 100644 index b18bc86..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Activation/DefaultActivationHandler.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.UI.Xaml; - -using VDD_Panel.Contracts.Services; -using VDD_Panel.ViewModels; - -namespace VDD_Panel.Activation; - -public class DefaultActivationHandler : ActivationHandler -{ - private readonly INavigationService _navigationService; - - public DefaultActivationHandler(INavigationService navigationService) - { - _navigationService = navigationService; - } - - protected override bool CanHandleInternal(LaunchActivatedEventArgs args) - { - // None of the ActivationHandlers has handled the activation. - return _navigationService.Frame?.Content == null; - } - - protected async override Task HandleInternalAsync(LaunchActivatedEventArgs args) - { - _navigationService.NavigateTo(typeof(MainViewModel).FullName!, args.Arguments); - - await Task.CompletedTask; - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Activation/IActivationHandler.cs b/Community Installers/VDD Panel/VDD Panel/Activation/IActivationHandler.cs deleted file mode 100644 index 946c123..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Activation/IActivationHandler.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace VDD_Panel.Activation; - -public interface IActivationHandler -{ - bool CanHandle(object args); - - Task HandleAsync(object args); -} diff --git a/Community Installers/VDD Panel/VDD Panel/App.xaml b/Community Installers/VDD Panel/VDD Panel/App.xaml deleted file mode 100644 index 7c4096c..0000000 --- a/Community Installers/VDD Panel/VDD Panel/App.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/Community Installers/VDD Panel/VDD Panel/App.xaml.cs b/Community Installers/VDD Panel/VDD Panel/App.xaml.cs deleted file mode 100644 index 3b0a081..0000000 --- a/Community Installers/VDD Panel/VDD Panel/App.xaml.cs +++ /dev/null @@ -1,111 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.UI.Xaml; - -using VDD_Panel.Activation; -using VDD_Panel.Contracts.Services; -using VDD_Panel.Core.Contracts.Services; -using VDD_Panel.Core.Services; -using VDD_Panel.Helpers; -using VDD_Panel.Models; -using VDD_Panel.Notifications; -using VDD_Panel.Services; -using VDD_Panel.ViewModels; -using VDD_Panel.Views; - -namespace VDD_Panel; - -// To learn more about WinUI 3, see https://docs.microsoft.com/windows/apps/winui/winui3/. -public partial class App : Application -{ - // The .NET Generic Host provides dependency injection, configuration, logging, and other services. - // https://docs.microsoft.com/dotnet/core/extensions/generic-host - // https://docs.microsoft.com/dotnet/core/extensions/dependency-injection - // https://docs.microsoft.com/dotnet/core/extensions/configuration - // https://docs.microsoft.com/dotnet/core/extensions/logging - public IHost Host - { - get; - } - - public static T GetService() - where T : class - { - if ((App.Current as App)!.Host.Services.GetService(typeof(T)) is not T service) - { - throw new ArgumentException($"{typeof(T)} needs to be registered in ConfigureServices within App.xaml.cs."); - } - - return service; - } - - public static WindowEx MainWindow { get; } = new MainWindow(); - - public static UIElement? AppTitlebar { get; set; } - - public App() - { - InitializeComponent(); - - Host = Microsoft.Extensions.Hosting.Host. - CreateDefaultBuilder(). - UseContentRoot(AppContext.BaseDirectory). - ConfigureServices((context, services) => - { - // Default Activation Handler - services.AddTransient, DefaultActivationHandler>(); - - // Other Activation Handlers - services.AddTransient(); - - // Services - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddTransient(); - services.AddTransient(); - - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - - // Core Services - services.AddSingleton(); - - // Views and ViewModels - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - - // Configuration - services.Configure(context.Configuration.GetSection(nameof(LocalSettingsOptions))); - }). - Build(); - - App.GetService().Initialize(); - - UnhandledException += App_UnhandledException; - } - - private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e) - { - // TODO: Log and handle exceptions as appropriate. - // https://docs.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.application.unhandledexception. - } - - protected async override void OnLaunched(LaunchActivatedEventArgs args) - { - base.OnLaunched(args); - - App.GetService().Show(string.Format("AppNotificationSamplePayload".GetLocalized(), AppContext.BaseDirectory)); - - await App.GetService().ActivateAsync(args); - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Assets/LockScreenLogo.scale-200.png b/Community Installers/VDD Panel/VDD Panel/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 735f57a..0000000 Binary files a/Community Installers/VDD Panel/VDD Panel/Assets/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/Community Installers/VDD Panel/VDD Panel/Assets/SplashScreen.scale-200.png b/Community Installers/VDD Panel/VDD Panel/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 023e7f1..0000000 Binary files a/Community Installers/VDD Panel/VDD Panel/Assets/SplashScreen.scale-200.png and /dev/null differ diff --git a/Community Installers/VDD Panel/VDD Panel/Assets/Square150x150Logo.scale-200.png b/Community Installers/VDD Panel/VDD Panel/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index af49fec..0000000 Binary files a/Community Installers/VDD Panel/VDD Panel/Assets/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/Community Installers/VDD Panel/VDD Panel/Assets/Square44x44Logo.scale-200.png b/Community Installers/VDD Panel/VDD Panel/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index ce342a2..0000000 Binary files a/Community Installers/VDD Panel/VDD Panel/Assets/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/Community Installers/VDD Panel/VDD Panel/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/Community Installers/VDD Panel/VDD Panel/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index f6c02ce..0000000 Binary files a/Community Installers/VDD Panel/VDD Panel/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/Community Installers/VDD Panel/VDD Panel/Assets/StoreLogo.png b/Community Installers/VDD Panel/VDD Panel/Assets/StoreLogo.png deleted file mode 100644 index 7385b56..0000000 Binary files a/Community Installers/VDD Panel/VDD Panel/Assets/StoreLogo.png and /dev/null differ diff --git a/Community Installers/VDD Panel/VDD Panel/Assets/Wide310x150Logo.scale-200.png b/Community Installers/VDD Panel/VDD Panel/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index 288995b..0000000 Binary files a/Community Installers/VDD Panel/VDD Panel/Assets/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/Community Installers/VDD Panel/VDD Panel/Assets/WindowIcon.ico b/Community Installers/VDD Panel/VDD Panel/Assets/WindowIcon.ico deleted file mode 100644 index 5bbd48e..0000000 Binary files a/Community Installers/VDD Panel/VDD Panel/Assets/WindowIcon.ico and /dev/null differ diff --git a/Community Installers/VDD Panel/VDD Panel/Behaviors/NavigationViewHeaderBehavior.cs b/Community Installers/VDD Panel/VDD Panel/Behaviors/NavigationViewHeaderBehavior.cs deleted file mode 100644 index ebf9890..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Behaviors/NavigationViewHeaderBehavior.cs +++ /dev/null @@ -1,122 +0,0 @@ -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Navigation; -using Microsoft.Xaml.Interactivity; - -using VDD_Panel.Contracts.Services; - -namespace VDD_Panel.Behaviors; - -public class NavigationViewHeaderBehavior : Behavior -{ - private static NavigationViewHeaderBehavior? _current; - - private Page? _currentPage; - - public DataTemplate? DefaultHeaderTemplate - { - get; set; - } - - public object DefaultHeader - { - get => GetValue(DefaultHeaderProperty); - set => SetValue(DefaultHeaderProperty, value); - } - - public static readonly DependencyProperty DefaultHeaderProperty = - DependencyProperty.Register("DefaultHeader", typeof(object), typeof(NavigationViewHeaderBehavior), new PropertyMetadata(null, (d, e) => _current!.UpdateHeader())); - - public static NavigationViewHeaderMode GetHeaderMode(Page item) => (NavigationViewHeaderMode)item.GetValue(HeaderModeProperty); - - public static void SetHeaderMode(Page item, NavigationViewHeaderMode value) => item.SetValue(HeaderModeProperty, value); - - public static readonly DependencyProperty HeaderModeProperty = - DependencyProperty.RegisterAttached("HeaderMode", typeof(bool), typeof(NavigationViewHeaderBehavior), new PropertyMetadata(NavigationViewHeaderMode.Always, (d, e) => _current!.UpdateHeader())); - - public static object GetHeaderContext(Page item) => item.GetValue(HeaderContextProperty); - - public static void SetHeaderContext(Page item, object value) => item.SetValue(HeaderContextProperty, value); - - public static readonly DependencyProperty HeaderContextProperty = - DependencyProperty.RegisterAttached("HeaderContext", typeof(object), typeof(NavigationViewHeaderBehavior), new PropertyMetadata(null, (d, e) => _current!.UpdateHeader())); - - public static DataTemplate GetHeaderTemplate(Page item) => (DataTemplate)item.GetValue(HeaderTemplateProperty); - - public static void SetHeaderTemplate(Page item, DataTemplate value) => item.SetValue(HeaderTemplateProperty, value); - - public static readonly DependencyProperty HeaderTemplateProperty = - DependencyProperty.RegisterAttached("HeaderTemplate", typeof(DataTemplate), typeof(NavigationViewHeaderBehavior), new PropertyMetadata(null, (d, e) => _current!.UpdateHeaderTemplate())); - - protected override void OnAttached() - { - base.OnAttached(); - - var navigationService = App.GetService(); - navigationService.Navigated += OnNavigated; - - _current = this; - } - - protected override void OnDetaching() - { - base.OnDetaching(); - - var navigationService = App.GetService(); - navigationService.Navigated -= OnNavigated; - } - - private void OnNavigated(object sender, NavigationEventArgs e) - { - if (sender is Frame frame && frame.Content is Page page) - { - _currentPage = page; - - UpdateHeader(); - UpdateHeaderTemplate(); - } - } - - private void UpdateHeader() - { - if (_currentPage != null) - { - var headerMode = GetHeaderMode(_currentPage); - if (headerMode == NavigationViewHeaderMode.Never) - { - AssociatedObject.Header = null; - AssociatedObject.AlwaysShowHeader = false; - } - else - { - var headerFromPage = GetHeaderContext(_currentPage); - if (headerFromPage != null) - { - AssociatedObject.Header = headerFromPage; - } - else - { - AssociatedObject.Header = DefaultHeader; - } - - if (headerMode == NavigationViewHeaderMode.Always) - { - AssociatedObject.AlwaysShowHeader = true; - } - else - { - AssociatedObject.AlwaysShowHeader = false; - } - } - } - } - - private void UpdateHeaderTemplate() - { - if (_currentPage != null) - { - var headerTemplate = GetHeaderTemplate(_currentPage); - AssociatedObject.HeaderTemplate = headerTemplate ?? DefaultHeaderTemplate; - } - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Behaviors/NavigationViewHeaderMode.cs b/Community Installers/VDD Panel/VDD Panel/Behaviors/NavigationViewHeaderMode.cs deleted file mode 100644 index 0cd5249..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Behaviors/NavigationViewHeaderMode.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace VDD_Panel.Behaviors; - -public enum NavigationViewHeaderMode -{ - Always, - Never, - Minimal -} diff --git a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IActivationService.cs b/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IActivationService.cs deleted file mode 100644 index 25090ad..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IActivationService.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace VDD_Panel.Contracts.Services; - -public interface IActivationService -{ - Task ActivateAsync(object activationArgs); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IAppNotificationService.cs b/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IAppNotificationService.cs deleted file mode 100644 index 5567128..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IAppNotificationService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Specialized; - -namespace VDD_Panel.Contracts.Services; - -public interface IAppNotificationService -{ - void Initialize(); - - bool Show(string payload); - - NameValueCollection ParseArguments(string arguments); - - void Unregister(); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/ILocalSettingsService.cs b/Community Installers/VDD Panel/VDD Panel/Contracts/Services/ILocalSettingsService.cs deleted file mode 100644 index 7606d64..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/ILocalSettingsService.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace VDD_Panel.Contracts.Services; - -public interface ILocalSettingsService -{ - Task ReadSettingAsync(string key); - - Task SaveSettingAsync(string key, T value); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/INavigationService.cs b/Community Installers/VDD Panel/VDD Panel/Contracts/Services/INavigationService.cs deleted file mode 100644 index 27923c5..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/INavigationService.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Navigation; - -namespace VDD_Panel.Contracts.Services; - -public interface INavigationService -{ - event NavigatedEventHandler Navigated; - - bool CanGoBack - { - get; - } - - Frame? Frame - { - get; set; - } - - bool NavigateTo(string pageKey, object? parameter = null, bool clearNavigation = false); - - bool GoBack(); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/INavigationViewService.cs b/Community Installers/VDD Panel/VDD Panel/Contracts/Services/INavigationViewService.cs deleted file mode 100644 index ee0fd95..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/INavigationViewService.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.UI.Xaml.Controls; - -namespace VDD_Panel.Contracts.Services; - -public interface INavigationViewService -{ - IList? MenuItems - { - get; - } - - object? SettingsItem - { - get; - } - - void Initialize(NavigationView navigationView); - - void UnregisterEvents(); - - NavigationViewItem? GetSelectedItem(Type pageType); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IPageService.cs b/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IPageService.cs deleted file mode 100644 index 5e36215..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IPageService.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace VDD_Panel.Contracts.Services; - -public interface IPageService -{ - Type GetPageType(string key); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IThemeSelectorService.cs b/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IThemeSelectorService.cs deleted file mode 100644 index bf175dd..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IThemeSelectorService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.UI.Xaml; - -namespace VDD_Panel.Contracts.Services; - -public interface IThemeSelectorService -{ - ElementTheme Theme - { - get; - } - - Task InitializeAsync(); - - Task SetThemeAsync(ElementTheme theme); - - Task SetRequestedThemeAsync(); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IWebViewService.cs b/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IWebViewService.cs deleted file mode 100644 index d2af4ea..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Contracts/Services/IWebViewService.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.UI.Xaml.Controls; -using Microsoft.Web.WebView2.Core; - -namespace VDD_Panel.Contracts.Services; - -public interface IWebViewService -{ - Uri? Source - { - get; - } - - bool CanGoBack - { - get; - } - - bool CanGoForward - { - get; - } - - event EventHandler? NavigationCompleted; - - void Initialize(WebView2 webView); - - void GoBack(); - - void GoForward(); - - void Reload(); - - void UnregisterEvents(); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Contracts/ViewModels/INavigationAware.cs b/Community Installers/VDD Panel/VDD Panel/Contracts/ViewModels/INavigationAware.cs deleted file mode 100644 index 35407e3..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Contracts/ViewModels/INavigationAware.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace VDD_Panel.Contracts.ViewModels; - -public interface INavigationAware -{ - void OnNavigatedTo(object parameter); - - void OnNavigatedFrom(); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Helpers/EnumToBooleanConverter.cs b/Community Installers/VDD Panel/VDD Panel/Helpers/EnumToBooleanConverter.cs deleted file mode 100644 index 08d252e..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Helpers/EnumToBooleanConverter.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Data; - -namespace VDD_Panel.Helpers; - -public class EnumToBooleanConverter : IValueConverter -{ - public EnumToBooleanConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, string language) - { - if (parameter is string enumString) - { - if (!Enum.IsDefined(typeof(ElementTheme), value)) - { - throw new ArgumentException("ExceptionEnumToBooleanConverterValueMustBeAnEnum"); - } - - var enumValue = Enum.Parse(typeof(ElementTheme), enumString); - - return enumValue.Equals(value); - } - - throw new ArgumentException("ExceptionEnumToBooleanConverterParameterMustBeAnEnumName"); - } - - public object ConvertBack(object value, Type targetType, object parameter, string language) - { - if (parameter is string enumString) - { - return Enum.Parse(typeof(ElementTheme), enumString); - } - - throw new ArgumentException("ExceptionEnumToBooleanConverterParameterMustBeAnEnumName"); - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Helpers/FrameExtensions.cs b/Community Installers/VDD Panel/VDD Panel/Helpers/FrameExtensions.cs deleted file mode 100644 index c008e81..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Helpers/FrameExtensions.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Microsoft.UI.Xaml.Controls; - -namespace VDD_Panel.Helpers; - -public static class FrameExtensions -{ - public static object? GetPageViewModel(this Frame frame) => frame?.Content?.GetType().GetProperty("ViewModel")?.GetValue(frame.Content, null); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Helpers/NavigationHelper.cs b/Community Installers/VDD Panel/VDD Panel/Helpers/NavigationHelper.cs deleted file mode 100644 index 0ba89ee..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Helpers/NavigationHelper.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; - -namespace VDD_Panel.Helpers; - -// Helper class to set the navigation target for a NavigationViewItem. -// -// Usage in XAML: -// -// -// Usage in code: -// NavigationHelper.SetNavigateTo(navigationViewItem, typeof(MainViewModel).FullName); -public class NavigationHelper -{ - public static string GetNavigateTo(NavigationViewItem item) => (string)item.GetValue(NavigateToProperty); - - public static void SetNavigateTo(NavigationViewItem item, string value) => item.SetValue(NavigateToProperty, value); - - public static readonly DependencyProperty NavigateToProperty = - DependencyProperty.RegisterAttached("NavigateTo", typeof(string), typeof(NavigationHelper), new PropertyMetadata(null)); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Helpers/ResourceExtensions.cs b/Community Installers/VDD Panel/VDD Panel/Helpers/ResourceExtensions.cs deleted file mode 100644 index fea03f9..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Helpers/ResourceExtensions.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Microsoft.Windows.ApplicationModel.Resources; - -namespace VDD_Panel.Helpers; - -public static class ResourceExtensions -{ - private static readonly ResourceLoader _resourceLoader = new(); - - public static string GetLocalized(this string resourceKey) => _resourceLoader.GetString(resourceKey); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Helpers/RuntimeHelper.cs b/Community Installers/VDD Panel/VDD Panel/Helpers/RuntimeHelper.cs deleted file mode 100644 index 0e55d79..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Helpers/RuntimeHelper.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Runtime.InteropServices; -using System.Text; - -namespace VDD_Panel.Helpers; - -public class RuntimeHelper -{ - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern int GetCurrentPackageFullName(ref int packageFullNameLength, StringBuilder? packageFullName); - - public static bool IsMSIX - { - get - { - var length = 0; - - return GetCurrentPackageFullName(ref length, null) != 15700L; - } - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Helpers/SettingsStorageExtensions.cs b/Community Installers/VDD Panel/VDD Panel/Helpers/SettingsStorageExtensions.cs deleted file mode 100644 index f0a8e14..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Helpers/SettingsStorageExtensions.cs +++ /dev/null @@ -1,112 +0,0 @@ -using VDD_Panel.Core.Helpers; - -using Windows.Storage; -using Windows.Storage.Streams; - -namespace VDD_Panel.Helpers; - -// Use these extension methods to store and retrieve local and roaming app data -// More details regarding storing and retrieving app data at https://docs.microsoft.com/windows/apps/design/app-settings/store-and-retrieve-app-data -public static class SettingsStorageExtensions -{ - private const string FileExtension = ".json"; - - public static bool IsRoamingStorageAvailable(this ApplicationData appData) - { - return appData.RoamingStorageQuota == 0; - } - - public static async Task SaveAsync(this StorageFolder folder, string name, T content) - { - var file = await folder.CreateFileAsync(GetFileName(name), CreationCollisionOption.ReplaceExisting); - var fileContent = await Json.StringifyAsync(content); - - await FileIO.WriteTextAsync(file, fileContent); - } - - public static async Task ReadAsync(this StorageFolder folder, string name) - { - if (!File.Exists(Path.Combine(folder.Path, GetFileName(name)))) - { - return default; - } - - var file = await folder.GetFileAsync($"{name}.json"); - var fileContent = await FileIO.ReadTextAsync(file); - - return await Json.ToObjectAsync(fileContent); - } - - public static async Task SaveAsync(this ApplicationDataContainer settings, string key, T value) - { - settings.SaveString(key, await Json.StringifyAsync(value)); - } - - public static void SaveString(this ApplicationDataContainer settings, string key, string value) - { - settings.Values[key] = value; - } - - public static async Task ReadAsync(this ApplicationDataContainer settings, string key) - { - object? obj; - - if (settings.Values.TryGetValue(key, out obj)) - { - return await Json.ToObjectAsync((string)obj); - } - - return default; - } - - public static async Task SaveFileAsync(this StorageFolder folder, byte[] content, string fileName, CreationCollisionOption options = CreationCollisionOption.ReplaceExisting) - { - if (content == null) - { - throw new ArgumentNullException(nameof(content)); - } - - if (string.IsNullOrEmpty(fileName)) - { - throw new ArgumentException("File name is null or empty. Specify a valid file name", nameof(fileName)); - } - - var storageFile = await folder.CreateFileAsync(fileName, options); - await FileIO.WriteBytesAsync(storageFile, content); - return storageFile; - } - - public static async Task ReadFileAsync(this StorageFolder folder, string fileName) - { - var item = await folder.TryGetItemAsync(fileName).AsTask().ConfigureAwait(false); - - if ((item != null) && item.IsOfType(StorageItemTypes.File)) - { - var storageFile = await folder.GetFileAsync(fileName); - var content = await storageFile.ReadBytesAsync(); - return content; - } - - return null; - } - - public static async Task ReadBytesAsync(this StorageFile file) - { - if (file != null) - { - using IRandomAccessStream stream = await file.OpenReadAsync(); - using var reader = new DataReader(stream.GetInputStreamAt(0)); - await reader.LoadAsync((uint)stream.Size); - var bytes = new byte[stream.Size]; - reader.ReadBytes(bytes); - return bytes; - } - - return null; - } - - private static string GetFileName(string name) - { - return string.Concat(name, FileExtension); - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Helpers/TitleBarHelper.cs b/Community Installers/VDD Panel/VDD Panel/Helpers/TitleBarHelper.cs deleted file mode 100644 index c9300bd..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Helpers/TitleBarHelper.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System.Runtime.InteropServices; - -using Microsoft.UI; -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Media; - -using Windows.UI; -using Windows.UI.ViewManagement; - -namespace VDD_Panel.Helpers; - -// Helper class to workaround custom title bar bugs. -// DISCLAIMER: The resource key names and color values used below are subject to change. Do not depend on them. -// https://github.com/microsoft/TemplateStudio/issues/4516 -internal class TitleBarHelper -{ - private const int WAINACTIVE = 0x00; - private const int WAACTIVE = 0x01; - private const int WMACTIVATE = 0x0006; - - [DllImport("user32.dll")] - private static extern IntPtr GetActiveWindow(); - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - private static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, IntPtr lParam); - - public static void UpdateTitleBar(ElementTheme theme) - { - if (App.MainWindow.ExtendsContentIntoTitleBar) - { - if (theme == ElementTheme.Default) - { - var uiSettings = new UISettings(); - var background = uiSettings.GetColorValue(UIColorType.Background); - - theme = background == Colors.White ? ElementTheme.Light : ElementTheme.Dark; - } - - if (theme == ElementTheme.Default) - { - theme = Application.Current.RequestedTheme == ApplicationTheme.Light ? ElementTheme.Light : ElementTheme.Dark; - } - - App.MainWindow.AppWindow.TitleBar.ButtonForegroundColor = theme switch - { - ElementTheme.Dark => Colors.White, - ElementTheme.Light => Colors.Black, - _ => Colors.Transparent - }; - - App.MainWindow.AppWindow.TitleBar.ButtonHoverForegroundColor = theme switch - { - ElementTheme.Dark => Colors.White, - ElementTheme.Light => Colors.Black, - _ => Colors.Transparent - }; - - App.MainWindow.AppWindow.TitleBar.ButtonHoverBackgroundColor = theme switch - { - ElementTheme.Dark => Color.FromArgb(0x33, 0xFF, 0xFF, 0xFF), - ElementTheme.Light => Color.FromArgb(0x33, 0x00, 0x00, 0x00), - _ => Colors.Transparent - }; - - App.MainWindow.AppWindow.TitleBar.ButtonPressedBackgroundColor = theme switch - { - ElementTheme.Dark => Color.FromArgb(0x66, 0xFF, 0xFF, 0xFF), - ElementTheme.Light => Color.FromArgb(0x66, 0x00, 0x00, 0x00), - _ => Colors.Transparent - }; - - App.MainWindow.AppWindow.TitleBar.BackgroundColor = Colors.Transparent; - - var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(App.MainWindow); - if (hwnd == GetActiveWindow()) - { - SendMessage(hwnd, WMACTIVATE, WAINACTIVE, IntPtr.Zero); - SendMessage(hwnd, WMACTIVATE, WAACTIVE, IntPtr.Zero); - } - else - { - SendMessage(hwnd, WMACTIVATE, WAACTIVE, IntPtr.Zero); - SendMessage(hwnd, WMACTIVATE, WAINACTIVE, IntPtr.Zero); - } - } - } - - public static void ApplySystemThemeToCaptionButtons() - { - var frame = App.AppTitlebar as FrameworkElement; - if (frame != null) - { - UpdateTitleBar(frame.ActualTheme); - } - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/MainWindow.xaml b/Community Installers/VDD Panel/VDD Panel/MainWindow.xaml deleted file mode 100644 index e5a0c26..0000000 --- a/Community Installers/VDD Panel/VDD Panel/MainWindow.xaml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/Community Installers/VDD Panel/VDD Panel/MainWindow.xaml.cs b/Community Installers/VDD Panel/VDD Panel/MainWindow.xaml.cs deleted file mode 100644 index f0305af..0000000 --- a/Community Installers/VDD Panel/VDD Panel/MainWindow.xaml.cs +++ /dev/null @@ -1,37 +0,0 @@ -using VDD_Panel.Helpers; - -using Windows.UI.ViewManagement; - -namespace VDD_Panel; - -public sealed partial class MainWindow : WindowEx -{ - private Microsoft.UI.Dispatching.DispatcherQueue dispatcherQueue; - - private UISettings settings; - - public MainWindow() - { - InitializeComponent(); - - AppWindow.SetIcon(Path.Combine(AppContext.BaseDirectory, "Assets/WindowIcon.ico")); - Content = null; - Title = "AppDisplayName".GetLocalized(); - - // Theme change code picked from https://github.com/microsoft/WinUI-Gallery/pull/1239 - dispatcherQueue = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread(); - settings = new UISettings(); - settings.ColorValuesChanged += Settings_ColorValuesChanged; // cannot use FrameworkElement.ActualThemeChanged event - } - - // this handles updating the caption button colors correctly when indows system theme is changed - // while the app is open - private void Settings_ColorValuesChanged(UISettings sender, object args) - { - // This calls comes off-thread, hence we will need to dispatch it to current app's thread - dispatcherQueue.TryEnqueue(() => - { - TitleBarHelper.ApplySystemThemeToCaptionButtons(); - }); - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Models/LocalSettingsOptions.cs b/Community Installers/VDD Panel/VDD Panel/Models/LocalSettingsOptions.cs deleted file mode 100644 index 70c6736..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Models/LocalSettingsOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace VDD_Panel.Models; - -public class LocalSettingsOptions -{ - public string? ApplicationDataFolder - { - get; set; - } - - public string? LocalSettingsFile - { - get; set; - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Package.appinstaller b/Community Installers/VDD Panel/VDD Panel/Package.appinstaller deleted file mode 100644 index c619457..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Package.appinstaller +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/Community Installers/VDD Panel/VDD Panel/Package.appxmanifest b/Community Installers/VDD Panel/VDD Panel/Package.appxmanifest deleted file mode 100644 index b7f9944..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Package.appxmanifest +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - VDD Panel - alisa - Assets\StoreLogo.png - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Community Installers/VDD Panel/VDD Panel/Properties/PublishProfiles/win10-arm64.pubxml b/Community Installers/VDD Panel/VDD Panel/Properties/PublishProfiles/win10-arm64.pubxml deleted file mode 100644 index b2f476e..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Properties/PublishProfiles/win10-arm64.pubxml +++ /dev/null @@ -1,13 +0,0 @@ - - - - FileSystem - arm64 - win10-arm64 - bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ - True - False - False - True - - diff --git a/Community Installers/VDD Panel/VDD Panel/Properties/PublishProfiles/win10-x64.pubxml b/Community Installers/VDD Panel/VDD Panel/Properties/PublishProfiles/win10-x64.pubxml deleted file mode 100644 index a8146b5..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Properties/PublishProfiles/win10-x64.pubxml +++ /dev/null @@ -1,13 +0,0 @@ - - - - FileSystem - x64 - win10-x64 - bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ - True - False - False - True - - diff --git a/Community Installers/VDD Panel/VDD Panel/Properties/PublishProfiles/win10-x86.pubxml b/Community Installers/VDD Panel/VDD Panel/Properties/PublishProfiles/win10-x86.pubxml deleted file mode 100644 index eae0948..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Properties/PublishProfiles/win10-x86.pubxml +++ /dev/null @@ -1,13 +0,0 @@ - - - - FileSystem - x86 - win10-x86 - bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ - True - False - False - True - - diff --git a/Community Installers/VDD Panel/VDD Panel/Properties/launchsettings.json b/Community Installers/VDD Panel/VDD Panel/Properties/launchsettings.json deleted file mode 100644 index 5614cd6..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Properties/launchsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "profiles": { - "VDD Panel (Package)": { - "commandName": "MsixPackage" - }, - "VDD Panel (Unpackaged)": { - "commandName": "Project" - } - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/README.md b/Community Installers/VDD Panel/VDD Panel/README.md deleted file mode 100644 index e24cced..0000000 --- a/Community Installers/VDD Panel/VDD Panel/README.md +++ /dev/null @@ -1,27 +0,0 @@ -*Recommended Markdown Viewer: [Markdown Editor](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.MarkdownEditor2)* - -## Getting Started - -Browse and address `TODO:` comments in `View -> Task List` to learn the codebase and understand next steps for turning the generated code into production code. - -Explore the [WinUI Gallery](https://www.microsoft.com/store/productId/9P3JFPWWDZRC) to learn about available controls and design patterns. - -Relaunch Template Studio to modify the project by right-clicking on the project in `View -> Solution Explorer` then selecting `Add -> New Item (Template Studio)`. - -## Publishing - -For projects with MSIX packaging, right-click on the application project and select `Package and Publish -> Create App Packages...` to create an MSIX package. - -For projects without MSIX packaging, follow the [deployment guide](https://docs.microsoft.com/windows/apps/windows-app-sdk/deploy-unpackaged-apps) or add the `Self-Contained` Feature to enable xcopy deployment. - -## CI Pipelines - -See [README.md](https://github.com/microsoft/TemplateStudio/blob/main/docs/WinUI/pipelines/README.md) for guidance on building and testing projects in CI pipelines. - -## Changelog - -See [releases](https://github.com/microsoft/TemplateStudio/releases) and [milestones](https://github.com/microsoft/TemplateStudio/milestones). - -## Feedback - -Bugs and feature requests should be filed at https://aka.ms/templatestudio. diff --git a/Community Installers/VDD Panel/VDD Panel/Services/ActivationService.cs b/Community Installers/VDD Panel/VDD Panel/Services/ActivationService.cs deleted file mode 100644 index 2100112..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Services/ActivationService.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; - -using VDD_Panel.Activation; -using VDD_Panel.Contracts.Services; -using VDD_Panel.Views; - -namespace VDD_Panel.Services; - -public class ActivationService : IActivationService -{ - private readonly ActivationHandler _defaultHandler; - private readonly IEnumerable _activationHandlers; - private readonly IThemeSelectorService _themeSelectorService; - private UIElement? _shell = null; - - public ActivationService(ActivationHandler defaultHandler, IEnumerable activationHandlers, IThemeSelectorService themeSelectorService) - { - _defaultHandler = defaultHandler; - _activationHandlers = activationHandlers; - _themeSelectorService = themeSelectorService; - } - - public async Task ActivateAsync(object activationArgs) - { - // Execute tasks before activation. - await InitializeAsync(); - - // Set the MainWindow Content. - if (App.MainWindow.Content == null) - { - _shell = App.GetService(); - App.MainWindow.Content = _shell ?? new Frame(); - } - - // Handle activation via ActivationHandlers. - await HandleActivationAsync(activationArgs); - - // Activate the MainWindow. - App.MainWindow.Activate(); - - // Execute tasks after activation. - await StartupAsync(); - } - - private async Task HandleActivationAsync(object activationArgs) - { - var activationHandler = _activationHandlers.FirstOrDefault(h => h.CanHandle(activationArgs)); - - if (activationHandler != null) - { - await activationHandler.HandleAsync(activationArgs); - } - - if (_defaultHandler.CanHandle(activationArgs)) - { - await _defaultHandler.HandleAsync(activationArgs); - } - } - - private async Task InitializeAsync() - { - await _themeSelectorService.InitializeAsync().ConfigureAwait(false); - await Task.CompletedTask; - } - - private async Task StartupAsync() - { - await _themeSelectorService.SetRequestedThemeAsync(); - await Task.CompletedTask; - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Services/AppNotificationService.cs b/Community Installers/VDD Panel/VDD Panel/Services/AppNotificationService.cs deleted file mode 100644 index d45d8b7..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Services/AppNotificationService.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.Collections.Specialized; -using System.Web; - -using Microsoft.Windows.AppNotifications; - -using VDD_Panel.Contracts.Services; -using VDD_Panel.ViewModels; - -namespace VDD_Panel.Notifications; - -public class AppNotificationService : IAppNotificationService -{ - private readonly INavigationService _navigationService; - - public AppNotificationService(INavigationService navigationService) - { - _navigationService = navigationService; - } - - ~AppNotificationService() - { - Unregister(); - } - - public void Initialize() - { - AppNotificationManager.Default.NotificationInvoked += OnNotificationInvoked; - - AppNotificationManager.Default.Register(); - } - - public void OnNotificationInvoked(AppNotificationManager sender, AppNotificationActivatedEventArgs args) - { - // TODO: Handle notification invocations when your app is already running. - - //// // Navigate to a specific page based on the notification arguments. - //// if (ParseArguments(args.Argument)["action"] == "Settings") - //// { - //// App.MainWindow.DispatcherQueue.TryEnqueue(() => - //// { - //// _navigationService.NavigateTo(typeof(SettingsViewModel).FullName!); - //// }); - //// } - - App.MainWindow.DispatcherQueue.TryEnqueue(() => - { - App.MainWindow.ShowMessageDialogAsync("TODO: Handle notification invocations when your app is already running.", "Notification Invoked"); - - App.MainWindow.BringToFront(); - }); - } - - public bool Show(string payload) - { - var appNotification = new AppNotification(payload); - - AppNotificationManager.Default.Show(appNotification); - - return appNotification.Id != 0; - } - - public NameValueCollection ParseArguments(string arguments) - { - return HttpUtility.ParseQueryString(arguments); - } - - public void Unregister() - { - AppNotificationManager.Default.Unregister(); - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Services/LocalSettingsService.cs b/Community Installers/VDD Panel/VDD Panel/Services/LocalSettingsService.cs deleted file mode 100644 index 7a7da50..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Services/LocalSettingsService.cs +++ /dev/null @@ -1,88 +0,0 @@ -using Microsoft.Extensions.Options; - -using VDD_Panel.Contracts.Services; -using VDD_Panel.Core.Contracts.Services; -using VDD_Panel.Core.Helpers; -using VDD_Panel.Helpers; -using VDD_Panel.Models; - -using Windows.ApplicationModel; -using Windows.Storage; - -namespace VDD_Panel.Services; - -public class LocalSettingsService : ILocalSettingsService -{ - private const string _defaultApplicationDataFolder = "VDD Panel/ApplicationData"; - private const string _defaultLocalSettingsFile = "LocalSettings.json"; - - private readonly IFileService _fileService; - private readonly LocalSettingsOptions _options; - - private readonly string _localApplicationData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); - private readonly string _applicationDataFolder; - private readonly string _localsettingsFile; - - private IDictionary _settings; - - private bool _isInitialized; - - public LocalSettingsService(IFileService fileService, IOptions options) - { - _fileService = fileService; - _options = options.Value; - - _applicationDataFolder = Path.Combine(_localApplicationData, _options.ApplicationDataFolder ?? _defaultApplicationDataFolder); - _localsettingsFile = _options.LocalSettingsFile ?? _defaultLocalSettingsFile; - - _settings = new Dictionary(); - } - - private async Task InitializeAsync() - { - if (!_isInitialized) - { - _settings = await Task.Run(() => _fileService.Read>(_applicationDataFolder, _localsettingsFile)) ?? new Dictionary(); - - _isInitialized = true; - } - } - - public async Task ReadSettingAsync(string key) - { - if (RuntimeHelper.IsMSIX) - { - if (ApplicationData.Current.LocalSettings.Values.TryGetValue(key, out var obj)) - { - return await Json.ToObjectAsync((string)obj); - } - } - else - { - await InitializeAsync(); - - if (_settings != null && _settings.TryGetValue(key, out var obj)) - { - return await Json.ToObjectAsync((string)obj); - } - } - - return default; - } - - public async Task SaveSettingAsync(string key, T value) - { - if (RuntimeHelper.IsMSIX) - { - ApplicationData.Current.LocalSettings.Values[key] = await Json.StringifyAsync(value); - } - else - { - await InitializeAsync(); - - _settings[key] = await Json.StringifyAsync(value); - - await Task.Run(() => _fileService.Save(_applicationDataFolder, _localsettingsFile, _settings)); - } - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Services/NavigationService.cs b/Community Installers/VDD Panel/VDD Panel/Services/NavigationService.cs deleted file mode 100644 index 580e557..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Services/NavigationService.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Navigation; - -using VDD_Panel.Contracts.Services; -using VDD_Panel.Contracts.ViewModels; -using VDD_Panel.Helpers; - -namespace VDD_Panel.Services; - -// For more information on navigation between pages see -// https://github.com/microsoft/TemplateStudio/blob/main/docs/WinUI/navigation.md -public class NavigationService : INavigationService -{ - private readonly IPageService _pageService; - private object? _lastParameterUsed; - private Frame? _frame; - - public event NavigatedEventHandler? Navigated; - - public Frame? Frame - { - get - { - if (_frame == null) - { - _frame = App.MainWindow.Content as Frame; - RegisterFrameEvents(); - } - - return _frame; - } - - set - { - UnregisterFrameEvents(); - _frame = value; - RegisterFrameEvents(); - } - } - - [MemberNotNullWhen(true, nameof(Frame), nameof(_frame))] - public bool CanGoBack => Frame != null && Frame.CanGoBack; - - public NavigationService(IPageService pageService) - { - _pageService = pageService; - } - - private void RegisterFrameEvents() - { - if (_frame != null) - { - _frame.Navigated += OnNavigated; - } - } - - private void UnregisterFrameEvents() - { - if (_frame != null) - { - _frame.Navigated -= OnNavigated; - } - } - - public bool GoBack() - { - if (CanGoBack) - { - var vmBeforeNavigation = _frame.GetPageViewModel(); - _frame.GoBack(); - if (vmBeforeNavigation is INavigationAware navigationAware) - { - navigationAware.OnNavigatedFrom(); - } - - return true; - } - - return false; - } - - public bool NavigateTo(string pageKey, object? parameter = null, bool clearNavigation = false) - { - var pageType = _pageService.GetPageType(pageKey); - - if (_frame != null && (_frame.Content?.GetType() != pageType || (parameter != null && !parameter.Equals(_lastParameterUsed)))) - { - _frame.Tag = clearNavigation; - var vmBeforeNavigation = _frame.GetPageViewModel(); - var navigated = _frame.Navigate(pageType, parameter); - if (navigated) - { - _lastParameterUsed = parameter; - if (vmBeforeNavigation is INavigationAware navigationAware) - { - navigationAware.OnNavigatedFrom(); - } - } - - return navigated; - } - - return false; - } - - private void OnNavigated(object sender, NavigationEventArgs e) - { - if (sender is Frame frame) - { - var clearNavigation = (bool)frame.Tag; - if (clearNavigation) - { - frame.BackStack.Clear(); - } - - if (frame.GetPageViewModel() is INavigationAware navigationAware) - { - navigationAware.OnNavigatedTo(e.Parameter); - } - - Navigated?.Invoke(sender, e); - } - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Services/NavigationViewService.cs b/Community Installers/VDD Panel/VDD Panel/Services/NavigationViewService.cs deleted file mode 100644 index 3bbd829..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Services/NavigationViewService.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -using Microsoft.UI.Xaml.Controls; - -using VDD_Panel.Contracts.Services; -using VDD_Panel.Helpers; -using VDD_Panel.ViewModels; - -namespace VDD_Panel.Services; - -public class NavigationViewService : INavigationViewService -{ - private readonly INavigationService _navigationService; - - private readonly IPageService _pageService; - - private NavigationView? _navigationView; - - public IList? MenuItems => _navigationView?.MenuItems; - - public object? SettingsItem => _navigationView?.SettingsItem; - - public NavigationViewService(INavigationService navigationService, IPageService pageService) - { - _navigationService = navigationService; - _pageService = pageService; - } - - [MemberNotNull(nameof(_navigationView))] - public void Initialize(NavigationView navigationView) - { - _navigationView = navigationView; - _navigationView.BackRequested += OnBackRequested; - _navigationView.ItemInvoked += OnItemInvoked; - } - - public void UnregisterEvents() - { - if (_navigationView != null) - { - _navigationView.BackRequested -= OnBackRequested; - _navigationView.ItemInvoked -= OnItemInvoked; - } - } - - public NavigationViewItem? GetSelectedItem(Type pageType) - { - if (_navigationView != null) - { - return GetSelectedItem(_navigationView.MenuItems, pageType) ?? GetSelectedItem(_navigationView.FooterMenuItems, pageType); - } - - return null; - } - - private void OnBackRequested(NavigationView sender, NavigationViewBackRequestedEventArgs args) => _navigationService.GoBack(); - - private void OnItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args) - { - if (args.IsSettingsInvoked) - { - _navigationService.NavigateTo(typeof(SettingsViewModel).FullName!); - } - else - { - var selectedItem = args.InvokedItemContainer as NavigationViewItem; - - if (selectedItem?.GetValue(NavigationHelper.NavigateToProperty) is string pageKey) - { - _navigationService.NavigateTo(pageKey); - } - } - } - - private NavigationViewItem? GetSelectedItem(IEnumerable menuItems, Type pageType) - { - foreach (var item in menuItems.OfType()) - { - if (IsMenuItemForPageType(item, pageType)) - { - return item; - } - - var selectedChild = GetSelectedItem(item.MenuItems, pageType); - if (selectedChild != null) - { - return selectedChild; - } - } - - return null; - } - - private bool IsMenuItemForPageType(NavigationViewItem menuItem, Type sourcePageType) - { - if (menuItem.GetValue(NavigationHelper.NavigateToProperty) is string pageKey) - { - return _pageService.GetPageType(pageKey) == sourcePageType; - } - - return false; - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Services/PageService.cs b/Community Installers/VDD Panel/VDD Panel/Services/PageService.cs deleted file mode 100644 index 148d010..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Services/PageService.cs +++ /dev/null @@ -1,58 +0,0 @@ -using CommunityToolkit.Mvvm.ComponentModel; - -using Microsoft.UI.Xaml.Controls; - -using VDD_Panel.Contracts.Services; -using VDD_Panel.ViewModels; -using VDD_Panel.Views; - -namespace VDD_Panel.Services; - -public class PageService : IPageService -{ - private readonly Dictionary _pages = new(); - - public PageService() - { - Configure(); - Configure(); - Configure(); - Configure(); - } - - public Type GetPageType(string key) - { - Type? pageType; - lock (_pages) - { - if (!_pages.TryGetValue(key, out pageType)) - { - throw new ArgumentException($"Page not found: {key}. Did you forget to call PageService.Configure?"); - } - } - - return pageType; - } - - private void Configure() - where VM : ObservableObject - where V : Page - { - lock (_pages) - { - var key = typeof(VM).FullName!; - if (_pages.ContainsKey(key)) - { - throw new ArgumentException($"The key {key} is already configured in PageService"); - } - - var type = typeof(V); - if (_pages.ContainsValue(type)) - { - throw new ArgumentException($"This type is already configured with key {_pages.First(p => p.Value == type).Key}"); - } - - _pages.Add(key, type); - } - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Services/ThemeSelectorService.cs b/Community Installers/VDD Panel/VDD Panel/Services/ThemeSelectorService.cs deleted file mode 100644 index 75e96ad..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Services/ThemeSelectorService.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Microsoft.UI.Xaml; - -using VDD_Panel.Contracts.Services; -using VDD_Panel.Helpers; - -namespace VDD_Panel.Services; - -public class ThemeSelectorService : IThemeSelectorService -{ - private const string SettingsKey = "AppBackgroundRequestedTheme"; - - public ElementTheme Theme { get; set; } = ElementTheme.Default; - - private readonly ILocalSettingsService _localSettingsService; - - public ThemeSelectorService(ILocalSettingsService localSettingsService) - { - _localSettingsService = localSettingsService; - } - - public async Task InitializeAsync() - { - Theme = await LoadThemeFromSettingsAsync(); - await Task.CompletedTask; - } - - public async Task SetThemeAsync(ElementTheme theme) - { - Theme = theme; - - await SetRequestedThemeAsync(); - await SaveThemeInSettingsAsync(Theme); - } - - public async Task SetRequestedThemeAsync() - { - if (App.MainWindow.Content is FrameworkElement rootElement) - { - rootElement.RequestedTheme = Theme; - - TitleBarHelper.UpdateTitleBar(Theme); - } - - await Task.CompletedTask; - } - - private async Task LoadThemeFromSettingsAsync() - { - var themeName = await _localSettingsService.ReadSettingAsync(SettingsKey); - - if (Enum.TryParse(themeName, out ElementTheme cacheTheme)) - { - return cacheTheme; - } - - return ElementTheme.Default; - } - - private async Task SaveThemeInSettingsAsync(ElementTheme theme) - { - await _localSettingsService.SaveSettingAsync(SettingsKey, theme.ToString()); - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Services/WebViewService.cs b/Community Installers/VDD Panel/VDD Panel/Services/WebViewService.cs deleted file mode 100644 index 38e45d8..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Services/WebViewService.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -using Microsoft.UI.Xaml.Controls; -using Microsoft.Web.WebView2.Core; - -using VDD_Panel.Contracts.Services; - -namespace VDD_Panel.Services; - -public class WebViewService : IWebViewService -{ - private WebView2? _webView; - - public Uri? Source => _webView?.Source; - - [MemberNotNullWhen(true, nameof(_webView))] - public bool CanGoBack => _webView != null && _webView.CanGoBack; - - [MemberNotNullWhen(true, nameof(_webView))] - public bool CanGoForward => _webView != null && _webView.CanGoForward; - - public event EventHandler? NavigationCompleted; - - public WebViewService() - { - } - - [MemberNotNull(nameof(_webView))] - public void Initialize(WebView2 webView) - { - _webView = webView; - _webView.NavigationCompleted += OnWebViewNavigationCompleted; - } - - public void GoBack() => _webView?.GoBack(); - - public void GoForward() => _webView?.GoForward(); - - public void Reload() => _webView?.Reload(); - - public void UnregisterEvents() - { - if (_webView != null) - { - _webView.NavigationCompleted -= OnWebViewNavigationCompleted; - } - } - - private void OnWebViewNavigationCompleted(WebView2 sender, CoreWebView2NavigationCompletedEventArgs args) => NavigationCompleted?.Invoke(this, args.WebErrorStatus); -} diff --git a/Community Installers/VDD Panel/VDD Panel/Strings/en-us/Resources.resw b/Community Installers/VDD Panel/VDD Panel/Strings/en-us/Resources.resw deleted file mode 100644 index b60ce93..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Strings/en-us/Resources.resw +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - VDD Panel - - - VDD Panel - - - Main - - - Configure - - - Loading... - - - Page failed to load. Check connection and reload. - - - Browser back - - - Browser back - - - Browser forward - - - Browser forward - - - Reload - - - Reload - - - Reload - - - Open in browser - - - Open in browser - - - GitHub - - - Personalization - - - Theme - - - Light - - - Dark - - - Default - - - About this application - - - TODO: Replace with your app description. - - - Privacy Statement - - - https://YourPrivacyUrlGoesHere/ - - - <toast launch="action=ToastClick"> - <visual> - <binding template="ToastGeneric"> - <text>App Notification</text> - <text></text> - <image placement="appLogoOverride" hint-crop="circle" src="{0}Assets/WindowIcon.ico"/> - </binding> - </visual> - <actions> - <action content="Settings" arguments="action=Settings"/> - </actions> -</toast> - - diff --git a/Community Installers/VDD Panel/VDD Panel/Styles/FontSizes.xaml b/Community Installers/VDD Panel/VDD Panel/Styles/FontSizes.xaml deleted file mode 100644 index 44904b1..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Styles/FontSizes.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - 24 - - 16 - - diff --git a/Community Installers/VDD Panel/VDD Panel/Styles/TextBlock.xaml b/Community Installers/VDD Panel/VDD Panel/Styles/TextBlock.xaml deleted file mode 100644 index 0f9eb84..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Styles/TextBlock.xaml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Community Installers/VDD Panel/VDD Panel/Styles/Thickness.xaml b/Community Installers/VDD Panel/VDD Panel/Styles/Thickness.xaml deleted file mode 100644 index 96ef0c9..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Styles/Thickness.xaml +++ /dev/null @@ -1,36 +0,0 @@ - - - 0,36,0,0 - 0,36,0,36 - - 0,24,0,0 - 0,24,0,24 - 24,0,24,0 - 0,0,0,24 - - 12,0,0,0 - 12,0,12,0 - 0,12,0,0 - 0,0,12,0 - 0,12,0,12 - - 8,0,0,0 - 0,8,0,0 - 8,8,8,8 - - 0,4,0,0 - 4,4,4,4 - - 1,1,0,0 - 8,0,0,0 - 0,48,0,0 - 56,34,0,0 - 56,24,56,0 - - 36,24,36,0 - - -12,4,0,0 - - diff --git a/Community Installers/VDD Panel/VDD Panel/TemplateStudio.xml b/Community Installers/VDD Panel/VDD Panel/TemplateStudio.xml deleted file mode 100644 index 0c8e42d..0000000 --- a/Community Installers/VDD Panel/VDD Panel/TemplateStudio.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/Community Installers/VDD Panel/VDD Panel/Usings.cs b/Community Installers/VDD Panel/VDD Panel/Usings.cs deleted file mode 100644 index 4cc487e..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Usings.cs +++ /dev/null @@ -1 +0,0 @@ -global using WinUIEx; diff --git a/Community Installers/VDD Panel/VDD Panel/VDD Panel.csproj b/Community Installers/VDD Panel/VDD Panel/VDD Panel.csproj deleted file mode 100644 index 0a26a39..0000000 --- a/Community Installers/VDD Panel/VDD Panel/VDD Panel.csproj +++ /dev/null @@ -1,47 +0,0 @@ - - - WinExe - net7.0-windows10.0.19041.0 - 10.0.17763.0 - VDD_Panel - Assets/WindowIcon.ico - app.manifest - x86;x64;arm64 - win10-x86;win10-x64;win10-arm64 - Properties\PublishProfiles\win10-$(Platform).pubxml - enable - enable - true - true - true - - - - - - - - - - - - - - - - - - - - Always - - - - - - - - - true - - diff --git a/Community Installers/VDD Panel/VDD Panel/ViewModels/ConfigureViewModel.cs b/Community Installers/VDD Panel/VDD Panel/ViewModels/ConfigureViewModel.cs deleted file mode 100644 index 6be2ee2..0000000 --- a/Community Installers/VDD Panel/VDD Panel/ViewModels/ConfigureViewModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using CommunityToolkit.Mvvm.ComponentModel; - -namespace VDD_Panel.ViewModels; - -public partial class ConfigureViewModel : ObservableRecipient -{ - public ConfigureViewModel() - { - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/ViewModels/GitHubViewModel.cs b/Community Installers/VDD Panel/VDD Panel/ViewModels/GitHubViewModel.cs deleted file mode 100644 index 7926675..0000000 --- a/Community Installers/VDD Panel/VDD Panel/ViewModels/GitHubViewModel.cs +++ /dev/null @@ -1,110 +0,0 @@ -using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Input; - -using Microsoft.Web.WebView2.Core; - -using VDD_Panel.Contracts.Services; -using VDD_Panel.Contracts.ViewModels; - -namespace VDD_Panel.ViewModels; - -// TODO: Review best practices and distribution guidelines for WebView2. -// https://docs.microsoft.com/microsoft-edge/webview2/get-started/winui -// https://docs.microsoft.com/microsoft-edge/webview2/concepts/developer-guide -// https://docs.microsoft.com/microsoft-edge/webview2/concepts/distribution -public partial class GitHubViewModel : ObservableRecipient, INavigationAware -{ - // TODO: Set the default URL to display. - [ObservableProperty] - private Uri source = new("https://github.com/itsmikethetech/Virtual-Display-Driver"); - - [ObservableProperty] - private bool isLoading = true; - - [ObservableProperty] - private bool hasFailures; - - public IWebViewService WebViewService - { - get; - } - - public GitHubViewModel(IWebViewService webViewService) - { - WebViewService = webViewService; - } - - [RelayCommand] - private async Task OpenInBrowser() - { - if (WebViewService.Source != null) - { - await Windows.System.Launcher.LaunchUriAsync(WebViewService.Source); - } - } - - [RelayCommand] - private void Reload() - { - WebViewService.Reload(); - } - - [RelayCommand(CanExecute = nameof(BrowserCanGoForward))] - private void BrowserForward() - { - if (WebViewService.CanGoForward) - { - WebViewService.GoForward(); - } - } - - private bool BrowserCanGoForward() - { - return WebViewService.CanGoForward; - } - - [RelayCommand(CanExecute = nameof(BrowserCanGoBack))] - private void BrowserBack() - { - if (WebViewService.CanGoBack) - { - WebViewService.GoBack(); - } - } - - private bool BrowserCanGoBack() - { - return WebViewService.CanGoBack; - } - - public void OnNavigatedTo(object parameter) - { - WebViewService.NavigationCompleted += OnNavigationCompleted; - } - - public void OnNavigatedFrom() - { - WebViewService.UnregisterEvents(); - WebViewService.NavigationCompleted -= OnNavigationCompleted; - } - - private void OnNavigationCompleted(object? sender, CoreWebView2WebErrorStatus webErrorStatus) - { - IsLoading = false; - BrowserBackCommand.NotifyCanExecuteChanged(); - BrowserForwardCommand.NotifyCanExecuteChanged(); - - if (webErrorStatus != default) - { - HasFailures = true; - } - } - - [RelayCommand] - private void OnRetry() - { - HasFailures = false; - IsLoading = true; - WebViewService?.Reload(); - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/ViewModels/MainViewModel.cs b/Community Installers/VDD Panel/VDD Panel/ViewModels/MainViewModel.cs deleted file mode 100644 index 7644d8a..0000000 --- a/Community Installers/VDD Panel/VDD Panel/ViewModels/MainViewModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using CommunityToolkit.Mvvm.ComponentModel; - -namespace VDD_Panel.ViewModels; - -public partial class MainViewModel : ObservableRecipient -{ - public MainViewModel() - { - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/ViewModels/SettingsViewModel.cs b/Community Installers/VDD Panel/VDD Panel/ViewModels/SettingsViewModel.cs deleted file mode 100644 index 99aa308..0000000 --- a/Community Installers/VDD Panel/VDD Panel/ViewModels/SettingsViewModel.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Reflection; -using System.Windows.Input; - -using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Input; - -using Microsoft.UI.Xaml; - -using VDD_Panel.Contracts.Services; -using VDD_Panel.Helpers; - -using Windows.ApplicationModel; - -namespace VDD_Panel.ViewModels; - -public partial class SettingsViewModel : ObservableRecipient -{ - private readonly IThemeSelectorService _themeSelectorService; - - [ObservableProperty] - private ElementTheme _elementTheme; - - [ObservableProperty] - private string _versionDescription; - - public ICommand SwitchThemeCommand - { - get; - } - - public SettingsViewModel(IThemeSelectorService themeSelectorService) - { - _themeSelectorService = themeSelectorService; - _elementTheme = _themeSelectorService.Theme; - _versionDescription = GetVersionDescription(); - - SwitchThemeCommand = new RelayCommand( - async (param) => - { - if (ElementTheme != param) - { - ElementTheme = param; - await _themeSelectorService.SetThemeAsync(param); - } - }); - } - - private static string GetVersionDescription() - { - Version version; - - if (RuntimeHelper.IsMSIX) - { - var packageVersion = Package.Current.Id.Version; - - version = new(packageVersion.Major, packageVersion.Minor, packageVersion.Build, packageVersion.Revision); - } - else - { - version = Assembly.GetExecutingAssembly().GetName().Version!; - } - - return $"{"AppDisplayName".GetLocalized()} - {version.Major}.{version.Minor}.{version.Build}.{version.Revision}"; - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/ViewModels/ShellViewModel.cs b/Community Installers/VDD Panel/VDD Panel/ViewModels/ShellViewModel.cs deleted file mode 100644 index f533d57..0000000 --- a/Community Installers/VDD Panel/VDD Panel/ViewModels/ShellViewModel.cs +++ /dev/null @@ -1,51 +0,0 @@ -using CommunityToolkit.Mvvm.ComponentModel; - -using Microsoft.UI.Xaml.Navigation; - -using VDD_Panel.Contracts.Services; -using VDD_Panel.Views; - -namespace VDD_Panel.ViewModels; - -public partial class ShellViewModel : ObservableRecipient -{ - [ObservableProperty] - private bool isBackEnabled; - - [ObservableProperty] - private object? selected; - - public INavigationService NavigationService - { - get; - } - - public INavigationViewService NavigationViewService - { - get; - } - - public ShellViewModel(INavigationService navigationService, INavigationViewService navigationViewService) - { - NavigationService = navigationService; - NavigationService.Navigated += OnNavigated; - NavigationViewService = navigationViewService; - } - - private void OnNavigated(object sender, NavigationEventArgs e) - { - IsBackEnabled = NavigationService.CanGoBack; - - if (e.SourcePageType == typeof(SettingsPage)) - { - Selected = NavigationViewService.SettingsItem; - return; - } - - var selectedItem = NavigationViewService.GetSelectedItem(e.SourcePageType); - if (selectedItem != null) - { - Selected = selectedItem; - } - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Views/ConfigurePage.xaml b/Community Installers/VDD Panel/VDD Panel/Views/ConfigurePage.xaml deleted file mode 100644 index 625d65e..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Views/ConfigurePage.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/Community Installers/VDD Panel/VDD Panel/Views/ConfigurePage.xaml.cs b/Community Installers/VDD Panel/VDD Panel/Views/ConfigurePage.xaml.cs deleted file mode 100644 index cf46eb3..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Views/ConfigurePage.xaml.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.UI.Xaml.Controls; - -using VDD_Panel.ViewModels; - -namespace VDD_Panel.Views; - -public sealed partial class ConfigurePage : Page -{ - public ConfigureViewModel ViewModel - { - get; - } - - public ConfigurePage() - { - ViewModel = App.GetService(); - InitializeComponent(); - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Views/GitHubPage.xaml b/Community Installers/VDD Panel/VDD Panel/Views/GitHubPage.xaml deleted file mode 100644 index f82ca01..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Views/GitHubPage.xaml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Community Installers/VDD Panel/VDD Panel/Views/GitHubPage.xaml.cs b/Community Installers/VDD Panel/VDD Panel/Views/GitHubPage.xaml.cs deleted file mode 100644 index 11b55ea..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Views/GitHubPage.xaml.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.UI.Xaml.Controls; - -using VDD_Panel.ViewModels; - -namespace VDD_Panel.Views; - -// To learn more about WebView2, see https://docs.microsoft.com/microsoft-edge/webview2/. -public sealed partial class GitHubPage : Page -{ - public GitHubViewModel ViewModel - { - get; - } - - public GitHubPage() - { - ViewModel = App.GetService(); - InitializeComponent(); - - ViewModel.WebViewService.Initialize(WebView); - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Views/MainPage.xaml b/Community Installers/VDD Panel/VDD Panel/Views/MainPage.xaml deleted file mode 100644 index fde0b7d..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Views/MainPage.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/Community Installers/VDD Panel/VDD Panel/Views/MainPage.xaml.cs b/Community Installers/VDD Panel/VDD Panel/Views/MainPage.xaml.cs deleted file mode 100644 index 5402436..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Views/MainPage.xaml.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.UI.Xaml.Controls; - -using VDD_Panel.ViewModels; - -namespace VDD_Panel.Views; - -public sealed partial class MainPage : Page -{ - public MainViewModel ViewModel - { - get; - } - - public MainPage() - { - ViewModel = App.GetService(); - InitializeComponent(); - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Views/SettingsPage.xaml b/Community Installers/VDD Panel/VDD Panel/Views/SettingsPage.xaml deleted file mode 100644 index db551fb..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Views/SettingsPage.xaml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - Light - - - - - Dark - - - - - Default - - - - - - - - - - - - - - - - diff --git a/Community Installers/VDD Panel/VDD Panel/Views/SettingsPage.xaml.cs b/Community Installers/VDD Panel/VDD Panel/Views/SettingsPage.xaml.cs deleted file mode 100644 index fea0e1e..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Views/SettingsPage.xaml.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.UI.Xaml.Controls; - -using VDD_Panel.ViewModels; - -namespace VDD_Panel.Views; - -// TODO: Set the URL for your privacy policy by updating SettingsPage_PrivacyTermsLink.NavigateUri in Resources.resw. -public sealed partial class SettingsPage : Page -{ - public SettingsViewModel ViewModel - { - get; - } - - public SettingsPage() - { - ViewModel = App.GetService(); - InitializeComponent(); - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/Views/ShellPage.xaml b/Community Installers/VDD Panel/VDD Panel/Views/ShellPage.xaml deleted file mode 100644 index 0bc360c..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Views/ShellPage.xaml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Community Installers/VDD Panel/VDD Panel/Views/ShellPage.xaml.cs b/Community Installers/VDD Panel/VDD Panel/Views/ShellPage.xaml.cs deleted file mode 100644 index d14bd16..0000000 --- a/Community Installers/VDD Panel/VDD Panel/Views/ShellPage.xaml.cs +++ /dev/null @@ -1,85 +0,0 @@ -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Input; -using Microsoft.UI.Xaml.Media; - -using VDD_Panel.Contracts.Services; -using VDD_Panel.Helpers; -using VDD_Panel.ViewModels; - -using Windows.System; - -namespace VDD_Panel.Views; - -// TODO: Update NavigationViewItem titles and icons in ShellPage.xaml. -public sealed partial class ShellPage : Page -{ - public ShellViewModel ViewModel - { - get; - } - - public ShellPage(ShellViewModel viewModel) - { - ViewModel = viewModel; - InitializeComponent(); - - ViewModel.NavigationService.Frame = NavigationFrame; - ViewModel.NavigationViewService.Initialize(NavigationViewControl); - - // TODO: Set the title bar icon by updating /Assets/WindowIcon.ico. - // A custom title bar is required for full window theme and Mica support. - // https://docs.microsoft.com/windows/apps/develop/title-bar?tabs=winui3#full-customization - App.MainWindow.ExtendsContentIntoTitleBar = true; - App.MainWindow.SetTitleBar(AppTitleBar); - App.MainWindow.Activated += MainWindow_Activated; - AppTitleBarText.Text = "AppDisplayName".GetLocalized(); - } - - private void OnLoaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) - { - TitleBarHelper.UpdateTitleBar(RequestedTheme); - - KeyboardAccelerators.Add(BuildKeyboardAccelerator(VirtualKey.Left, VirtualKeyModifiers.Menu)); - KeyboardAccelerators.Add(BuildKeyboardAccelerator(VirtualKey.GoBack)); - } - - private void MainWindow_Activated(object sender, WindowActivatedEventArgs args) - { - App.AppTitlebar = AppTitleBarText as UIElement; - } - - private void NavigationViewControl_DisplayModeChanged(NavigationView sender, NavigationViewDisplayModeChangedEventArgs args) - { - AppTitleBar.Margin = new Thickness() - { - Left = sender.CompactPaneLength * (sender.DisplayMode == NavigationViewDisplayMode.Minimal ? 2 : 1), - Top = AppTitleBar.Margin.Top, - Right = AppTitleBar.Margin.Right, - Bottom = AppTitleBar.Margin.Bottom - }; - } - - private static KeyboardAccelerator BuildKeyboardAccelerator(VirtualKey key, VirtualKeyModifiers? modifiers = null) - { - var keyboardAccelerator = new KeyboardAccelerator() { Key = key }; - - if (modifiers.HasValue) - { - keyboardAccelerator.Modifiers = modifiers.Value; - } - - keyboardAccelerator.Invoked += OnKeyboardAcceleratorInvoked; - - return keyboardAccelerator; - } - - private static void OnKeyboardAcceleratorInvoked(KeyboardAccelerator sender, KeyboardAcceleratorInvokedEventArgs args) - { - var navigationService = App.GetService(); - - var result = navigationService.GoBack(); - - args.Handled = result; - } -} diff --git a/Community Installers/VDD Panel/VDD Panel/app.manifest b/Community Installers/VDD Panel/VDD Panel/app.manifest deleted file mode 100644 index b6d665c..0000000 --- a/Community Installers/VDD Panel/VDD Panel/app.manifest +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - true/PM - PerMonitorV2, PerMonitor - - - diff --git a/Community Installers/VDD Panel/VDD Panel/appsettings.json b/Community Installers/VDD Panel/VDD Panel/appsettings.json deleted file mode 100644 index 82055ff..0000000 --- a/Community Installers/VDD Panel/VDD Panel/appsettings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "LocalSettingsOptions": { - "ApplicationDataFolder": "VDD_Panel/ApplicationData", - "LocalSettingsFile": "LocalSettings.json" - } -}