diff --git a/src/Packages.props b/src/Packages.props index 2fb5e3b83..31bf138d9 100644 --- a/src/Packages.props +++ b/src/Packages.props @@ -5,6 +5,7 @@ + diff --git a/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-100.png b/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-100.png new file mode 100644 index 000000000..2ffe722b8 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-100.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-125.png b/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-125.png new file mode 100644 index 000000000..effcd7f99 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-125.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-150.png b/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-150.png new file mode 100644 index 000000000..0a5bc4347 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-150.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-200.png b/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-200.png new file mode 100644 index 000000000..f9e043b03 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-200.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-400.png b/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-400.png new file mode 100644 index 000000000..4d9e77d4a Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/LargeTile.scale-400.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/LockScreenLogo.scale-200.png b/src/Wpf.Ui.Gallery.Package/Images/LockScreenLogo.scale-200.png new file mode 100644 index 000000000..735f57adb Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/LockScreenLogo.scale-200.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-100.png b/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-100.png new file mode 100644 index 000000000..5c6407e03 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-100.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-125.png b/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-125.png new file mode 100644 index 000000000..1b0760a4a Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-125.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-150.png b/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-150.png new file mode 100644 index 000000000..3e60f2a55 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-150.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-200.png b/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-200.png new file mode 100644 index 000000000..4a2b38f0e Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-200.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-400.png b/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-400.png new file mode 100644 index 000000000..2c938b303 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/SmallTile.scale-400.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-100.png b/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-100.png new file mode 100644 index 000000000..382372695 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-100.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-125.png b/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-125.png new file mode 100644 index 000000000..6bff03ed0 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-125.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-150.png b/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-150.png new file mode 100644 index 000000000..dca18b7db Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-150.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-200.png b/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-200.png new file mode 100644 index 000000000..a046b850f Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-200.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-400.png b/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-400.png new file mode 100644 index 000000000..3180bbc12 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/SplashScreen.scale-400.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-100.png b/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-100.png new file mode 100644 index 000000000..77d1b9af2 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-100.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-125.png b/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-125.png new file mode 100644 index 000000000..945eb62a2 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-125.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-150.png b/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-150.png new file mode 100644 index 000000000..5712d32e4 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-150.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-200.png b/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-200.png new file mode 100644 index 000000000..af8a8b9fd Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-200.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-400.png b/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-400.png new file mode 100644 index 000000000..9e4bd652c Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square150x150Logo.scale-400.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png new file mode 100644 index 000000000..36e4d151b Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png new file mode 100644 index 000000000..a661ffa2b Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png new file mode 100644 index 000000000..6b7e1161d Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png new file mode 100644 index 000000000..d8196eae1 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png new file mode 100644 index 000000000..b036f6bd8 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-unplated_targetsize-16.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-unplated_targetsize-16.png new file mode 100644 index 000000000..36e4d151b Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-unplated_targetsize-16.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-unplated_targetsize-256.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-unplated_targetsize-256.png new file mode 100644 index 000000000..6b7e1161d Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-unplated_targetsize-256.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-unplated_targetsize-32.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-unplated_targetsize-32.png new file mode 100644 index 000000000..d8196eae1 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-unplated_targetsize-32.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-unplated_targetsize-48.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-unplated_targetsize-48.png new file mode 100644 index 000000000..b036f6bd8 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.altform-unplated_targetsize-48.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-100.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-100.png new file mode 100644 index 000000000..6d9a80d80 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-100.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-125.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-125.png new file mode 100644 index 000000000..6c33ea41f Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-125.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-150.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-150.png new file mode 100644 index 000000000..d45585c94 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-150.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-200.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-200.png new file mode 100644 index 000000000..f6967fb87 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-200.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-400.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-400.png new file mode 100644 index 000000000..a5e9c6bfd Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.scale-400.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-16.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-16.png new file mode 100644 index 000000000..36e4d151b Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-16.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-24.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-24.png new file mode 100644 index 000000000..a661ffa2b Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-24.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 000000000..a661ffa2b Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-256.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-256.png new file mode 100644 index 000000000..6b7e1161d Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-256.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-32.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-32.png new file mode 100644 index 000000000..d8196eae1 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-32.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-48.png b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-48.png new file mode 100644 index 000000000..b036f6bd8 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Square44x44Logo.targetsize-48.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.backup.png b/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.backup.png new file mode 100644 index 000000000..7385b56c0 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.backup.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-100.png b/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-100.png new file mode 100644 index 000000000..562342df3 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-100.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-125.png b/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-125.png new file mode 100644 index 000000000..9a76936b1 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-125.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-150.png b/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-150.png new file mode 100644 index 000000000..16cb816b1 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-150.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-200.png b/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-200.png new file mode 100644 index 000000000..a6c04ea90 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-200.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-400.png b/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-400.png new file mode 100644 index 000000000..c36ddaa5f Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/StoreLogo.scale-400.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-100.png b/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-100.png new file mode 100644 index 000000000..a6ba51c63 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-100.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-125.png b/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-125.png new file mode 100644 index 000000000..5c6125743 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-125.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-150.png b/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-150.png new file mode 100644 index 000000000..a5ce13bab Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-150.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-200.png b/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-200.png new file mode 100644 index 000000000..382372695 Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-200.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-400.png b/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-400.png new file mode 100644 index 000000000..a046b850f Binary files /dev/null and b/src/Wpf.Ui.Gallery.Package/Images/Wide310x150Logo.scale-400.png differ diff --git a/src/Wpf.Ui.Gallery.Package/Package.appxmanifest b/src/Wpf.Ui.Gallery.Package/Package.appxmanifest new file mode 100644 index 000000000..00efae88d --- /dev/null +++ b/src/Wpf.Ui.Gallery.Package/Package.appxmanifest @@ -0,0 +1,48 @@ + + + + + + + + Wpf.Ui.Gallery.Package + Raven + Images\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Wpf.Ui.Gallery.Package/Wpf.Ui.Gallery.Package.wapproj b/src/Wpf.Ui.Gallery.Package/Wpf.Ui.Gallery.Package.wapproj new file mode 100644 index 000000000..0add8ccd3 --- /dev/null +++ b/src/Wpf.Ui.Gallery.Package/Wpf.Ui.Gallery.Package.wapproj @@ -0,0 +1,126 @@ + + + + 15.0 + + + + Debug + x86 + + + Release + x86 + + + Debug + x64 + + + Release + x64 + + + Debug + ARM + + + Release + ARM + + + Debug + ARM64 + + + Release + ARM64 + + + Debug + AnyCPU + + + Release + AnyCPU + + + + $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\ + + + + 50c713c3-555e-491f-87ee-c806bec0579f + 10.0.22621.0 + 10.0.14393.0 + en-US + false + $(NoWarn);NU1702 + ..\Wpf.Ui.Gallery\Wpf.Ui.Gallery.csproj + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Wpf.Ui.Gallery.sln b/src/Wpf.Ui.Gallery.sln new file mode 100644 index 000000000..0a532cc32 --- /dev/null +++ b/src/Wpf.Ui.Gallery.sln @@ -0,0 +1,116 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32407.343 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wpf.Ui", "Wpf.Ui\Wpf.Ui.csproj", "{1ADC87D1-8963-4100-845A-18477824718E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{21DB16AA-40BB-428B-AFE8-DEF4E3F0DC49}" + ProjectSection(SolutionItems) = preProject + Directory.Build.props = Directory.Build.props + ..\LICENSE = ..\LICENSE + Packages.props = Packages.props + ..\README.md = ..\README.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{BA330FCF-7C4C-4B06-A124-C33BB701B174}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wpf.Ui.Gallery", "Wpf.Ui.Gallery\Wpf.Ui.Gallery.csproj", "{3EC786F3-9B6B-4714-B092-59B4A844D884}" +EndProject +Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "Wpf.Ui.Gallery.Package", "Wpf.Ui.Gallery.Package\Wpf.Ui.Gallery.Package.wapproj", "{50C713C3-555E-491F-87EE-C806BEC0579F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1ADC87D1-8963-4100-845A-18477824718E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Debug|ARM.ActiveCfg = Debug|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Debug|ARM.Build.0 = Debug|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Debug|ARM64.Build.0 = Debug|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Debug|x64.ActiveCfg = Debug|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Debug|x64.Build.0 = Debug|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Debug|x86.ActiveCfg = Debug|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Debug|x86.Build.0 = Debug|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Release|Any CPU.Build.0 = Release|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Release|ARM.ActiveCfg = Release|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Release|ARM.Build.0 = Release|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Release|ARM64.ActiveCfg = Release|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Release|ARM64.Build.0 = Release|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Release|x64.ActiveCfg = Release|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Release|x64.Build.0 = Release|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Release|x86.ActiveCfg = Release|Any CPU + {1ADC87D1-8963-4100-845A-18477824718E}.Release|x86.Build.0 = Release|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Debug|ARM.ActiveCfg = Debug|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Debug|ARM.Build.0 = Debug|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Debug|ARM64.Build.0 = Debug|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Debug|x64.ActiveCfg = Debug|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Debug|x64.Build.0 = Debug|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Debug|x86.ActiveCfg = Debug|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Debug|x86.Build.0 = Debug|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Release|Any CPU.Build.0 = Release|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Release|ARM.ActiveCfg = Release|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Release|ARM.Build.0 = Release|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Release|ARM64.ActiveCfg = Release|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Release|ARM64.Build.0 = Release|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Release|x64.ActiveCfg = Release|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Release|x64.Build.0 = Release|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Release|x86.ActiveCfg = Release|Any CPU + {3EC786F3-9B6B-4714-B092-59B4A844D884}.Release|x86.Build.0 = Release|Any CPU + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|ARM.ActiveCfg = Debug|ARM + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|ARM.Build.0 = Debug|ARM + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|ARM.Deploy.0 = Debug|ARM + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|ARM64.Build.0 = Debug|ARM64 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|x64.ActiveCfg = Debug|x64 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|x64.Build.0 = Debug|x64 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|x64.Deploy.0 = Debug|x64 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|x86.ActiveCfg = Debug|x86 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|x86.Build.0 = Debug|x86 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Debug|x86.Deploy.0 = Debug|x86 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|Any CPU.Build.0 = Release|Any CPU + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|Any CPU.Deploy.0 = Release|Any CPU + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|ARM.ActiveCfg = Release|ARM + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|ARM.Build.0 = Release|ARM + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|ARM.Deploy.0 = Release|ARM + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|ARM64.ActiveCfg = Release|ARM64 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|ARM64.Build.0 = Release|ARM64 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|ARM64.Deploy.0 = Release|ARM64 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|x64.ActiveCfg = Release|x64 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|x64.Build.0 = Release|x64 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|x64.Deploy.0 = Release|x64 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|x86.ActiveCfg = Release|x86 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|x86.Build.0 = Release|x86 + {50C713C3-555E-491F-87EE-C806BEC0579F}.Release|x86.Deploy.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {1ADC87D1-8963-4100-845A-18477824718E} = {BA330FCF-7C4C-4B06-A124-C33BB701B174} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {234CB3F9-5ADC-433F-BDBD-CB8EA59EB518} + EndGlobalSection +EndGlobal diff --git a/src/Wpf.Ui.Gallery/App.xaml b/src/Wpf.Ui.Gallery/App.xaml new file mode 100644 index 000000000..2360b22bb --- /dev/null +++ b/src/Wpf.Ui.Gallery/App.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/src/Wpf.Ui.Gallery/App.xaml.cs b/src/Wpf.Ui.Gallery/App.xaml.cs new file mode 100644 index 000000000..4056b4254 --- /dev/null +++ b/src/Wpf.Ui.Gallery/App.xaml.cs @@ -0,0 +1,196 @@ +// 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. + +using System.IO; +using System.Reflection; +using System.Windows; +using System.Windows.Threading; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Wpf.Ui.Gallery.Services; +using Wpf.Ui.Gallery.Services.Contracts; +using Wpf.Ui.Gallery.ViewModels.Pages; +using Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; +using Wpf.Ui.Gallery.ViewModels.Pages.DialogsAndFlyouts; +using Wpf.Ui.Gallery.ViewModels.Pages.Icons; +using Wpf.Ui.Gallery.ViewModels.Pages.Media; +using Wpf.Ui.Gallery.ViewModels.Pages.Navigation; +using Wpf.Ui.Gallery.ViewModels.Pages.StatusAndInfo; +using Wpf.Ui.Gallery.ViewModels.Pages.Text; +using Wpf.Ui.Gallery.ViewModels.Windows; +using Wpf.Ui.Gallery.Views; +using Wpf.Ui.Gallery.Views.Pages; +using Wpf.Ui.Gallery.Views.Pages.BasicInput; +using Wpf.Ui.Gallery.Views.Pages.DialogsAndFlyouts; +using Wpf.Ui.Gallery.Views.Pages.Icons; +using Wpf.Ui.Gallery.Views.Pages.Media; +using Wpf.Ui.Gallery.Views.Pages.Navigation; +using Wpf.Ui.Gallery.Views.Pages.StatusAndInfo; +using Wpf.Ui.Gallery.Views.Pages.Text; +using Wpf.Ui.Mvvm.Contracts; +using Wpf.Ui.Mvvm.Services; + +namespace Wpf.Ui.Gallery; + +/// +/// Interaction logic for App.xaml +/// +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 + private static readonly IHost _host = Host + .CreateDefaultBuilder() + .ConfigureAppConfiguration(c => { c.SetBasePath(Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)); }) + .ConfigureServices((context, services) => + { + // App Host + services.AddHostedService(); + + // Main window container with navigation + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + + // Top-level pages + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + + // Basic Input + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + + // Dialogs and Flyouts + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + + // Web View + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + + // Navigation + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + + // Status and Info + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + + // Text + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + + // Icons + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + }).Build(); + + /// + /// Gets registered service. + /// + /// Type of the service to get. + /// Instance of the service or . + public static T GetService() + where T : class + { + return _host.Services.GetService(typeof(T)) as T; + } + + /// + /// Occurs when the application is loading. + /// + private async void OnStartup(object sender, StartupEventArgs e) + { + await _host.StartAsync(); + } + + /// + /// Occurs when the application is closing. + /// + private async void OnExit(object sender, ExitEventArgs e) + { + await _host.StopAsync(); + + _host.Dispose(); + } + + /// + /// Occurs when an exception is thrown by an application but not handled. + /// + private void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) + { + // For more info see https://docs.microsoft.com/en-us/dotnet/api/system.windows.application.dispatcherunhandledexception?view=windowsdesktop-6.0 + } +} diff --git a/src/Wpf.Ui.Gallery/AssemblyInfo.cs b/src/Wpf.Ui.Gallery/AssemblyInfo.cs new file mode 100644 index 000000000..8929f769c --- /dev/null +++ b/src/Wpf.Ui.Gallery/AssemblyInfo.cs @@ -0,0 +1,15 @@ +// 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. + +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/src/Wpf.Ui.Gallery/Assets/geo_icons.png b/src/Wpf.Ui.Gallery/Assets/geo_icons.png new file mode 100644 index 000000000..3933b4dd6 Binary files /dev/null and b/src/Wpf.Ui.Gallery/Assets/geo_icons.png differ diff --git a/src/Wpf.Ui.Gallery/Assets/octonaut.jpg b/src/Wpf.Ui.Gallery/Assets/octonaut.jpg new file mode 100644 index 000000000..004178bd0 Binary files /dev/null and b/src/Wpf.Ui.Gallery/Assets/octonaut.jpg differ diff --git a/src/Wpf.Ui.Gallery/Assets/pexels-johannes-plenio-1103970.jpg b/src/Wpf.Ui.Gallery/Assets/pexels-johannes-plenio-1103970.jpg new file mode 100644 index 000000000..e2a5e7b26 Binary files /dev/null and b/src/Wpf.Ui.Gallery/Assets/pexels-johannes-plenio-1103970.jpg differ diff --git a/src/Wpf.Ui.Gallery/Assets/wpfui.png b/src/Wpf.Ui.Gallery/Assets/wpfui.png new file mode 100644 index 000000000..b70c4ed59 Binary files /dev/null and b/src/Wpf.Ui.Gallery/Assets/wpfui.png differ diff --git a/src/Wpf.Ui.Gallery/Assets/wpfui_full.png b/src/Wpf.Ui.Gallery/Assets/wpfui_full.png new file mode 100644 index 000000000..2d54bb353 Binary files /dev/null and b/src/Wpf.Ui.Gallery/Assets/wpfui_full.png differ diff --git a/src/Wpf.Ui.Gallery/Controls/ControlPresenterUserControl.xaml b/src/Wpf.Ui.Gallery/Controls/ControlPresenterUserControl.xaml new file mode 100644 index 000000000..3f861c3b3 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Controls/ControlPresenterUserControl.xaml @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/src/Wpf.Ui.Gallery/Controls/ControlPresenterUserControl.xaml.cs b/src/Wpf.Ui.Gallery/Controls/ControlPresenterUserControl.xaml.cs new file mode 100644 index 000000000..2c40a8994 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Controls/ControlPresenterUserControl.xaml.cs @@ -0,0 +1,49 @@ +// 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. + +using System; +using System.Windows; + +namespace Wpf.Ui.Gallery.Controls; + +public partial class ControlPresenterUserControl +{ + public static readonly DependencyProperty ControlContentProperty = + DependencyProperty.Register( + nameof(ControlContent), typeof(object), typeof(ControlPresenterUserControl), + new FrameworkPropertyMetadata(null!)); + + public static readonly DependencyProperty HeaderTextProperty = + DependencyProperty.Register( + nameof(HeaderText), typeof(string), typeof(ControlPresenterUserControl), + new FrameworkPropertyMetadata(String.Empty)); + + public static readonly DependencyProperty CodeTextProperty = + DependencyProperty.Register( + nameof(CodeText), typeof(string), typeof(ControlPresenterUserControl), + new FrameworkPropertyMetadata(String.Empty)); + public object ControlContent + { + get => GetValue(ControlContentProperty); + set => SetValue(ControlContentProperty, value); + } + + public string HeaderText + { + get => (string)GetValue(HeaderTextProperty); + set => SetValue(HeaderTextProperty, value); + } + + public string CodeText + { + get => (string)GetValue(HeaderTextProperty); + set => SetValue(HeaderTextProperty, value); + } + + public ControlPresenterUserControl() + { + InitializeComponent(); + } +} diff --git a/src/Wpf.Ui.Gallery/Controls/ControlSummaryUserControl.xaml b/src/Wpf.Ui.Gallery/Controls/ControlSummaryUserControl.xaml new file mode 100644 index 000000000..242fba1d0 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Controls/ControlSummaryUserControl.xaml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Wpf.Ui.Gallery/Controls/ControlSummaryUserControl.xaml.cs b/src/Wpf.Ui.Gallery/Controls/ControlSummaryUserControl.xaml.cs new file mode 100644 index 000000000..d42a336e8 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Controls/ControlSummaryUserControl.xaml.cs @@ -0,0 +1,39 @@ +// 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. + +using System; +using System.Windows; + +namespace Wpf.Ui.Gallery.Controls; + +public partial class ControlSummaryUserControl +{ + public static readonly DependencyProperty XamlUrlProperty = + DependencyProperty.Register( + nameof(XamlUrl), typeof(string), typeof(ControlSummaryUserControl), + new FrameworkPropertyMetadata(String.Empty)); + + public static readonly DependencyProperty CsharpUrlProperty = + DependencyProperty.Register( + nameof(CsharpUrl), typeof(string), typeof(ControlSummaryUserControl), + new FrameworkPropertyMetadata(String.Empty)); + + public string XamlUrl + { + get => (string)GetValue(XamlUrlProperty); + set => SetValue(XamlUrlProperty, value); + } + + public string CsharpUrl + { + get => (string)GetValue(CsharpUrlProperty); + set => SetValue(CsharpUrlProperty, value); + } + + public ControlSummaryUserControl() + { + InitializeComponent(); + } +} diff --git a/src/Wpf.Ui.Gallery/Helpers/EnumToBooleanConverter.cs b/src/Wpf.Ui.Gallery/Helpers/EnumToBooleanConverter.cs new file mode 100644 index 000000000..9ac653240 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Helpers/EnumToBooleanConverter.cs @@ -0,0 +1,34 @@ +// 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. + +using System; +using System.Globalization; +using System.Windows.Data; + +namespace Wpf.Ui.Gallery.Helpers; + +internal class EnumToBooleanConverter : IValueConverter +{ + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (parameter is not String enumString) + throw new ArgumentException("ExceptionEnumToBooleanConverterParameterMustBeAnEnumName"); + + if (!Enum.IsDefined(typeof(Wpf.Ui.Appearance.ThemeType), value)) + throw new ArgumentException("ExceptionEnumToBooleanConverterValueMustBeAnEnum"); + + var enumValue = Enum.Parse(typeof(Wpf.Ui.Appearance.ThemeType), enumString); + + return enumValue.Equals(value); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + if (parameter is not String enumString) + throw new ArgumentException("ExceptionEnumToBooleanConverterParameterMustBeAnEnumName"); + + return Enum.Parse(typeof(Wpf.Ui.Appearance.ThemeType), enumString); + } +} diff --git a/src/Wpf.Ui.Gallery/Helpers/NameToPageTypeConverter.cs b/src/Wpf.Ui.Gallery/Helpers/NameToPageTypeConverter.cs new file mode 100644 index 000000000..508db7145 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Helpers/NameToPageTypeConverter.cs @@ -0,0 +1,26 @@ +// 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. + +using System; +using System.Linq; +using System.Reflection; + +namespace Wpf.Ui.Gallery.Helpers; + +internal class NameToPageTypeConverter +{ + private static readonly Type[] PageTypes = Assembly + .GetExecutingAssembly() + .GetTypes() + .Where(t => t.Namespace?.StartsWith("Wpf.Ui.Gallery.Views.Pages") ?? false) + .ToArray(); + + public static Type? Convert(string pageName) + { + pageName = pageName.Trim().ToLower() + "page"; + + return PageTypes.FirstOrDefault(singlePageType => singlePageType.Name.ToLower() == pageName); + } +} diff --git a/src/Wpf.Ui.Gallery/License - Images.txt b/src/Wpf.Ui.Gallery/License - Images.txt new file mode 100644 index 000000000..06ac71a16 --- /dev/null +++ b/src/Wpf.Ui.Gallery/License - Images.txt @@ -0,0 +1,5 @@ +pexels-johannes-plenio-1103970.jpg - Johannes Plenio 2018 +https://www.pexels.com/photo/gray-and-white-wallpaper-1103970/ + +octonoaut.jpg - Cameron McEfee +https://octodex.github.com/ \ No newline at end of file diff --git a/src/Wpf.Ui.Gallery/Models/DisplayableIcon.cs b/src/Wpf.Ui.Gallery/Models/DisplayableIcon.cs new file mode 100644 index 000000000..a5ba2c0de --- /dev/null +++ b/src/Wpf.Ui.Gallery/Models/DisplayableIcon.cs @@ -0,0 +1,19 @@ +// 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.Models; + +public struct DisplayableIcon +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string Code { get; set; } + + public string Symbol { get; set; } + + public Wpf.Ui.Common.SymbolRegular Icon { get; set; } +} diff --git a/src/Wpf.Ui.Gallery/Models/NavigationCard.cs b/src/Wpf.Ui.Gallery/Models/NavigationCard.cs new file mode 100644 index 000000000..93924d4b0 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Models/NavigationCard.cs @@ -0,0 +1,20 @@ +// 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. + +using System; +using Wpf.Ui.Common; + +namespace Wpf.Ui.Gallery.Models; + +public class NavigationCard +{ + public string Name { get; set; } = String.Empty; + + public SymbolRegular Icon { get; set; } = SymbolRegular.Empty; + + public string Description { get; set; } = String.Empty; + + public string Link { get; set; } = String.Empty; +} diff --git a/src/Wpf.Ui.Gallery/Services/ApplicationHostService.cs b/src/Wpf.Ui.Gallery/Services/ApplicationHostService.cs new file mode 100644 index 000000000..4280fe54f --- /dev/null +++ b/src/Wpf.Ui.Gallery/Services/ApplicationHostService.cs @@ -0,0 +1,63 @@ +// 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. + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using Microsoft.Extensions.Hosting; +using Wpf.Ui.Gallery.Services.Contracts; +using Wpf.Ui.Gallery.Views; + +namespace Wpf.Ui.Gallery.Services; + +/// +/// Managed host of the application. +/// +public class ApplicationHostService : IHostedService +{ + private readonly IServiceProvider _serviceProvider; + + public ApplicationHostService(IServiceProvider serviceProvider) + { + // If you want, you can do something with these services at the beginning of loading the application. + _serviceProvider = serviceProvider; + } + + /// + /// Triggered when the application host is ready to start the service. + /// + /// Indicates that the start process has been aborted. + public async Task StartAsync(CancellationToken cancellationToken) + { + await HandleActivationAsync(); + } + + /// + /// Triggered when the application host is performing a graceful shutdown. + /// + /// Indicates that the shutdown process should no longer be graceful. + public async Task StopAsync(CancellationToken cancellationToken) + { + await Task.CompletedTask; + } + + /// + /// Creates main window during activation. + /// + private async Task HandleActivationAsync() + { + await Task.CompletedTask; + + if (!Application.Current.Windows.OfType().Any()) + { + var mainWindow = _serviceProvider.GetService(typeof(IWindow)) as IWindow; + mainWindow?.Show(); + } + + await Task.CompletedTask; + } +} diff --git a/src/Wpf.Ui.Gallery/Services/Contracts/IWindow.cs b/src/Wpf.Ui.Gallery/Services/Contracts/IWindow.cs new file mode 100644 index 000000000..8ae7845f6 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Services/Contracts/IWindow.cs @@ -0,0 +1,11 @@ +// 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.Services.Contracts; + +public interface IWindow +{ + void Show(); +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/AllControlsViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/AllControlsViewModel.cs new file mode 100644 index 000000000..2268e2fe7 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/AllControlsViewModel.cs @@ -0,0 +1,87 @@ +// 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. + +using System.Collections.Generic; +using System.Collections.ObjectModel; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Wpf.Ui.Common; +using Wpf.Ui.Gallery.Helpers; +using Wpf.Ui.Gallery.Models; +using Wpf.Ui.Mvvm.Contracts; + +namespace Wpf.Ui.Gallery.ViewModels.Pages; + +public partial class AllControlsViewModel : ObservableObject +{ + private readonly INavigationService _navigationService; + + [ObservableProperty] + private ICollection _navigationCards; + + public AllControlsViewModel(INavigationService navigationService) + { + _navigationService = navigationService; + + NavigationCards = new ObservableCollection + { + new() + { + Name = "Anchor", + Icon = SymbolRegular.Link24, + Description = "Anchor", + Link = "Anchor" + }, + new() + { + Name = "Button", + Icon = SymbolRegular.Link24, + Description = "Button", + Link = "Button" + }, + new() + { + Name = "Hyperlink", + Icon = SymbolRegular.Link24, + Description = "Hyperlink", + Link = "Hyperlink" + }, + new() + { + Name = "ToggleButton", + Icon = SymbolRegular.Link24, + Description = "ToggleButton", + Link = "ToggleButton" + }, + new() + { + Name = "ToggleSwitch", + Icon = SymbolRegular.Link24, + Description = "ToggleSwitch", + Link = "ToggleSwitch" + }, + new() + { + Name = "CheckBox", + Icon = SymbolRegular.Link24, + Description = "CheckBox", + Link = "CheckBox" + } + }; + } + + [RelayCommand] + private void OnNavigatedTo(string parameter) + { + var pageType = NameToPageTypeConverter.Convert(parameter); + + if (pageType != null) + _navigationService.Navigate(pageType); + +#if DEBUG + System.Diagnostics.Debug.WriteLine($"INFO | {nameof(AllControlsViewModel)} navigated, {parameter} ({pageType})", "Wpf.Ui.Gallery"); +#endif + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/AnchorViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/AnchorViewModel.cs new file mode 100644 index 000000000..b20d05d43 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/AnchorViewModel.cs @@ -0,0 +1,26 @@ +// 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. + +using System.Windows.Controls; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +public partial class AnchorViewModel : ObservableObject +{ + [ObservableProperty] + private bool _isAnchorEnabled = true; + + + [RelayCommand] + private void OnAnchorCheckboxChecked(object sender) + { + if (sender is not CheckBox checkbox) + return; + + IsAnchorEnabled = !(checkbox?.IsChecked ?? false); + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/BasicInputViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/BasicInputViewModel.cs new file mode 100644 index 000000000..f6c8f1698 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/BasicInputViewModel.cs @@ -0,0 +1,87 @@ +// 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. + +using System.Collections.Generic; +using System.Collections.ObjectModel; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Wpf.Ui.Common; +using Wpf.Ui.Gallery.Helpers; +using Wpf.Ui.Gallery.Models; +using Wpf.Ui.Mvvm.Contracts; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +public partial class BasicInputViewModel : ObservableObject +{ + private readonly INavigationService _navigationService; + + [ObservableProperty] + private ICollection _navigationCards; + + public BasicInputViewModel(INavigationService navigationService) + { + _navigationService = navigationService; + + NavigationCards = new ObservableCollection + { + new() + { + Name = "Anchor", + Icon = SymbolRegular.Link24, + Description = "Anchor", + Link = "Anchor" + }, + new() + { + Name = "Button", + Icon = SymbolRegular.Link24, + Description = "Button", + Link = "Button" + }, + new() + { + Name = "Hyperlink", + Icon = SymbolRegular.Link24, + Description = "Hyperlink", + Link = "Hyperlink" + }, + new() + { + Name = "ToggleButton", + Icon = SymbolRegular.Link24, + Description = "ToggleButton", + Link = "ToggleButton" + }, + new() + { + Name = "ToggleSwitch", + Icon = SymbolRegular.Link24, + Description = "ToggleSwitch", + Link = "ToggleSwitch" + }, + new() + { + Name = "CheckBox", + Icon = SymbolRegular.Link24, + Description = "CheckBox", + Link = "CheckBox" + } + }; + } + + [RelayCommand] + private void OnNavigatedTo(string parameter) + { + var pageType = NameToPageTypeConverter.Convert(parameter); + + if (pageType != null) + _navigationService.Navigate(pageType); + +#if DEBUG + System.Diagnostics.Debug.WriteLine($"INFO | {nameof(BasicInputViewModel)} navigated, {parameter} ({pageType})", "Wpf.Ui.Gallery"); +#endif + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ButtonViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ButtonViewModel.cs new file mode 100644 index 000000000..f4b71235a --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ButtonViewModel.cs @@ -0,0 +1,37 @@ +// 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. + +using System.Windows.Controls; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +public partial class ButtonViewModel : ObservableObject +{ + [ObservableProperty] + private bool _isSimpleButtonEnabled = true; + + [ObservableProperty] + private bool _isUiButtonEnabled = true; + + [RelayCommand] + private void OnSimpleButtonCheckboxChecked(object sender) + { + if (sender is not CheckBox checkbox) + return; + + IsSimpleButtonEnabled = !(checkbox?.IsChecked ?? false); + } + + [RelayCommand] + private void OnUiButtonCheckboxChecked(object sender) + { + if (sender is not CheckBox checkbox) + return; + + IsUiButtonEnabled = !(checkbox?.IsChecked ?? false); + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/CheckBoxViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/CheckBoxViewModel.cs new file mode 100644 index 000000000..45436141e --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/CheckBoxViewModel.cs @@ -0,0 +1,61 @@ +// 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. + +using System.Windows.Controls; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +public partial class CheckBoxViewModel : ObservableObject +{ + [ObservableProperty] + private bool? _selectAllCheckBoxChecked = null; + + [ObservableProperty] + private bool _optionOneCheckBoxChecked = false; + + [ObservableProperty] + private bool _optionTwoCheckBoxChecked = true; + + [ObservableProperty] + private bool _optionThreeCheckBoxChecked = false; + + [RelayCommand] + private void OnSelectAllChecked(object sender) + { + if (sender is not CheckBox checkBox) + return; + + if (checkBox.IsChecked == null) + checkBox.IsChecked = !(OptionOneCheckBoxChecked && + OptionTwoCheckBoxChecked && + OptionThreeCheckBoxChecked); + + if (checkBox.IsChecked == true) + { + OptionOneCheckBoxChecked = true; + OptionTwoCheckBoxChecked = true; + OptionThreeCheckBoxChecked = true; + } + else if (checkBox.IsChecked == false) + { + OptionOneCheckBoxChecked = false; + OptionTwoCheckBoxChecked = false; + OptionThreeCheckBoxChecked = false; + } + } + + [RelayCommand] + private void OnSingleChecked(string option) + { + if (OptionOneCheckBoxChecked && OptionTwoCheckBoxChecked && OptionThreeCheckBoxChecked) + SelectAllCheckBoxChecked = true; + else if (!OptionOneCheckBoxChecked && !OptionTwoCheckBoxChecked && !OptionThreeCheckBoxChecked) + SelectAllCheckBoxChecked = false; + else + SelectAllCheckBoxChecked = null; + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ComboBoxViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ComboBoxViewModel.cs new file mode 100644 index 000000000..fa6027806 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ComboBoxViewModel.cs @@ -0,0 +1,48 @@ +// 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. + +using System.Collections.Generic; +using System.Collections.ObjectModel; +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +public partial class ComboBoxViewModel : ObservableObject +{ + [ObservableProperty] + private IList _comboBoxFontFamilies; + + [ObservableProperty] + private IList _comboBoxFontSizes; + + public ComboBoxViewModel() + { + ComboBoxFontFamilies = new ObservableCollection + { + "Arial", + "Comic Sans MS", + "Segoe UI", + "Times New Roman" + }; + + ComboBoxFontSizes = new ObservableCollection + { + 8, + 9, + 10, + 11, + 12, + 14, + 16, + 18, + 20, + 24, + 28, + 36, + 48, + 72 + }; + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/HyperlinkViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/HyperlinkViewModel.cs new file mode 100644 index 000000000..c7169c5d2 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/HyperlinkViewModel.cs @@ -0,0 +1,26 @@ +// 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. + +using System.Windows.Controls; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +public partial class HyperlinkViewModel : ObservableObject +{ + [ObservableProperty] + private bool _isHyperlinkEnabled = true; + + + [RelayCommand] + private void OnHyperlinkCheckboxChecked(object sender) + { + if (sender is not CheckBox checkbox) + return; + + IsHyperlinkEnabled = !(checkbox?.IsChecked ?? false); + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/RadioButtonViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/RadioButtonViewModel.cs new file mode 100644 index 000000000..c3b3545fb --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/RadioButtonViewModel.cs @@ -0,0 +1,25 @@ +// 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. + +using System.Windows.Controls; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +public partial class RadioButtonViewModel : ObservableObject +{ + [ObservableProperty] + private bool _isRadioButtonEnabled = true; + + [RelayCommand] + private void OnRadioButtonCheckboxChecked(object sender) + { + if (sender is not CheckBox checkbox) + return; + + IsRadioButtonEnabled = !(checkbox?.IsChecked ?? false); + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/RatingViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/RatingViewModel.cs new file mode 100644 index 000000000..fc39b7be2 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/RatingViewModel.cs @@ -0,0 +1,25 @@ +// 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. + +using System.Windows.Controls; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +public partial class RatingViewModel : ObservableObject +{ + [ObservableProperty] + private bool _isRatingEnabled = true; + + [RelayCommand] + private void OnRatingCheckboxChecked(object sender) + { + if (sender is not CheckBox checkbox) + return; + + IsRatingEnabled = !(checkbox?.IsChecked ?? false); + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/SliderViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/SliderViewModel.cs new file mode 100644 index 000000000..de2618698 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/SliderViewModel.cs @@ -0,0 +1,23 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +public partial class SliderViewModel : ObservableObject +{ + [ObservableProperty] + private int _simpleSliderValue = 0; + + [ObservableProperty] + private int _rangeSliderValue = 500; + + [ObservableProperty] + private int _marksSliderValue = 0; + + [ObservableProperty] + private int _verticalSliderValue = 0; +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ThumbRateViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ThumbRateViewModel.cs new file mode 100644 index 000000000..00b2b0e61 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ThumbRateViewModel.cs @@ -0,0 +1,15 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; +using Wpf.Ui.Controls.States; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +public partial class ThumbRateViewModel : ObservableObject +{ + [ObservableProperty] private ThumbRateState _thumbRateState = ThumbRateState.Liked; + +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ToggleButtonViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ToggleButtonViewModel.cs new file mode 100644 index 000000000..139a0e382 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ToggleButtonViewModel.cs @@ -0,0 +1,26 @@ +// 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. + +using System.Windows.Controls; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +public partial class ToggleButtonViewModel : ObservableObject +{ + [ObservableProperty] + private bool _isToggleButtonEnabled = true; + + + [RelayCommand] + private void OnToggleButtonCheckboxChecked(object sender) + { + if (sender is not CheckBox checkbox) + return; + + IsToggleButtonEnabled = !(checkbox?.IsChecked ?? false); + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ToggleSwitchViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ToggleSwitchViewModel.cs new file mode 100644 index 000000000..886f00424 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ToggleSwitchViewModel.cs @@ -0,0 +1,26 @@ +// 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. + +using System.Windows.Controls; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +public partial class ToggleSwitchViewModel : ObservableObject +{ + [ObservableProperty] + private bool _isToggleSwitchEnabled = true; + + + [RelayCommand] + private void OnToggleSwitchCheckboxChecked(object sender) + { + if (sender is not CheckBox checkbox) + return; + + IsToggleSwitchEnabled = !(checkbox?.IsChecked ?? false); + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/DashboardViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/DashboardViewModel.cs new file mode 100644 index 000000000..ad8f843f4 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/DashboardViewModel.cs @@ -0,0 +1,52 @@ +// 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. + +using System.Collections.Generic; +using System.Collections.ObjectModel; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Wpf.Ui.Common; +using Wpf.Ui.Gallery.Helpers; +using Wpf.Ui.Gallery.Models; +using Wpf.Ui.Mvvm.Contracts; + +namespace Wpf.Ui.Gallery.ViewModels.Pages; + +public partial class DashboardViewModel : ObservableObject +{ + private readonly INavigationService _navigationService; + + [ObservableProperty] + private ICollection _navigationCards; + + public DashboardViewModel(INavigationService navigationService) + { + _navigationService = navigationService; + + NavigationCards = new ObservableCollection + { + new() + { + Name = "Basic Input", + Icon = SymbolRegular.TextParagraph24, + Description = "Buttons and stuff", + Link = "BasicInput" + } + }; + } + + [RelayCommand] + private void OnNavigatedTo(string parameter) + { + var pageType = NameToPageTypeConverter.Convert(parameter); + + if (pageType != null) + _navigationService.Navigate(pageType); + +#if DEBUG + System.Diagnostics.Debug.WriteLine($"INFO | {nameof(DashboardViewModel)} navigated, {parameter} ({pageType})", "Wpf.Ui.Gallery"); +#endif + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/DialogViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/DialogViewModel.cs new file mode 100644 index 000000000..b4c1f890d --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/DialogViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.DialogsAndFlyouts; + +public partial class DialogViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/DialogsAndFlyoutsViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/DialogsAndFlyoutsViewModel.cs new file mode 100644 index 000000000..b42d2fd27 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/DialogsAndFlyoutsViewModel.cs @@ -0,0 +1,73 @@ +// 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. + +using System.Collections.Generic; +using System.Collections.ObjectModel; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Wpf.Ui.Common; +using Wpf.Ui.Gallery.Helpers; +using Wpf.Ui.Gallery.Models; +using Wpf.Ui.Mvvm.Contracts; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.DialogsAndFlyouts; + +public partial class DialogsAndFlyoutsViewModel : ObservableObject +{ + private readonly INavigationService _navigationService; + + [ObservableProperty] + private ICollection _navigationCards; + + public DialogsAndFlyoutsViewModel(INavigationService navigationService) + { + _navigationService = navigationService; + + NavigationCards = new ObservableCollection + { + new() + { + Name = "Snackbar", + Icon = SymbolRegular.Navigation24, + Description = "Snackbar", + Link = "Snackbar" + }, + new() + { + Name = "Dialog", + Icon = SymbolRegular.NavigationUnread24, + Description = "Dialog", + Link = "Dialog" + }, + new() + { + Name = "Flyout", + Icon = SymbolRegular.Navigation24, + Description = "Flyout", + Link = "Flyout" + }, + new() + { + Name = "MessageBox", + Icon = SymbolRegular.Navigation24, + Description = "MessageBox", + Link = "MessageBox" + } + }; + } + + [RelayCommand] + private void OnNavigatedTo(string parameter) + { + var pageType = NameToPageTypeConverter.Convert(parameter); + + if (pageType != null) + _navigationService.Navigate(pageType); + +#if DEBUG + System.Diagnostics.Debug.WriteLine($"INFO | {nameof(DialogsAndFlyoutsViewModel)} navigated, {parameter} ({pageType})", "Wpf.Ui.Gallery"); +#endif + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/FlyoutViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/FlyoutViewModel.cs new file mode 100644 index 000000000..15e984e76 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/FlyoutViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.DialogsAndFlyouts; + +public partial class FlyoutViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/MessageBoxViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/MessageBoxViewModel.cs new file mode 100644 index 000000000..b39dfdc83 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/MessageBoxViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.DialogsAndFlyouts; + +public partial class MessageBoxViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/SnackbarViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/SnackbarViewModel.cs new file mode 100644 index 000000000..b907e1e9a --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/SnackbarViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.DialogsAndFlyouts; + +public partial class SnackbarViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Icons/FontIconViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Icons/FontIconViewModel.cs new file mode 100644 index 000000000..22b66e00d --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Icons/FontIconViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Icons; + +public partial class FontIconViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Icons/IconsViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Icons/IconsViewModel.cs new file mode 100644 index 000000000..c9dac6fdc --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Icons/IconsViewModel.cs @@ -0,0 +1,122 @@ +// 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. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Wpf.Ui.Common.Interfaces; +using Wpf.Ui.Gallery.Models; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Icons; + +public partial class IconsViewModel : ObservableObject, INavigationAware +{ + private bool _isInitialized = false; + + private string _autoSuggestBoxText = String.Empty; + + [ObservableProperty] + private ICollection _iconsCollection = new List(); + + [ObservableProperty] + private ICollection _filteredIconsCollection = new DisplayableIcon[] { }; + + [ObservableProperty] + private ICollection _iconNames = new string[] { }; + + public string AutoSuggestBoxText + { + get => _autoSuggestBoxText; + set + { + SetProperty(ref _autoSuggestBoxText, value); + UpdateSearchResults(value); + } + } + + public void OnNavigatedTo() + { + if (!_isInitialized) + InitializeViewModel(); + } + + public void OnNavigatedFrom() + { } + + [RelayCommand] + public void OnIconSelected(int parameter) + { + UpdateSymbolData(parameter); + } + + private void InitializeViewModel() + { + Task.Run(() => + { + var id = 0; + var names = Enum.GetNames(typeof(Common.SymbolRegular)); + var icons = new List(); + + names = names.OrderBy(n => n).ToArray(); + + foreach (string iconName in names) + { + var icon = Common.Glyph.Parse(iconName); + + icons.Add(new DisplayableIcon + { + Id = id++, + Name = iconName, + Icon = icon, + Symbol = ((char)icon).ToString(), + Code = ((int)icon).ToString("X4") + }); + } + + IconsCollection = icons; + FilteredIconsCollection = icons; + IconNames = icons.Select(icon => icon.Name).ToArray(); + + if (icons.Count > 4) + UpdateSymbolData(4); + + _isInitialized = true; + }); + } + + private void UpdateSymbolData(int symbolId) + { + if (IconsCollection.Count - 1 < symbolId) + return; + + //SelectedSymbol = IconsCollection[symbolId].Icon; + //SelectedSymbolCharacter = "\\u" + IconsCollection[symbolId].Code; + //SelectedSymbolName = IconsCollection[symbolId].Name; + //CodeBlock = ""; + } + + private void UpdateSearchResults(string searchedText) + { + Task.Run(() => + { + if (String.IsNullOrEmpty(searchedText)) + { + FilteredIconsCollection = IconsCollection; + + return true; + } + + var formattedText = searchedText.ToLower().Trim(); + + FilteredIconsCollection = IconsCollection + .Where(icon => icon.Name.ToLower().Contains(formattedText)).ToArray(); + + return true; + }); + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Icons/SymbolIconViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Icons/SymbolIconViewModel.cs new file mode 100644 index 000000000..4454821fb --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Icons/SymbolIconViewModel.cs @@ -0,0 +1,25 @@ +// 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. + +using System.Windows.Controls; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Icons; + +public partial class SymbolIconViewModel : ObservableObject +{ + [ObservableProperty] + private bool _isIconFilled = false; + + [RelayCommand] + private void OnCheckboxChecked(object sender) + { + if (sender is not CheckBox checkbox) + return; + + IsIconFilled = checkbox?.IsChecked ?? false; + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Media/MediaViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Media/MediaViewModel.cs new file mode 100644 index 000000000..e67188e01 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Media/MediaViewModel.cs @@ -0,0 +1,52 @@ +// 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. + +using System.Collections.Generic; +using System.Collections.ObjectModel; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Wpf.Ui.Common; +using Wpf.Ui.Gallery.Helpers; +using Wpf.Ui.Gallery.Models; +using Wpf.Ui.Mvvm.Contracts; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Media; + +public partial class MediaViewModel : ObservableObject +{ + private readonly INavigationService _navigationService; + + [ObservableProperty] + private ICollection _navigationCards; + + public MediaViewModel(INavigationService navigationService) + { + _navigationService = navigationService; + + NavigationCards = new ObservableCollection + { + new() + { + Name = "WebView", + Icon = SymbolRegular.BookInformation24, + Description = "WebView", + Link = "WebView" + } + }; + } + + [RelayCommand] + private void OnNavigatedTo(string parameter) + { + var pageType = NameToPageTypeConverter.Convert(parameter); + + if (pageType != null) + _navigationService.Navigate(pageType); + +#if DEBUG + System.Diagnostics.Debug.WriteLine($"INFO | {nameof(MediaViewModel)} navigated, {parameter} ({pageType})", "Wpf.Ui.Gallery"); +#endif + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Media/WebViewViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Media/WebViewViewModel.cs new file mode 100644 index 000000000..d0d239bda --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Media/WebViewViewModel.cs @@ -0,0 +1,13 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Media; + +public partial class WebViewViewModel : ObservableObject +{ +} + diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/NavigationViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/NavigationViewModel.cs new file mode 100644 index 000000000..e49a0f5e6 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/NavigationViewModel.cs @@ -0,0 +1,59 @@ +// 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. + +using System.Collections.Generic; +using System.Collections.ObjectModel; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Wpf.Ui.Common; +using Wpf.Ui.Gallery.Helpers; +using Wpf.Ui.Gallery.Models; +using Wpf.Ui.Mvvm.Contracts; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Navigation; + +public partial class NavigationViewModel : ObservableObject +{ + private readonly INavigationService _navigationService; + + [ObservableProperty] + private ICollection _navigationCards; + + public NavigationViewModel(INavigationService navigationService) + { + _navigationService = navigationService; + + NavigationCards = new ObservableCollection + { + new() + { + Name = "NavigationView", + Icon = SymbolRegular.Navigation24, + Description = "NavigationView", + Link = "NavigationView" + }, + new() + { + Name = "TabControl", + Icon = SymbolRegular.NavigationUnread24, + Description = "TabControl", + Link = "TabControl" + } + }; + } + + [RelayCommand] + private void OnNavigatedTo(string parameter) + { + var pageType = NameToPageTypeConverter.Convert(parameter); + + if (pageType != null) + _navigationService.Navigate(pageType); + +#if DEBUG + System.Diagnostics.Debug.WriteLine($"INFO | {nameof(NavigationViewModel)} navigated, {parameter} ({pageType})", "Wpf.Ui.Gallery"); +#endif + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/NavigationViewViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/NavigationViewViewModel.cs new file mode 100644 index 000000000..0276da911 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/NavigationViewViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Navigation; + +public partial class NavigationViewViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/TabControlViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/TabControlViewModel.cs new file mode 100644 index 000000000..596072df6 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/TabControlViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Navigation; + +public partial class TabControlViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/SettingsViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/SettingsViewModel.cs new file mode 100644 index 000000000..f3a41c58e --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/SettingsViewModel.cs @@ -0,0 +1,81 @@ +// 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. + +using System; +using System.Windows.Media; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Wpf.Ui.Appearance; +using Wpf.Ui.Common.Interfaces; + +namespace Wpf.Ui.Gallery.ViewModels.Pages; + +public partial class SettingsViewModel : ObservableObject, INavigationAware +{ + private bool _isInitialized = false; + + [ObservableProperty] + private string _appVersion = String.Empty; + + [ObservableProperty] + private Wpf.Ui.Appearance.ThemeType _currentTheme = Wpf.Ui.Appearance.ThemeType.Unknown; + + public void OnNavigatedTo() + { + if (!_isInitialized) + InitializeViewModel(); + } + + public void OnNavigatedFrom() + { + } + + private void InitializeViewModel() + { + CurrentTheme = Wpf.Ui.Appearance.Theme.GetAppTheme(); + AppVersion = $"WPF UI Gallery - {GetAssemblyVersion()}"; + + Wpf.Ui.Appearance.Theme.Changed += OnThemeChanged; + + _isInitialized = true; + } + + private void OnThemeChanged(ThemeType currentTheme, Color systemAccent) + { + // Update the theme if it has been changed elsewhere than in the settings. + if (CurrentTheme != currentTheme) + CurrentTheme = currentTheme; + } + + private string GetAssemblyVersion() + { + return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? String.Empty; + } + + [RelayCommand] + private void OnChangeTheme(string parameter) + { + switch (parameter) + { + case "theme_light": + if (CurrentTheme == Wpf.Ui.Appearance.ThemeType.Light) + break; + + Wpf.Ui.Appearance.Theme.Apply(Wpf.Ui.Appearance.ThemeType.Light); + CurrentTheme = Wpf.Ui.Appearance.ThemeType.Light; + + break; + + default: + if (CurrentTheme == Wpf.Ui.Appearance.ThemeType.Dark) + break; + + Wpf.Ui.Appearance.Theme.Apply(Wpf.Ui.Appearance.ThemeType.Dark); + CurrentTheme = Wpf.Ui.Appearance.ThemeType.Dark; + + break; + } + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/InfoBarViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/InfoBarViewModel.cs new file mode 100644 index 000000000..6d2dddf41 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/InfoBarViewModel.cs @@ -0,0 +1,41 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; +using Wpf.Ui.Controls; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.StatusAndInfo; + +public partial class InfoBarViewModel : ObservableObject +{ + [ObservableProperty] + private bool _isInfoBarOpened = true; + + private int _infoBarSeverityComboBoxSelectedIndex = 0; + + [ObservableProperty] + private InfoBarSeverity _infoBarSeverity = InfoBarSeverity.Informational; + + public int InfoBarSeverityComboBoxSelectedIndex + { + get => _infoBarSeverityComboBoxSelectedIndex; + set + { + SetProperty(ref _infoBarSeverityComboBoxSelectedIndex, value); + UpdateSelectedInfoBarSeverity(value); + } + } + + private void UpdateSelectedInfoBarSeverity(int severityIndex) + { + InfoBarSeverity = severityIndex switch + { + 1 => InfoBarSeverity.Success, + 2 => InfoBarSeverity.Warning, + 3 => InfoBarSeverity.Error, + _ => InfoBarSeverity.Informational + }; + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/ProgressBarViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/ProgressBarViewModel.cs new file mode 100644 index 000000000..69bf64859 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/ProgressBarViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.StatusAndInfo; + +public partial class ProgressBarViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/ProgressRingViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/ProgressRingViewModel.cs new file mode 100644 index 000000000..594062926 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/ProgressRingViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.StatusAndInfo; + +public partial class ProgressRingViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/StatusAndInfoViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/StatusAndInfoViewModel.cs new file mode 100644 index 000000000..c9c49a81f --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/StatusAndInfoViewModel.cs @@ -0,0 +1,73 @@ +// 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. + +using System.Collections.Generic; +using System.Collections.ObjectModel; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Wpf.Ui.Common; +using Wpf.Ui.Gallery.Helpers; +using Wpf.Ui.Gallery.Models; +using Wpf.Ui.Mvvm.Contracts; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.StatusAndInfo; + +public partial class StatusAndInfoViewModel : ObservableObject +{ + private readonly INavigationService _navigationService; + + [ObservableProperty] + private ICollection _navigationCards; + + public StatusAndInfoViewModel(INavigationService navigationService) + { + _navigationService = navigationService; + + NavigationCards = new ObservableCollection + { + new() + { + Name = "InfoBar", + Icon = SymbolRegular.BookInformation24, + Description = "InfoBar", + Link = "InfoBar" + }, + new() + { + Name = "ProgressBar", + Icon = SymbolRegular.ArrowDownload24, + Description = "ProgressBar", + Link = "ProgressBar" + }, + new() + { + Name = "ProgressRing", + Icon = SymbolRegular.ArrowClockwise24, + Description = "ProgressRing", + Link = "ProgressRing" + }, + new() + { + Name = "ToolTip", + Icon = SymbolRegular.Chat24, + Description = "ToolTip", + Link = "ToolTip" + } + }; + } + + [RelayCommand] + private void OnNavigatedTo(string parameter) + { + var pageType = NameToPageTypeConverter.Convert(parameter); + + if (pageType != null) + _navigationService.Navigate(pageType); + +#if DEBUG + System.Diagnostics.Debug.WriteLine($"INFO | {nameof(StatusAndInfoViewModel)} navigated, {parameter} ({pageType})", "Wpf.Ui.Gallery"); +#endif + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/ToolTipViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/ToolTipViewModel.cs new file mode 100644 index 000000000..cb3a21309 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/ToolTipViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.StatusAndInfo; + +public partial class ToolTipViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/AutoSuggestBoxViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/AutoSuggestBoxViewModel.cs new file mode 100644 index 000000000..252163918 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/AutoSuggestBoxViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Text; + +public partial class AutoSuggestBoxViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/LabelViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/LabelViewModel.cs new file mode 100644 index 000000000..dd05ba300 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/LabelViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Text; + +public partial class LabelViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/NumberBoxViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/NumberBoxViewModel.cs new file mode 100644 index 000000000..2a71b1a68 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/NumberBoxViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Text; + +public partial class NumberBoxViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/PasswordBoxViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/PasswordBoxViewModel.cs new file mode 100644 index 000000000..9700beaef --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/PasswordBoxViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Text; + +public partial class PasswordBoxViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/RichTextBoxViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/RichTextBoxViewModel.cs new file mode 100644 index 000000000..4dd667087 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/RichTextBoxViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Text; + +public partial class RichTextBoxViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/TextBlockViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/TextBlockViewModel.cs new file mode 100644 index 000000000..0f738d4f0 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/TextBlockViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Text; + +public partial class TextBlockViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/TextBoxViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/TextBoxViewModel.cs new file mode 100644 index 000000000..8cdd0e1b6 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/TextBoxViewModel.cs @@ -0,0 +1,12 @@ +// 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. + +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Text; + +public partial class TextBoxViewModel : ObservableObject +{ +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/TextViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/TextViewModel.cs new file mode 100644 index 000000000..e8200e913 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/TextViewModel.cs @@ -0,0 +1,89 @@ +// 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. + +using System.Collections.Generic; +using System.Collections.ObjectModel; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Wpf.Ui.Common; +using Wpf.Ui.Gallery.Models; +using Wpf.Ui.Mvvm.Contracts; + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Text; + +public partial class TextViewModel : ObservableObject +{ + private readonly INavigationService _navigationService; + + [ObservableProperty] + private ICollection _navigationCards; + + public TextViewModel(INavigationService navigationService) + { + _navigationService = navigationService; + + NavigationCards = new ObservableCollection + { + new() + { + Name = "AutoSuggestBox", + Icon = SymbolRegular.Navigation24, + Description = "AutoSuggestBox", + Link = "AutoSuggestBox" + }, + new() + { + Name = "NumberBox", + Icon = SymbolRegular.NavigationUnread24, + Description = "NumberBox", + Link = "NumberBox" + }, + new() + { + Name = "PasswordBox", + Icon = SymbolRegular.Navigation24, + Description = "PasswordBox", + Link = "PasswordBox" + }, + new() + { + Name = "RichTextBox", + Icon = SymbolRegular.NavigationUnread24, + Description = "RichTextBox", + Link = "RichTextBox" + }, + new() + { + Name = "Label", + Icon = SymbolRegular.Navigation24, + Description = "Label", + Link = "Label" + }, + new() + { + Name = "TextBlock", + Icon = SymbolRegular.NavigationUnread24, + Description = "TextBlock", + Link = "TextBlock" + }, + new() + { + Name = "TextBox", + Icon = SymbolRegular.Navigation24, + Description = "TextBox", + Link = "TextBox" + }, + }; + } + + [RelayCommand] + private void OnNavigatedTo(string parameter) + { +#if DEBUG + System.Diagnostics.Debug.WriteLine($"INFO | Navigate to: {parameter}"); +#endif + _navigationService.Navigate(parameter); + } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Windows/ContainerViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Windows/ContainerViewModel.cs new file mode 100644 index 000000000..3bb8adf57 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Windows/ContainerViewModel.cs @@ -0,0 +1,117 @@ +// 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. + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Windows; +using CommunityToolkit.Mvvm.ComponentModel; +using Wpf.Ui.Common; +using Wpf.Ui.Controls.Navigation; +using Wpf.Ui.Gallery.Views.Pages; +using Wpf.Ui.Gallery.Views.Pages.BasicInput; +using Wpf.Ui.Gallery.Views.Pages.DialogsAndFlyouts; +using Wpf.Ui.Gallery.Views.Pages.Icons; +using Wpf.Ui.Gallery.Views.Pages.Media; +using Wpf.Ui.Gallery.Views.Pages.Navigation; +using Wpf.Ui.Gallery.Views.Pages.StatusAndInfo; +using Wpf.Ui.Gallery.Views.Pages.Text; + +namespace Wpf.Ui.Gallery.ViewModels.Windows; + +public partial class ContainerViewModel : ObservableObject +{ + private readonly IServiceProvider _serviceProvider; + + [ObservableProperty] + private string _applicationTitle; + + [ObservableProperty] private ICollection _menuItems; + + [ObservableProperty] private ICollection _footerMenuItems = new ObservableCollection(); + + public ContainerViewModel(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + + ApplicationTitle = "WPF UI Gallery"; + + MenuItems = new ObservableCollection + { + new NavigationViewItem { Content = "Home", Icon = SymbolRegular.Home24, TargetPageType = typeof(DashboardPage) }, + new NavigationViewItem { Content = "All Controls", Icon = SymbolRegular.List24, TargetPageType = typeof(AllControlsPage) }, + new NavigationViewItemSeparator(), + new NavigationViewItem {Content = "Basic input", Icon = SymbolRegular.CheckboxChecked24, TargetPageType = typeof(BasicInputPage), MenuItems = new ObservableCollection + { + new NavigationViewItem { Content = "Anchor", TargetPageType = typeof(AnchorPage) }, + new NavigationViewItem { Content = "Button", TargetPageType = typeof(ButtonPage) }, + new NavigationViewItem { Content = "Hyperlink", TargetPageType = typeof(HyperlinkPage) }, + new NavigationViewItem { Content = "ToggleButton", TargetPageType = typeof(ToggleButtonPage) }, + new NavigationViewItem { Content = "ToggleSwitch", TargetPageType = typeof(ToggleSwitchPage) }, + new NavigationViewItem { Content = "CheckBox", TargetPageType = typeof(CheckBoxPage) }, + new NavigationViewItem { Content = "ComboBox", TargetPageType = typeof(ComboBoxPage) }, + new NavigationViewItem { Content = "RadioButton", TargetPageType = typeof(RadioButtonPage) }, + new NavigationViewItem { Content = "Rating", TargetPageType = typeof(RatingPage) }, + new NavigationViewItem { Content = "ThumbRate", TargetPageType = typeof(ThumbRatePage) }, + new NavigationViewItem { Content = "Slider", TargetPageType = typeof(SliderPage) }, + }}, + new NavigationViewItem {Content = "Dialogs and Flyouts", Icon = SymbolRegular.Chat24, TargetPageType = typeof(DialogsAndFlyoutsPage), MenuItems = new ObservableCollection + { + new NavigationViewItem { Content = "Snackbar", TargetPageType = typeof(SnackbarPage) }, + new NavigationViewItem { Content = "Dialog", TargetPageType = typeof(DialogPage) }, + new NavigationViewItem { Content = "Flyout", TargetPageType = typeof(FlyoutPage) }, + new NavigationViewItem { Content = "MessageBox", TargetPageType = typeof(MessageBoxPage) }, + }}, + new NavigationViewItem {Content = "Media", Icon = SymbolRegular.PlayCircle24, TargetPageType = typeof(MediaPage), MenuItems = new ObservableCollection + { + new NavigationViewItem { Content = "WebView", TargetPageType = typeof(WebViewPage) }, + }}, + new NavigationViewItem {Content = "Navigation", Icon = SymbolRegular.Navigation24, TargetPageType = typeof(NavigationPage), MenuItems = new ObservableCollection + { + new NavigationViewItem { Content = "NavigationView", TargetPageType = typeof(NavigationViewPage) }, + new NavigationViewItem { Content = "TabControl", TargetPageType = typeof(TabControlPage) }, + }}, + new NavigationViewItem {Content = "Status and Info", Icon = SymbolRegular.ChatBubblesQuestion24, TargetPageType = typeof(StatusAndInfoPage), MenuItems = new ObservableCollection + { + new NavigationViewItem { Content = "InfoBar", TargetPageType = typeof(InfoBarPage) }, + new NavigationViewItem { Content = "ProgressBar", TargetPageType = typeof(ProgressBarPage) }, + new NavigationViewItem { Content = "ProgressRing", TargetPageType = typeof(ProgressRingPage) }, + new NavigationViewItem { Content = "ToolTip", TargetPageType = typeof(ToolTipPage) }, + }}, + new NavigationViewItem {Content = "Text", Icon = SymbolRegular.DrawText24, TargetPageType = typeof(TextPage), MenuItems = new ObservableCollection + { + new NavigationViewItem { Content = "AutoSuggestBox", TargetPageType = typeof(AutoSuggestBoxPage) }, + new NavigationViewItem { Content = "NumberBox", TargetPageType = typeof(NumberBoxPage) }, + new NavigationViewItem { Content = "PasswordBox", TargetPageType = typeof(PasswordBoxPage) }, + new NavigationViewItem { Content = "RichTextBox", TargetPageType = typeof(RichTextBoxPage) }, + new NavigationViewItem { Content = "Label", TargetPageType = typeof(LabelPage) }, + new NavigationViewItem { Content = "TextBlock", TargetPageType = typeof(TextBlockPage) }, + new NavigationViewItem { Content = "TextBox", TargetPageType = typeof(TextBoxPage) }, + }}, + new NavigationViewItem {Content = "Icons", Icon = SymbolRegular.Fluent24, TargetPageType = typeof(IconsPage), MenuItems = new ObservableCollection + { + new NavigationViewItem { Content = "SymbolIcon", TargetPageType = typeof(SymbolIconPage) }, + new NavigationViewItem { Content = "FontIcon", TargetPageType = typeof(FontIconPage) }, + }} + }; + + var toggleThemeNavigationViewItem = new NavigationViewItem + { + Content = "Toggle theme", + Icon = SymbolRegular.PaintBrush24 + }; + toggleThemeNavigationViewItem.Click += OnToggleThemeClicked; + + FooterMenuItems.Add(toggleThemeNavigationViewItem); + FooterMenuItems.Add(new NavigationViewItem { Content = "Settings", Icon = SymbolRegular.Settings24, TargetPageType = typeof(SettingsPage) }); + } + + private void OnToggleThemeClicked(object sender, RoutedEventArgs e) + { + var currentTheme = Wpf.Ui.Appearance.Theme.GetAppTheme(); + + Wpf.Ui.Appearance.Theme.Apply(currentTheme == Wpf.Ui.Appearance.ThemeType.Light ? Wpf.Ui.Appearance.ThemeType.Dark : Wpf.Ui.Appearance.ThemeType.Light); + } +} diff --git a/src/Wpf.Ui.Gallery/Views/ContainerWindow.xaml b/src/Wpf.Ui.Gallery/Views/ContainerWindow.xaml new file mode 100644 index 000000000..4fafd782c --- /dev/null +++ b/src/Wpf.Ui.Gallery/Views/ContainerWindow.xaml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + diff --git a/src/Wpf.Ui.Gallery/Views/ContainerWindow.xaml.cs b/src/Wpf.Ui.Gallery/Views/ContainerWindow.xaml.cs new file mode 100644 index 000000000..605086951 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Views/ContainerWindow.xaml.cs @@ -0,0 +1,46 @@ +// 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. + +using System; +using System.Windows; +using Wpf.Ui.Gallery.Services.Contracts; +using Wpf.Ui.Gallery.ViewModels.Windows; +using Wpf.Ui.Gallery.Views.Pages; +using Wpf.Ui.Mvvm.Contracts; + +namespace Wpf.Ui.Gallery.Views; + +/// +/// Interaction logic for ContainerWindow.xaml +/// +public partial class ContainerWindow : IWindow +{ + public ContainerViewModel ViewModel { get; } + + public ContainerWindow(ContainerViewModel viewModel, INavigationService navigationService, IServiceProvider serviceProvider) + { + Appearance.Watcher.Watch(this); + + DataContext = this; + ViewModel = viewModel; + + InitializeComponent(); + + navigationService.SetNavigationControl(NavigationView); + + NavigationView.SetServiceProvider(serviceProvider); + NavigationView.Loaded += (_, _) => NavigationView.Navigate(typeof(DashboardPage)); + } + + private void OnNavigationSelectionChanged(object sender, RoutedEventArgs e) + { + if (sender is not Wpf.Ui.Controls.Navigation.NavigationView navigationView) + return; + + NavigationView.HeaderVisibility = navigationView.SelectedItem.TargetPageType != typeof(DashboardPage) + ? Visibility.Visible + : Visibility.Collapsed; + } +} diff --git a/src/Wpf.Ui.Gallery/Views/Pages/AllControlsPage.xaml b/src/Wpf.Ui.Gallery/Views/Pages/AllControlsPage.xaml new file mode 100644 index 000000000..49999264f --- /dev/null +++ b/src/Wpf.Ui.Gallery/Views/Pages/AllControlsPage.xaml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Wpf.Ui.Gallery/Views/Pages/AllControlsPage.xaml.cs b/src/Wpf.Ui.Gallery/Views/Pages/AllControlsPage.xaml.cs new file mode 100644 index 000000000..4c80b519c --- /dev/null +++ b/src/Wpf.Ui.Gallery/Views/Pages/AllControlsPage.xaml.cs @@ -0,0 +1,21 @@ +// 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. + +using Wpf.Ui.Common.Interfaces; +using Wpf.Ui.Gallery.ViewModels.Pages; + +namespace Wpf.Ui.Gallery.Views.Pages; + +public partial class AllControlsPage : INavigableView +{ + public AllControlsViewModel ViewModel { get; } + + public AllControlsPage(AllControlsViewModel viewModel) + { + ViewModel = viewModel; + + InitializeComponent(); + } +} diff --git a/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/AnchorPage.xaml b/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/AnchorPage.xaml new file mode 100644 index 000000000..066efe133 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/AnchorPage.xaml @@ -0,0 +1,63 @@ + + + https://github.com/lepoco/wpfui/blob/development/src/Wpf.Ui/Styles/Controls/Anchor.xaml + https://github.com/lepoco/wpfui/blob/development/src/Wpf.Ui/Controls/Anchor.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/AnchorPage.xaml.cs b/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/AnchorPage.xaml.cs new file mode 100644 index 000000000..33b014d73 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/AnchorPage.xaml.cs @@ -0,0 +1,20 @@ +// 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. + +using Wpf.Ui.Common.Interfaces; +using Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +namespace Wpf.Ui.Gallery.Views.Pages.BasicInput; + +public partial class AnchorPage : INavigableView +{ + public AnchorViewModel ViewModel { get; } + + public AnchorPage(AnchorViewModel viewModel) + { + ViewModel = viewModel; + InitializeComponent(); + } +} diff --git a/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/BasicInputPage.xaml b/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/BasicInputPage.xaml new file mode 100644 index 000000000..1a3884cc0 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/BasicInputPage.xaml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/BasicInputPage.xaml.cs b/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/BasicInputPage.xaml.cs new file mode 100644 index 000000000..d11e7fbf8 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/BasicInputPage.xaml.cs @@ -0,0 +1,21 @@ +// 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. + +using Wpf.Ui.Common.Interfaces; +using Wpf.Ui.Gallery.ViewModels.Pages.BasicInput; + +namespace Wpf.Ui.Gallery.Views.Pages.BasicInput; + +public partial class BasicInputPage : INavigableView +{ + public BasicInputViewModel ViewModel { get; } + + public BasicInputPage(BasicInputViewModel viewModel) + { + ViewModel = viewModel; + + InitializeComponent(); + } +} diff --git a/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/ButtonPage.xaml b/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/ButtonPage.xaml new file mode 100644 index 000000000..0f4c42900 --- /dev/null +++ b/src/Wpf.Ui.Gallery/Views/Pages/BasicInput/ButtonPage.xaml @@ -0,0 +1,106 @@ + + + https://github.com/lepoco/wpfui/blob/development/src/Wpf.Ui/Styles/Controls/Button.xaml + https://github.com/lepoco/wpfui/blob/development/src/Wpf.Ui/Controls/Button.cs + + + + + + + + + + + + + + + + + + + + + + + +