From d5ee557a44164941d2f1d259427e66b3b42ac865 Mon Sep 17 00:00:00 2001
From: pomianowski <13592821+pomianowski@users.noreply.github.com>
Date: Sun, 2 Jun 2024 23:49:08 +0200
Subject: [PATCH 01/13] Move code and add abstractions
---
.github/workflows/wpf-ui-cd-nuget.yaml | 3 +
Directory.Build.props | 62 +++++----
Directory.Build.targets | 101 +++++++++++++-
LICENSE.md | 21 +++
ThirdPartyNotices.txt | 6 +
Wpf.Ui.sln | 130 +++++++++++-------
.../nuget.png | Bin
.../Wpf.Ui.Demo.Console/GlobalUsings.cs | 0
.../Wpf.Ui.Demo.Console/Models/DataColor.cs | 0
.../Wpf.Ui.Demo.Console/Program.cs | 0
.../Utilities/ThemeUtilities.cs | 0
.../Wpf.Ui.Demo.Console/Views/MainView.xaml | 0
.../Views/MainView.xaml.cs | 0
.../Views/Pages/DashboardPage.xaml | 0
.../Views/Pages/DashboardPage.xaml.cs | 0
.../Views/Pages/DataPage.xaml | 0
.../Views/Pages/DataPage.xaml.cs | 0
.../Views/Pages/SettingsPage.xaml | 0
.../Views/Pages/SettingsPage.xaml.cs | 0
.../Wpf.Ui.Demo.Console/Views/SimpleView.xaml | 0
.../Views/SimpleView.xaml.cs | 0
.../Wpf.Ui.Demo.Console.csproj | 11 +-
.../Wpf.Ui.Demo.Console/wpfui.ico | Bin
{src => samples}/Wpf.Ui.Demo.Mvvm/App.xaml | 0
{src => samples}/Wpf.Ui.Demo.Mvvm/App.xaml.cs | 18 +--
samples/Wpf.Ui.Demo.Mvvm/AssemblyInfo.cs | 6 +
.../Assets/applicationIcon-1024.png | Bin
.../Assets/applicationIcon-256.png | Bin
samples/Wpf.Ui.Demo.Mvvm/GlobalUsings.cs | 15 ++
.../Helpers/EnumToBooleanConverter.cs | 1 -
.../Wpf.Ui.Demo.Mvvm/Models/AppConfig.cs | 0
.../Wpf.Ui.Demo.Mvvm/Models/DataColor.cs | 0
.../Services/ApplicationHostService.cs | 13 +-
.../Wpf.Ui.Demo.Mvvm/Services/PageService.cs | 25 ++++
.../ViewModels/DashboardViewModel.cs | 4 +-
.../ViewModels/DataViewModel.cs | 7 +-
.../ViewModels/MainWindowViewModel.cs | 2 +-
.../ViewModels/SettingsViewModel.cs | 8 +-
.../Wpf.Ui.Demo.Mvvm/ViewModels/ViewModel.cs | 55 ++++++++
.../Wpf.Ui.Demo.Mvvm/Views/MainWindow.xaml | 0
.../Wpf.Ui.Demo.Mvvm/Views/MainWindow.xaml.cs | 1 +
.../Views/Pages/DashboardPage.xaml | 0
.../Views/Pages/DashboardPage.xaml.cs | 4 +-
.../Views/Pages/DataPage.xaml | 0
.../Views/Pages/DataPage.xaml.cs | 4 +-
.../Views/Pages/SettingsPage.xaml | 0
.../Views/Pages/SettingsPage.xaml.cs | 4 +-
.../Wpf.Ui.Demo.Mvvm/Wpf.Ui.Demo.Mvvm.csproj | 18 +--
.../Wpf.Ui.Demo.Mvvm/app.manifest | 0
.../Wpf.Ui.Demo.Mvvm/applicationIcon.ico | Bin
{src => samples}/Wpf.Ui.Demo.Simple/App.xaml | 0
.../Wpf.Ui.Demo.Simple/App.xaml.cs | 0
.../Wpf.Ui.Demo.Simple/AssemblyInfo.cs | 0
.../Assets/applicationIcon-1024.png | Bin 0 -> 10779 bytes
.../Assets/applicationIcon-256.png | Bin
.../Wpf.Ui.Demo.Simple/MainWindow.xaml | 0
.../Wpf.Ui.Demo.Simple/MainWindow.xaml.cs | 0
.../Wpf.Ui.Demo.Simple/Models/DataColor.cs | 0
.../Views/Pages/DashboardPage.xaml | 0
.../Views/Pages/DashboardPage.xaml.cs | 0
.../Views/Pages/DataPage.xaml | 0
.../Views/Pages/DataPage.xaml.cs | 0
.../Views/Pages/SettingsPage.xaml | 0
.../Views/Pages/SettingsPage.xaml.cs | 0
.../Wpf.Ui.Demo.Simple.csproj | 18 +--
.../Wpf.Ui.Demo.Simple/app.manifest | 0
.../Wpf.Ui.Demo.Simple/applicationIcon.ico | Bin
.../Controls}/INavigableView.cs | 7 +-
.../Controls}/INavigationAware.cs | 14 +-
.../Controls/NavigationAware.cs | 40 ++++++
src/Wpf.Ui.Abstractions/GlobalUsings.cs | 7 +
src/Wpf.Ui.Abstractions/IPageService.cs | 19 +++
.../NavigationException.cs | 27 ++++
.../PageServiceExtensions.cs | 39 ++++++
.../Wpf.Ui.Abstractions.csproj | 18 +++
src/Wpf.Ui.Demo.Mvvm/AssemblyInfo.cs | 9 --
src/Wpf.Ui.Demo.Mvvm/Services/PageService.cs | 48 -------
src/Wpf.Ui.FontMapper/GitTag.cs | 2 +-
src/Wpf.Ui.FontMapper/GlobalUsings.cs | 11 ++
src/Wpf.Ui.FontMapper/Program.cs | 2 +-
.../ServiceCollectionExtensions.cs | 7 +
.../{Usings.cs => GlobalUsings.cs} | 11 +-
.../ViewModels/Pages/AllControlsViewModel.cs | 2 +-
.../Pages/BasicInput/AnchorViewModel.cs | 2 +-
.../Pages/BasicInput/BasicInputViewModel.cs | 2 +-
.../Pages/BasicInput/ButtonViewModel.cs | 2 +-
.../Pages/BasicInput/CheckBoxViewModel.cs | 2 +-
.../Pages/BasicInput/ComboBoxViewModel.cs | 2 +-
.../BasicInput/DropDownButtonViewModel.cs | 2 +-
.../BasicInput/HyperlinkButtonViewModel.cs | 2 +-
.../Pages/BasicInput/RadioButtonViewModel.cs | 2 +-
.../Pages/BasicInput/RatingViewModel.cs | 2 +-
.../Pages/BasicInput/SliderViewModel.cs | 2 +-
.../Pages/BasicInput/SplitButtonViewModel.cs | 2 +-
.../Pages/BasicInput/ThumbRateViewModel.cs | 2 +-
.../Pages/BasicInput/ToggleButtonViewModel.cs | 2 +-
.../Pages/BasicInput/ToggleSwitchViewModel.cs | 2 +-
.../Pages/Collections/CollectionsViewModel.cs | 2 +-
.../Pages/Collections/DataGridViewModel.cs | 9 +-
.../Pages/Collections/ListBoxViewModel.cs | 16 ++-
.../Pages/Collections/ListViewViewModel.cs | 9 +-
.../Pages/Collections/TreeListViewModel.cs | 2 +-
.../Pages/Collections/TreeViewViewModel.cs | 2 +-
.../ViewModels/Pages/DashboardViewModel.cs | 11 +-
.../CalendarDatePickerViewModel.cs | 2 +-
.../Pages/DateAndTime/CalendarViewModel.cs | 2 +-
.../Pages/DateAndTime/DateAndTimeViewModel.cs | 2 +-
.../Pages/DateAndTime/DatePickerViewModel.cs | 2 +-
.../Pages/DateAndTime/TimePickerViewModel.cs | 2 +-
.../Pages/DesignGuidance/ColorsViewModel.cs | 2 +-
.../Pages/DesignGuidance/IconsViewModel.cs | 6 +-
.../DesignGuidance/TypographyViewModel.cs | 2 +-
.../ContentDialogViewModel.cs | 13 +-
.../DialogsAndFlyoutsViewModel.cs | 2 +-
.../DialogsAndFlyouts/FlyoutViewModel.cs | 2 +-
.../DialogsAndFlyouts/MessageBoxViewModel.cs | 2 +-
.../DialogsAndFlyouts/SnackbarViewModel.cs | 2 +-
.../Pages/Layout/CardActionViewModel.cs | 2 +-
.../Pages/Layout/CardControlViewModel.cs | 2 +-
.../Pages/Layout/ExpanderViewModel.cs | 2 +-
.../Pages/Layout/LayoutViewModel.cs | 2 +-
.../ViewModels/Pages/Media/CanvasViewModel.cs | 2 +-
.../ViewModels/Pages/Media/ImageViewModel.cs | 2 +-
.../ViewModels/Pages/Media/MediaViewModel.cs | 2 +-
.../Pages/Media/WebBrowserViewModel.cs | 2 +-
.../Pages/Media/WebViewViewModel.cs | 2 +-
.../Navigation/BreadcrumbBarViewModel.cs | 2 +-
.../Pages/Navigation/MenuViewModel.cs | 2 +-
.../Pages/Navigation/NavigationViewModel.cs | 2 +-
.../Navigation/NavigationViewViewModel.cs | 2 +-
.../Pages/Navigation/TabControlViewModel.cs | 2 +-
.../Pages/Navigation/TabViewViewModel.cs | 2 +-
.../Pages/OpSystem/ClipboardViewModel.cs | 2 +-
.../Pages/OpSystem/FilePickerViewModel.cs | 2 +-
.../Pages/OpSystem/OpSystemViewModel.cs | 2 +-
.../ViewModels/Pages/SettingsViewModel.cs | 15 +-
.../Pages/StatusAndInfo/InfoBadgeViewModel.cs | 2 +-
.../Pages/StatusAndInfo/InfoBarViewModel.cs | 2 +-
.../StatusAndInfo/ProgressBarViewModel.cs | 2 +-
.../StatusAndInfo/ProgressRingViewModel.cs | 2 +-
.../StatusAndInfo/StatusAndInfoViewModel.cs | 2 +-
.../Pages/StatusAndInfo/ToolTipViewModel.cs | 2 +-
.../Pages/Text/AutoSuggestBoxViewModel.cs | 2 +-
.../ViewModels/Pages/Text/LabelViewModel.cs | 2 +-
.../Pages/Text/NumberBoxViewModel.cs | 2 +-
.../Pages/Text/PasswordBoxViewModel.cs | 2 +-
.../Pages/Text/RichTextBoxViewModel.cs | 2 +-
.../Pages/Text/TextBlockViewModel.cs | 2 +-
.../ViewModels/Pages/Text/TextBoxViewModel.cs | 2 +-
.../ViewModels/Pages/Text/TextViewModel.cs | 4 +-
.../Pages/Windows/WindowsViewModel.cs | 2 +-
src/Wpf.Ui.Gallery/ViewModels/ViewModel.cs | 53 +++++++
.../Windows/EditorWindowViewModel.cs | 2 +-
.../ViewModels/Windows/MainWindowViewModel.cs | 2 +-
.../Windows/MonacoWindowViewModel.cs | 3 +-
.../Windows/SandboxWindowViewModel.cs | 2 +-
.../Views/Pages/AllControlsPage.xaml.cs | 1 -
.../Wpf.Ui.SyntaxHighlight.csproj | 29 ++--
.../GlobalUsings.cs} | 4 +-
.../Properties/AssemblyInfo.cs | 2 -
src/Wpf.Ui.ToastNotifications/Toast.cs | 2 -
.../Wpf.Ui.ToastNotifications.csproj | 53 +------
src/Wpf.Ui.Tray/Controls/NotifyIcon.cs | 2 -
src/Wpf.Ui.Tray/GlobalUsings.cs | 12 ++
src/Wpf.Ui.Tray/Hicon.cs | 3 -
src/Wpf.Ui.Tray/INotifyIcon.cs | 2 -
.../Internal/InternalNotifyIconManager.cs | 9 +-
src/Wpf.Ui.Tray/Interop/Shell32.cs | 2 -
src/Wpf.Ui.Tray/Interop/User32.cs | 3 -
src/Wpf.Ui.Tray/NotifyIconService.cs | 1 -
src/Wpf.Ui.Tray/RoutedNotifyIconEvent.cs | 1 -
src/Wpf.Ui.Tray/TrayData.cs | 2 -
src/Wpf.Ui.Tray/TrayHandler.cs | 3 -
src/Wpf.Ui.Tray/TrayManager.cs | 2 -
src/Wpf.Ui.Tray/Wpf.Ui.Tray.csproj | 69 ++--------
.../ApplicationAccentColorManager.cs | 8 +-
.../Appearance/ApplicationThemeManager.cs | 4 +-
src/Wpf.Ui/Appearance/ObservedWindow.cs | 34 ++++-
.../CardControlAutomationPeer.cs | 21 ++-
.../NavigationView/INavigationView.cs | 1 +
.../NavigationView.Navigation.cs | 2 +
.../NavigationView/NavigationViewActivator.cs | 1 +
.../NavigationViewContentPresenter.cs | 21 ++-
.../VirtualizingWrapPanel.cs | 3 +-
src/Wpf.Ui/{Usings.cs => GlobalUsings.cs} | 0
src/Wpf.Ui/INavigationService.cs | 1 +
src/Wpf.Ui/INavigationWindow.cs | 1 +
src/Wpf.Ui/IPageService.cs | 29 ----
src/Wpf.Ui/Interop/UnsafeNativeMethods.cs | 4 +-
src/Wpf.Ui/Markup/Design.cs | 7 +-
src/Wpf.Ui/NavigationService.cs | 1 +
src/Wpf.Ui/UiApplication.cs | 17 ++-
src/Wpf.Ui/Win32/Utilities.cs | 6 +-
src/Wpf.Ui/Wpf.Ui.csproj | 84 ++---------
194 files changed, 863 insertions(+), 649 deletions(-)
create mode 100644 LICENSE.md
create mode 100644 ThirdPartyNotices.txt
rename src/Wpf.Ui.Demo.Mvvm/Assets/applicationIcon-1024.png => build/nuget.png (100%)
rename src/Wpf.Ui.Demo.Console/Usings.cs => samples/Wpf.Ui.Demo.Console/GlobalUsings.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Models/DataColor.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Program.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Utilities/ThemeUtilities.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Views/MainView.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Views/MainView.xaml.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Views/Pages/DashboardPage.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Views/Pages/DashboardPage.xaml.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Views/Pages/DataPage.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Views/Pages/DataPage.xaml.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Views/Pages/SettingsPage.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Views/Pages/SettingsPage.xaml.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Views/SimpleView.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Views/SimpleView.xaml.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Console/Wpf.Ui.Demo.Console.csproj (65%)
rename {src => samples}/Wpf.Ui.Demo.Console/wpfui.ico (100%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/App.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/App.xaml.cs (91%)
create mode 100644 samples/Wpf.Ui.Demo.Mvvm/AssemblyInfo.cs
rename {src/Wpf.Ui.Demo.Simple => samples/Wpf.Ui.Demo.Mvvm}/Assets/applicationIcon-1024.png (100%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Assets/applicationIcon-256.png (100%)
create mode 100644 samples/Wpf.Ui.Demo.Mvvm/GlobalUsings.cs
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Helpers/EnumToBooleanConverter.cs (97%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Models/AppConfig.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Models/DataColor.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Services/ApplicationHostService.cs (79%)
create mode 100644 samples/Wpf.Ui.Demo.Mvvm/Services/PageService.cs
rename {src => samples}/Wpf.Ui.Demo.Mvvm/ViewModels/DashboardViewModel.cs (75%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/ViewModels/DataViewModel.cs (88%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/ViewModels/MainWindowViewModel.cs (97%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/ViewModels/SettingsViewModel.cs (92%)
create mode 100644 samples/Wpf.Ui.Demo.Mvvm/ViewModels/ViewModel.cs
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Views/MainWindow.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Views/MainWindow.xaml.cs (98%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Views/Pages/DashboardPage.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Views/Pages/DashboardPage.xaml.cs (85%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Views/Pages/DataPage.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Views/Pages/DataPage.xaml.cs (85%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Views/Pages/SettingsPage.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Views/Pages/SettingsPage.xaml.cs (85%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/Wpf.Ui.Demo.Mvvm.csproj (57%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/app.manifest (100%)
rename {src => samples}/Wpf.Ui.Demo.Mvvm/applicationIcon.ico (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/App.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/App.xaml.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/AssemblyInfo.cs (100%)
create mode 100644 samples/Wpf.Ui.Demo.Simple/Assets/applicationIcon-1024.png
rename {src => samples}/Wpf.Ui.Demo.Simple/Assets/applicationIcon-256.png (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/MainWindow.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/MainWindow.xaml.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/Models/DataColor.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/Views/Pages/DashboardPage.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/Views/Pages/DashboardPage.xaml.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/Views/Pages/DataPage.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/Views/Pages/DataPage.xaml.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/Views/Pages/SettingsPage.xaml (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/Views/Pages/SettingsPage.xaml.cs (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/Wpf.Ui.Demo.Simple.csproj (53%)
rename {src => samples}/Wpf.Ui.Demo.Simple/app.manifest (100%)
rename {src => samples}/Wpf.Ui.Demo.Simple/applicationIcon.ico (100%)
rename src/{Wpf.Ui/Controls/NavigationView => Wpf.Ui.Abstractions/Controls}/INavigableView.cs (81%)
rename src/{Wpf.Ui/Controls/NavigationView => Wpf.Ui.Abstractions/Controls}/INavigationAware.cs (50%)
create mode 100644 src/Wpf.Ui.Abstractions/Controls/NavigationAware.cs
create mode 100644 src/Wpf.Ui.Abstractions/GlobalUsings.cs
create mode 100644 src/Wpf.Ui.Abstractions/IPageService.cs
create mode 100644 src/Wpf.Ui.Abstractions/NavigationException.cs
create mode 100644 src/Wpf.Ui.Abstractions/PageServiceExtensions.cs
create mode 100644 src/Wpf.Ui.Abstractions/Wpf.Ui.Abstractions.csproj
delete mode 100644 src/Wpf.Ui.Demo.Mvvm/AssemblyInfo.cs
delete mode 100644 src/Wpf.Ui.Demo.Mvvm/Services/PageService.cs
create mode 100644 src/Wpf.Ui.FontMapper/GlobalUsings.cs
rename src/Wpf.Ui.Gallery/{Usings.cs => GlobalUsings.cs} (96%)
create mode 100644 src/Wpf.Ui.Gallery/ViewModels/ViewModel.cs
rename src/{Wpf.Ui.Demo.Mvvm/Usings.cs => Wpf.Ui.ToastNotifications/GlobalUsings.cs} (76%)
create mode 100644 src/Wpf.Ui.Tray/GlobalUsings.cs
rename src/Wpf.Ui/{Usings.cs => GlobalUsings.cs} (100%)
delete mode 100644 src/Wpf.Ui/IPageService.cs
diff --git a/.github/workflows/wpf-ui-cd-nuget.yaml b/.github/workflows/wpf-ui-cd-nuget.yaml
index 9fd8c41e7..4c19d45ea 100644
--- a/.github/workflows/wpf-ui-cd-nuget.yaml
+++ b/.github/workflows/wpf-ui-cd-nuget.yaml
@@ -28,6 +28,9 @@ jobs:
- name: Build
run: dotnet build src\Wpf.Ui\Wpf.Ui.csproj --configuration Release --no-restore -p:SourceLinkEnabled=true
+ - name: Build
+ run: dotnet build src\Wpf.Ui.Abstractions\Wpf.Ui.Abstractions.csproj --configuration Release --no-restore -p:SourceLinkEnabled=true
+
- name: Build
run: dotnet build src\Wpf.Ui.Tray\Wpf.Ui.Tray.csproj --configuration Release --no-restore -p:SourceLinkEnabled=true
diff --git a/Directory.Build.props b/Directory.Build.props
index c6aabc6b9..f41b3dcea 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,36 +1,28 @@
+
- 3.0.4
- 12.0
- true
+ $(MSBuildThisFileDirectory)
+ $(RepositoryDirectory)build\
- net8.0-windows;net7.0-windows;net6.0-windows;net481;net472;net462
+ 4.0.0-rc.1
- enable
- enable
- $(Version)
- lepo.co
lepo.co
- Copyright (C) 2021-2024 Leszek Pomianowski and WPF UI Contributors
- true
+ lepo.co
+ WPF-UI
+ lepoco;toolkit;wpf;fluent;navigation;controls;design;icons;system;accent;theme;winui
MIT
- https://raw.githubusercontent.com/lepoco/wpfui/main/LICENSE
+ true
+ Copyright (C) 2021-2024 Leszek Pomianowski and WPF UI Contributors
https://github.com/lepoco/wpfui
https://github.com/lepoco/wpfui/releases
- https://github.com/lepoco/wpfui
+ Icon.png
+ https://github.com/lepoco/wpfui/main/build/nuget.png
main
git
- WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.
- wpf ui wpfui fluent design winui windows controls custom metro modern xaml toolkit color dark theme lepo net6 net5 net
- README.md
-
-
-
- true
@@ -41,18 +33,32 @@
true
-
-
-
+
+ true
+ true
+
-
-
-
+
+ true
+ 12.0
+ enable
+
+
+ $(NoWarn);CS8500
+
+
+
+ $(MSBuildProjectName.Contains('Test'))
+ False
+ True
+
-
- <_Parameter1>$(MSBuildProjectName).UnitTests
-
+
diff --git a/Directory.Build.targets b/Directory.Build.targets
index c9fb730d2..42b05531c 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -1,4 +1,103 @@
+
+
+ true
+
+
+
+ $(CommonTags);.NET
+ $(CommonTags);$(PackageTags)
+ $(CommonTags)
+
+
+
+ true
+ README.md
+ false
+ true
+ snupkg
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+ <_Parameter1>CommitHash
+ <_Parameter2>$(SourceRevisionId)
+
+
+
+
+
+
+ true
+ true
+ true
+ true
+
+
+
+
+ $(IntermediateOutputPath)$(MSBuildProjectName).SkipLocalsInit.g.cs
+
+
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+[module: global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PerMonitor
+ true/PM
+ true
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/Wpf.Ui.Demo.Dialogs/applicationIcon.ico b/samples/Wpf.Ui.Demo.Dialogs/applicationIcon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..cc128fda396328cd04b533b9b08b1c6db4988146
GIT binary patch
literal 19438
zcmeHO3piB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g)>LrMu~gl3xA-a0R%a(IH6`$ixRVK8KReSZ{odsvgUfh7>6!jg+N&VQ-Xk6F
N)4sJdOJ2@6@J}ZcNv8k+
literal 0
HcmV?d00001
diff --git a/samples/Wpf.Ui.Demo.Mvvm/App.xaml.cs b/samples/Wpf.Ui.Demo.Mvvm/App.xaml.cs
index aec79ead2..a410c0324 100644
--- a/samples/Wpf.Ui.Demo.Mvvm/App.xaml.cs
+++ b/samples/Wpf.Ui.Demo.Mvvm/App.xaml.cs
@@ -3,10 +3,10 @@
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
using System.IO;
using System.Windows.Threading;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
using Wpf.Ui.Abstractions;
using Wpf.Ui.Demo.Mvvm.Models;
using Wpf.Ui.Demo.Mvvm.Services;
@@ -74,10 +74,7 @@ public partial class App
///
public static IServiceProvider Services
{
- get
- {
- return _host.Services;
- }
+ get { return _host.Services; }
}
///
diff --git a/src/Wpf.Ui.Gallery/GlobalUsings.cs b/src/Wpf.Ui.Gallery/GlobalUsings.cs
index bd2892d75..c26fd1471 100644
--- a/src/Wpf.Ui.Gallery/GlobalUsings.cs
+++ b/src/Wpf.Ui.Gallery/GlobalUsings.cs
@@ -3,11 +3,6 @@
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.
-global using CommunityToolkit.Mvvm.ComponentModel;
-global using CommunityToolkit.Mvvm.Input;
-global using Microsoft.Extensions.Configuration;
-global using Microsoft.Extensions.DependencyInjection;
-global using Microsoft.Extensions.Hosting;
global using System;
global using System.Collections.Generic;
global using System.Collections.ObjectModel;
@@ -25,4 +20,9 @@
global using System.Windows.Markup;
global using System.Windows.Media;
global using System.Windows.Threading;
-global using Wpf.Ui.Abstractions.Controls;
\ No newline at end of file
+global using CommunityToolkit.Mvvm.ComponentModel;
+global using CommunityToolkit.Mvvm.Input;
+global using Microsoft.Extensions.Configuration;
+global using Microsoft.Extensions.DependencyInjection;
+global using Microsoft.Extensions.Hosting;
+global using Wpf.Ui.Abstractions.Controls;
From b13221e6a920df43b28b9e05571a265a37a34d72 Mon Sep 17 00:00:00 2001
From: pomianowski <13592821+pomianowski@users.noreply.github.com>
Date: Mon, 3 Jun 2024 00:43:23 +0200
Subject: [PATCH 07/13] Simplify demo
---
samples/Wpf.Ui.Demo.Dialogs/App.xaml | 13 +------------
samples/Wpf.Ui.Demo.Dialogs/MainWindow.xaml | 9 ++++++++-
src/Wpf.Ui/Controls/ContentDialog/ContentDialog.cs | 1 +
3 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/samples/Wpf.Ui.Demo.Dialogs/App.xaml b/samples/Wpf.Ui.Demo.Dialogs/App.xaml
index e88ef75aa..6caa7edc6 100644
--- a/samples/Wpf.Ui.Demo.Dialogs/App.xaml
+++ b/samples/Wpf.Ui.Demo.Dialogs/App.xaml
@@ -2,15 +2,4 @@
x:Class="Wpf.Ui.Demo.Dialogs.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="clr-namespace:Wpf.Ui.Demo.Dialogs"
- xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
- StartupUri="MainWindow.xaml">
-
-
-
-
-
-
-
-
-
+ StartupUri="MainWindow.xaml" />
diff --git a/samples/Wpf.Ui.Demo.Dialogs/MainWindow.xaml b/samples/Wpf.Ui.Demo.Dialogs/MainWindow.xaml
index 31cac7ff5..7e6c222d6 100644
--- a/samples/Wpf.Ui.Demo.Dialogs/MainWindow.xaml
+++ b/samples/Wpf.Ui.Demo.Dialogs/MainWindow.xaml
@@ -3,13 +3,20 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:Wpf.Ui.Demo.Dialogs"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="WPF UI - Dialog sample"
Width="800"
Height="450"
mc:Ignorable="d">
+
+
+
+
+
+
+
+
Date: Sun, 9 Jun 2024 13:47:30 +0200
Subject: [PATCH 08/13] Test translations
---
Directory.Packages.props | 11 ++-
src/Wpf.Ui.Gallery/App.xaml.cs | 7 ++
.../ControlsLookup/GalleryPageAttribute.cs | 12 +--
src/Wpf.Ui.Gallery/Resources/Translations.cs | 8 ++
.../Resources/Translations.pl-PL.Designer.cs | 80 +++++++++++++++++++
.../Resources/Translations.pl-PL.resx | 27 +++++++
.../ViewModels/Windows/MainWindowViewModel.cs | 6 +-
.../Views/Windows/MainWindow.xaml | 3 +-
src/Wpf.Ui.Gallery/Wpf.Ui.Gallery.csproj | 17 ++++
9 files changed, 155 insertions(+), 16 deletions(-)
create mode 100644 src/Wpf.Ui.Gallery/Resources/Translations.cs
create mode 100644 src/Wpf.Ui.Gallery/Resources/Translations.pl-PL.Designer.cs
create mode 100644 src/Wpf.Ui.Gallery/Resources/Translations.pl-PL.resx
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 4d31ec245..3d358a5f3 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -2,14 +2,17 @@
-
+
+
+
+
-
+
-
+
@@ -21,4 +24,4 @@
-
+
\ No newline at end of file
diff --git a/src/Wpf.Ui.Gallery/App.xaml.cs b/src/Wpf.Ui.Gallery/App.xaml.cs
index 9022a6ff5..62de524a5 100644
--- a/src/Wpf.Ui.Gallery/App.xaml.cs
+++ b/src/Wpf.Ui.Gallery/App.xaml.cs
@@ -3,7 +3,9 @@
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.
+using Lepo.i18n.DependencyInjection;
using Wpf.Ui.Gallery.DependencyModel;
+using Wpf.Ui.Gallery.Resources;
using Wpf.Ui.Gallery.Services;
using Wpf.Ui.Gallery.Services.Contracts;
using Wpf.Ui.Gallery.ViewModels.Pages;
@@ -53,6 +55,11 @@ public partial class App
"Wpf.Ui.Gallery.ViewModels",
GalleryAssembly.Asssembly
);
+
+ _ = services.AddStringLocalizer(b =>
+ {
+ b.FromResource(new("pl-PL"));
+ });
}
)
.Build();
diff --git a/src/Wpf.Ui.Gallery/ControlsLookup/GalleryPageAttribute.cs b/src/Wpf.Ui.Gallery/ControlsLookup/GalleryPageAttribute.cs
index a201ca741..e1596b0c6 100644
--- a/src/Wpf.Ui.Gallery/ControlsLookup/GalleryPageAttribute.cs
+++ b/src/Wpf.Ui.Gallery/ControlsLookup/GalleryPageAttribute.cs
@@ -8,15 +8,9 @@
namespace Wpf.Ui.Gallery.ControlsLookup;
[AttributeUsage(AttributeTargets.Class)]
-internal class GalleryPageAttribute : Attribute
+internal sealed class GalleryPageAttribute(string description, SymbolRegular icon) : Attribute
{
- public string Description { get; }
+ public string Description { get; } = description;
- public SymbolRegular Icon { get; }
-
- public GalleryPageAttribute(string description, SymbolRegular icon)
- {
- Description = description;
- Icon = icon;
- }
+ public SymbolRegular Icon { get; } = icon;
}
diff --git a/src/Wpf.Ui.Gallery/Resources/Translations.cs b/src/Wpf.Ui.Gallery/Resources/Translations.cs
new file mode 100644
index 000000000..2fd340047
--- /dev/null
+++ b/src/Wpf.Ui.Gallery/Resources/Translations.cs
@@ -0,0 +1,8 @@
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
+// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
+// All Rights Reserved.
+
+namespace Wpf.Ui.Gallery.Resources;
+
+public partial class Translations;
\ No newline at end of file
diff --git a/src/Wpf.Ui.Gallery/Resources/Translations.pl-PL.Designer.cs b/src/Wpf.Ui.Gallery/Resources/Translations.pl-PL.Designer.cs
new file mode 100644
index 000000000..4c5543244
--- /dev/null
+++ b/src/Wpf.Ui.Gallery/Resources/Translations.pl-PL.Designer.cs
@@ -0,0 +1,80 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Wpf.Ui.Gallery.Resources {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Translations_pl_PL {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Translations_pl_PL() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Wpf.Ui.Gallery.Resources.Translations.pl-PL", typeof(Translations_pl_PL).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Szukaj.
+ ///
+ internal static string Search {
+ get {
+ return ResourceManager.GetString("Search", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to WPF UI Galeria.
+ ///
+ internal static string WPF_UI_Gallery {
+ get {
+ return ResourceManager.GetString("WPF UI Gallery", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/Wpf.Ui.Gallery/Resources/Translations.pl-PL.resx b/src/Wpf.Ui.Gallery/Resources/Translations.pl-PL.resx
new file mode 100644
index 000000000..f24f175a5
--- /dev/null
+++ b/src/Wpf.Ui.Gallery/Resources/Translations.pl-PL.resx
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Szukaj
+
+
+ WPF UI Galeria
+
+
\ No newline at end of file
diff --git a/src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs
index f7e3cd8c7..c6101117e 100644
--- a/src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs
+++ b/src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs
@@ -5,7 +5,9 @@
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
+using Microsoft.Extensions.Localization;
using Wpf.Ui.Controls;
+using Wpf.Ui.Gallery.Resources;
using Wpf.Ui.Gallery.Views.Pages;
using Wpf.Ui.Gallery.Views.Pages.BasicInput;
using Wpf.Ui.Gallery.Views.Pages.Collections;
@@ -22,10 +24,10 @@
namespace Wpf.Ui.Gallery.ViewModels.Windows;
-public partial class MainWindowViewModel : ViewModel
+public partial class MainWindowViewModel(IStringLocalizer localizer) : ViewModel
{
[ObservableProperty]
- private string _applicationTitle = "WPF UI Gallery";
+ private string _applicationTitle = localizer["WPF UI Gallery"];
[ObservableProperty]
private ObservableCollection