未验证 提交 c8cd75f6 编写于 作者: P pomian 提交者: GitHub

Merge pull request #734 from lepoco/development

Merge development branch with 3.0.0-preview.6 update
......@@ -67,7 +67,7 @@ file_header_template = This Source Code Form is subject to the terms of the MIT
# this. and Me. preferences
dotnet_style_qualification_for_event = false:warning
dotnet_style_qualification_for_field = true:warning
dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_property = false:warning
......
......@@ -19,7 +19,7 @@ concurrency:
cancel-in-progress: false
jobs:
deploy_docs:
publish:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
......
......@@ -7,7 +7,7 @@ on:
workflow_dispatch:
jobs:
deploy_extension:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
......
......@@ -7,7 +7,7 @@ on:
workflow_dispatch:
jobs:
deploy_nuget:
deploy:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
......
......@@ -9,15 +9,8 @@ on:
workflow_dispatch:
jobs:
matrix_build:
build:
runs-on: windows-latest
strategy:
matrix:
project:
- Wpf.Ui
- Wpf.Ui.Tray
- Wpf.Ui.ToastNotifications
- Wpf.Ui.Gallery
steps:
- uses: actions/checkout@v3
- uses: microsoft/setup-msbuild@v1.3
......@@ -34,5 +27,5 @@ jobs:
- name: Install dependencies
run: dotnet restore
- name: Build ${{ matrix.project }}
run: dotnet build src\${{ matrix.project }}\${{ matrix.project }}.csproj --configuration Release --no-restore
- name: Build
run: dotnet build src\Wpf.Ui.Gallery\Wpf.Ui.Gallery.csproj --configuration Release --no-restore
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<Version>3.0.0-preview.5</Version>
<Version>3.0.0-preview.6</Version>
<LangVersion>11.0</LangVersion>
<Deterministic>true</Deterministic>
</PropertyGroup>
......
......@@ -4,6 +4,9 @@
"projects": [
"src\\Wpf.Ui.Gallery.Package\\Wpf.Ui.Gallery.Package.wapproj",
"src\\Wpf.Ui.Gallery\\Wpf.Ui.Gallery.csproj",
"src\\Wpf.Ui.SyntaxHighlight\\Wpf.Ui.SyntaxHighlight.csproj",
"src\\Wpf.Ui.ToastNotifications\\Wpf.Ui.ToastNotifications.csproj",
"src\\Wpf.Ui.Tray\\Wpf.Ui.Tray.csproj",
"src\\Wpf.Ui\\Wpf.Ui.csproj"
]
}
......
......@@ -2,6 +2,8 @@
"solution": {
"path": "Wpf.Ui.sln",
"projects": [
"src\\Wpf.Ui.ToastNotifications\\Wpf.Ui.ToastNotifications.csproj",
"src\\Wpf.Ui.Tray\\Wpf.Ui.Tray.csproj",
"src\\Wpf.Ui\\Wpf.Ui.csproj"
]
}
......
......@@ -40,9 +40,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wpf.Ui.Extension.Template.B
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wpf.Ui.Extension.Template.Fluent", "src\Wpf.Ui.Extension.Template.Fluent\Wpf.Ui.Extension.Template.Fluent.csproj", "{4D2706B5-27A9-4542-BD4D-8C22D12D0628}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wpf.Ui.ToastNotifications", "src\Wpf.Ui.ToastNotifications\Wpf.Ui.ToastNotifications.csproj", "{3E84FE46-D3FD-4E8A-9208-95E315F16E1F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wpf.Ui.ToastNotifications", "src\Wpf.Ui.ToastNotifications\Wpf.Ui.ToastNotifications.csproj", "{3E84FE46-D3FD-4E8A-9208-95E315F16E1F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wpf.Ui.Tray", "src\Wpf.Ui.Tray\Wpf.Ui.Tray.csproj", "{073BF126-377B-49CD-838A-E8B779EB4862}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wpf.Ui.Tray", "src\Wpf.Ui.Tray\Wpf.Ui.Tray.csproj", "{073BF126-377B-49CD-838A-E8B779EB4862}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wpf.Ui.SyntaxHighlight", "src\Wpf.Ui.SyntaxHighlight\Wpf.Ui.SyntaxHighlight.csproj", "{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -280,6 +282,22 @@ Global
{073BF126-377B-49CD-838A-E8B779EB4862}.Release|x64.Build.0 = Release|Any CPU
{073BF126-377B-49CD-838A-E8B779EB4862}.Release|x86.ActiveCfg = Release|Any CPU
{073BF126-377B-49CD-838A-E8B779EB4862}.Release|x86.Build.0 = Release|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Debug|arm64.ActiveCfg = Debug|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Debug|arm64.Build.0 = Debug|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Debug|x64.ActiveCfg = Debug|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Debug|x64.Build.0 = Debug|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Debug|x86.ActiveCfg = Debug|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Debug|x86.Build.0 = Debug|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Release|Any CPU.Build.0 = Release|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Release|arm64.ActiveCfg = Release|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Release|arm64.Build.0 = Release|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Release|x64.ActiveCfg = Release|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Release|x64.Build.0 = Release|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Release|x86.ActiveCfg = Release|Any CPU
{07F7A65A-6061-4606-ACA2-F8D1A3D0E19A}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
此差异由.gitattributes 抑制。
<div class="spaced-page">
<div class="row">
<div class="col-12 col-lg-6">
<div class="colorfull"><img src="/images/wpfui-gallery.png" alt="WPF UI Store Window with Fluent UI"></div>
<div class="colorful"><img src="/images/wpfui-gallery.png" alt="WPF UI Store Window with Fluent UI" /></div>
</div>
<div class="col-12 col-lg-6 d-flex align-items-center">
<div class="spaced-page-separator">
......@@ -15,9 +15,32 @@
</div>
</div>
</div>
<div>
<div class="row">
<div class="col-12">
<div class="space">
<div class="card card-call-to-action p-2">
<div class="row">
<div class="col">
<h4>Check out the Gallery</h4>
<span>Check out all the controls and functionality with the help of the free <strong>WPF UI Gallery </strong> app.</span>
</div>
<div class="col-auto">
<a href="https://apps.microsoft.com/store/detail/wpf-ui/9N9LKV8R9VGM?cid=windows-lp-hero" target="_blank" rel="noopener" class="btn btn-ms-store">
<img class="btn-image" src="/images/ms-download.png" alt="Download from MS Store" />
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div class="row">
<div class="col-12 col-lg-6">
<div class="col-12 col-lg-8">
<div class="space">
<h2 class="display-4">Fluent UI in your favorite environment</h2>
</div>
......@@ -61,6 +84,7 @@
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-6 col-lg-3 d-flex justify-content-center">
<div class="stats">
......
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
{{!master(layout/_master.tmpl)}}
<h1>{{title}}</h1>
{{#items.Length}}
<div id="template-container">
{{#items}}
<div class="card">
<img src="{{thumbnail}}" class="card-img-top" alt="{{name}}">
<div class="card-body flex-fill">
<h5 class="card-title"><a href="{{homepage}}" class="card-link">{{name}}</a></h5>
<p class="card-text">{{{description}}}</p>
</div>
<div class="card-body flex-grow-0">
{{#usage}}
<div class="">
{{#config}}<div class="list-group-item"><c>docfx.json</c>: <code>{{config}}</code></div>{{/config}}
{{#command}}<div class="list-group-item"><c>docfx</c>: <code>{{command}}</code></div>{{/command}}
{{#init}}<div class="list-group-item"><c>docfx init</c>: <code>{{init}}</code></div>{{/init}}
</div>
{{/usage}}
</div>
</div>
{{/items}}
</div>
{{/items.Length}}
<style type="text/css">
.affix {
display: none !important;
}
.card {
width: 24rem;
margin: 1rem;
}
.card > img {
height: 16rem;
object-fit: cover;
}
#template-container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
</style>
{
"title": "Dashboard",
"$schema": "https://dotnet.github.io/docfx/schemas/v1.0/schema.json#",
"version": "1.0.0",
"description": "Schema for dashboard",
"id": "https://github.com/dotnet/docfx/schemas/Dashboard.schema.json",
"type": "object",
"properties": {
"uid": {
"type": "string",
"contentType": "uid"
},
"title": {
"type": "string",
"tags": [
"localizable"
]
},
"description": {
"type": "string",
"contentType": "markdown",
"tags": [
"localizable"
]
},
"items": {
"items": {
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string",
"contentType": "markdown",
"tags": [
"localizable"
]
}
},
"type": "object"
},
"type": "array"
}
}
}
\ No newline at end of file
......@@ -56,6 +56,7 @@ export async function renderNavbar(): Promise<NavItem[]> {
<form class="icons">
${window.docfx.iconLinks?.map(i => html`<a href="${i.href}" title="${i.title}" class="btn border-0"><i class="bi bi-${i.icon}"></i></a>`)}
${themePicker(renderCore)}
<a class="btn btn-border-0 btn-sponsor mr-05" rel="noopener noreferrer" href="https://github.com/sponsors/lepoco">Sponsor</a>
</form>`
render(html`${menu} ${icons}`, navbar)
......
......@@ -31,7 +31,7 @@ export function themePicker(refresh: () => void) {
return html`
<div class='dropdown'>
<a title='Change theme' class='btn border-0 dropdown-toggle' data-bs-toggle='dropdown' aria-expanded='false'>
<a title='Change theme' class='btn border-0 dropdown-toggle mr-05' data-bs-toggle='dropdown' aria-expanded='false'>
<i class='bi bi-${icon}'></i>
</a>
<ul class='dropdown-menu'>
......
.h1, .h2, .h3, .h4, .h5, h1, h2, h3, h4, h5 {
font-family: Montserrat,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;
.h1,
.h2,
.h3,
.h4,
.h5,
h1,
h2,
h3,
h4,
h5 {
font-family: Montserrat, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji,
Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
}
.navbar-brand {
font-family: Montserrat,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;
font-family: Montserrat, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji,
Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
font-weight: 700;
}
.typelist.derived {
display: none;
}
.mr-05 {
margin-right: 0.5rem;
}
.card-call-to-action {
border-radius: 1rem;
padding: 1rem;
background-color: rgb(15, 163, 180);
background-image: linear-gradient(
140deg,
rgb(0, 128, 154),
rgb(19, 104, 145) 50%,
rgb(32, 135, 135) 75%
);
}
.btn-colorful {
background-color: rgb(15, 163, 180);
background-image: linear-gradient(
140deg,
rgb(0, 128, 154),
rgb(19, 104, 145) 50%,
rgb(32, 135, 135) 75%
);
}
.btn-sponsor {
background-color: rgb(15, 163, 180);
background-image: linear-gradient(
140deg,
rgb(0, 128, 154),
rgb(19, 104, 145) 50%,
rgb(32, 135, 135) 75%
);
}
img {
max-width: 100%;
}
......@@ -23,7 +76,7 @@ h3 {
.navbar-brand {
#logo {
max-width: 30px;
margin-right: .7rem;
margin-right: 0.7rem;
}
}
......@@ -31,7 +84,8 @@ h3 {
padding: 6rem 0;
}
.display-1, .display-4 {
.display-1,
.display-4 {
font-weight: 700;
}
......@@ -39,15 +93,33 @@ h3 {
padding: 1rem;
}
.colorfull {
.colorful {
background-color: #1fc8db;
background-image: linear-gradient(140deg,#55e2fd,#58b2dd 50%,#61cece 75%);
background-image: linear-gradient(
140deg,
#55e2fd,
#58b2dd 50%,
#61cece 75%
);
border-radius: 1rem;
padding: 1rem;
}
.btn-image {
max-width: 185px;
transition: transform 0.2s;
}
.btn-image:hover {
transform: scale(1.05);
}
.p-2 {
padding: 2rem;
}
.mr-05 {
margin-right: .5rem;
margin-right: 0.5rem;
}
.stats {
......@@ -56,7 +128,9 @@ h3 {
text-transform: uppercase;
strong {
font-family: Montserrat,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;
font-family: Montserrat, -apple-system, BlinkMacSystemFont, Segoe UI,
Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif,
Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
font-weight: 700;
margin: 0;
width: 100%;
......@@ -67,7 +141,7 @@ h3 {
footer {
// border-top: 1px solid #2c2c2c;
// color: #6b6b6b;
font-size: .8rem;
font-size: 0.8rem;
padding: 1rem;
a {
......
<Application
<Application
x:Class="Wpf.Ui.Demo.Mvvm.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
......@@ -9,7 +9,7 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary ApplicationTheme="Dark" />
<ui:ThemesDictionary Theme="Dark" />
<ui:ControlsDictionary />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
......
global using System.Windows;
// 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.
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.Input;
global using Wpf.Ui.Contracts;
global using Wpf.Ui.Services;
global using System.Windows;
......@@ -4,7 +4,6 @@
// All Rights Reserved.
using System.Collections.ObjectModel;
using Wpf.Ui.Common;
using Wpf.Ui.Controls;
namespace Wpf.Ui.Demo.Mvvm.ViewModels;
......
<Page
<Page
x:Class="Wpf.Ui.Demo.Mvvm.Views.Pages.DashboardPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
......@@ -26,7 +26,7 @@
Grid.Column="0"
Command="{Binding ViewModel.CounterIncrementCommand, Mode=OneWay}"
Content="Click me!"
Icon="Fluent24" />
Icon="{ui:SymbolIcon Fluent24}" />
<TextBlock
Grid.Column="1"
Margin="12,0,0,0"
......
<Application
<Application
x:Class="Wpf.Ui.Demo.Simple.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
......@@ -7,7 +7,7 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary ApplicationTheme="Dark" />
<ui:ThemesDictionary Theme="Dark" />
<ui:ControlsDictionary />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
......
......@@ -52,19 +52,28 @@
FontWeight="DemiBold" />
</ui:NavigationView.Header>
<ui:NavigationView.MenuItems>
<ui:NavigationViewItem Content="Dashboard" TargetPageType="{x:Type pages:DashboardPage}">
<ui:NavigationViewItem
Content="Dashboard"
NavigationCacheMode="Enabled"
TargetPageType="{x:Type pages:DashboardPage}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Home24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="Data" TargetPageType="{x:Type pages:DataPage}">
<ui:NavigationViewItem
Content="Data"
NavigationCacheMode="Enabled"
TargetPageType="{x:Type pages:DataPage}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="DataHistogram24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
</ui:NavigationView.MenuItems>
<ui:NavigationView.FooterMenuItems>
<ui:NavigationViewItem Content="Settings" TargetPageType="{x:Type pages:SettingsPage}">
<ui:NavigationViewItem
Content="Settings"
NavigationCacheMode="Enabled"
TargetPageType="{x:Type pages:SettingsPage}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Settings24" />
</ui:NavigationViewItem.Icon>
......
<Page
<Page
x:Class="Wpf.Ui.Demo.Simple.Views.Pages.DashboardPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
......@@ -24,7 +24,7 @@
Grid.Column="0"
Click="OnBaseButtonClick"
Content="Click me!"
Icon="Fluent24" />
Icon="{ui:SymbolIcon Fluent24}" />
<TextBlock
x:Name="CounterTextBlock"
Grid.Column="1"
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......@@ -16,13 +16,20 @@ public partial class DashboardPage
public DashboardPage()
{
DataContext = this;
InitializeComponent();
CounterTextBlock.Text = _counter.ToString();
CounterTextBlock.SetCurrentValue(
System.Windows.Controls.TextBlock.TextProperty,
_counter.ToString()
);
}
private void OnBaseButtonClick(object sender, RoutedEventArgs e)
{
CounterTextBlock.Text = (++_counter).ToString();
CounterTextBlock.SetCurrentValue(
System.Windows.Controls.TextBlock.TextProperty,
(++_counter).ToString()
);
}
}
......@@ -21,9 +21,13 @@ public SettingsPage()
AppVersionTextBlock.Text = $"WPF UI - Simple Demo - {GetAssemblyVersion()}";
if (Appearance.ApplicationThemeManager.GetAppTheme() == ApplicationTheme.Dark)
{
DarkThemeRadioButton.IsChecked = true;
}
else
{
LightThemeRadioButton.IsChecked = true;
}
}
private void OnLightThemeRadioButtonChecked(object sender, RoutedEventArgs e)
......
......@@ -2,5 +2,4 @@
global using System.Windows;
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.Input;
global using Wpf.Ui.Contracts;
global using Wpf.Ui.Services;
......@@ -4,7 +4,6 @@
// All Rights Reserved.
using System.Collections.ObjectModel;
using Wpf.Ui.Common;
using Wpf.Ui.Controls;
namespace $safeprojectname$.ViewModels.Windows
......
......@@ -2,5 +2,4 @@
global using System.Windows;
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.Input;
global using Wpf.Ui.Contracts;
global using Wpf.Ui.Services;
......@@ -4,7 +4,6 @@
// All Rights Reserved.
using System.Collections.ObjectModel;
using Wpf.Ui.Common;
using Wpf.Ui.Controls;
namespace $safeprojectname$.ViewModels.Windows
......
MIT License
Copyright (c) 2021-2022 Leszek Pomianowski and WPF UI Contributors.
Copyright (c) 2021-2023 Leszek Pomianowski and WPF UI Contributors. https://dev.lepo.co/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
\ No newline at end of file
SOFTWARE.
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="WPFUI.f1be4a7a-6073-492b-ac8c-dc46e836e926" Version="2.0.3" Language="en-US" Publisher="lepo.co" />
<Identity Id="WPFUI.f1be4a7a-6073-492b-ac8c-dc46e836e926" Version="3.0.0" Language="en-US" Publisher="lepo.co" />
<DisplayName>WPF UI</DisplayName>
<Description xml:space="preserve">WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.</Description>
<MoreInfo>https://github.com/lepoco/wpfui</MoreInfo>
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......@@ -14,6 +14,11 @@
System.Reflection.Assembly.GetExecutingAssembly().Location
);
if (workingDirectory is null)
{
throw new ArgumentNullException(nameof(workingDirectory));
}
var regularIcons = new FontSource(
"SymbolRegular",
"Represents a list of regular Fluent System Icons <c>v.{{FLUENT_SYSTEM_ICONS_VERSION}}</c>.\n<para>May be converted to <see langword=\"char\"/> using <c>GetGlyph()</c> or to <see langword=\"string\"/> using <c>GetString()</c></para>",
......@@ -27,7 +32,7 @@
"generated\\SymbolFilled.cs"
);
var fetchVersionAsync = async () =>
async Task<string> FetchVersion()
{
using var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (compatible; AcmeInc/1.0)");
......@@ -39,10 +44,10 @@
)
?.Last()
?.Ref.Replace("refs/tags/", String.Empty)
.Trim() ?? throw new Exception("Unable to parse the verison string");
};
.Trim() ?? throw new Exception("Unable to parse the version string");
}
var formatIconName = (string rawIconName) =>
string FormatIconName(string rawIconName)
{
rawIconName = rawIconName
.Replace("ic_fluent_", String.Empty)
......@@ -60,114 +65,109 @@
}
return iconName;
};
}
var fetchFontContentsAsync = async (FontSource source, string version) =>
async Task FetchFontContents(FontSource source, string version)
{
using var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (compatible; AcmeInc/1.0)");
var sourceJsonContent =
Dictionary<string, long> sourceJsonContent =
await httpClient.GetFromJsonAsync<Dictionary<string, long>>(source.SourcePath)
?? throw new Exception("Unable to obtain JSON data");
sourceJsonContent = sourceJsonContent
.OrderBy(x => x.Value)
.ToDictionary(k => formatIconName(k.Key), v => v.Value);
.ToDictionary(k => FormatIconName(k.Key), v => v.Value);
source.SetContents(sourceJsonContent);
source.UpdateVersion(version);
};
}
var recentVersion = await fetchVersionAsync();
var recentVersion = await FetchVersion();
await fetchFontContentsAsync(regularIcons, recentVersion);
await fetchFontContentsAsync(filledIcons, recentVersion);
await FetchFontContents(regularIcons, recentVersion);
await FetchFontContents(filledIcons, recentVersion);
var regularKeys = regularIcons.Contents.Keys;
var filledKeys = filledIcons.Contents.Keys;
var keysToRemove = regularKeys.Except(filledKeys).Concat(filledKeys.Except(regularKeys));
ICollection<string> regularKeys = regularIcons.Contents.Keys;
ICollection<string> filledKeys = filledIcons.Contents.Keys;
IEnumerable<string> keysToRemove = regularKeys
.Except(filledKeys)
.Concat(filledKeys.Except(regularKeys));
foreach (var key in keysToRemove)
{
regularIcons.Contents.Remove(key);
filledIcons.Contents.Remove(key);
_ = regularIcons.Contents.Remove(key);
_ = filledIcons.Contents.Remove(key);
Console.WriteLine($"Deleted key \"{key}\" because no duplicate found in all lists");
}
var writeToFileAsync = async (FontSource singleFont, string workingDirectory) =>
async Task WriteToFile(FontSource singleFont, string fileRootDirectory)
{
var destinationPath = Path.Combine(workingDirectory, singleFont.DestinationPath);
var destinationPath = Path.Combine(fileRootDirectory, singleFont.DestinationPath);
var enumName = singleFont.Name;
var enumMapStringBuilder = new StringBuilder();
enumMapStringBuilder.AppendLine(
"// This Source Code Form is subject to the terms of the MIT License."
);
enumMapStringBuilder.AppendLine(
"// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT."
);
enumMapStringBuilder.AppendLine("// Copyright (C) Leszek Pomianowski and WPF UI Contributors.");
enumMapStringBuilder.AppendLine("// All Rights Reserved.");
enumMapStringBuilder.AppendLine("");
enumMapStringBuilder.AppendLine("namespace Wpf.Ui.Common;");
enumMapStringBuilder.AppendLine("");
enumMapStringBuilder.AppendLine("/// <summary>");
enumMapStringBuilder.AppendLine($"/// {singleFont.Description.Replace("\n", "\n/// ")}");
enumMapStringBuilder.AppendLine("/// </summary>");
enumMapStringBuilder.AppendLine("#pragma warning disable CS1591");
enumMapStringBuilder.AppendLine("public enum " + enumName);
enumMapStringBuilder.AppendLine("{");
enumMapStringBuilder.AppendLine(" /// <summary>");
enumMapStringBuilder.AppendLine(
" /// Actually, this icon is not empty, but makes it easier to navigate."
);
enumMapStringBuilder.AppendLine(" /// </summary>");
enumMapStringBuilder.AppendLine(" Empty = 0x0,");
enumMapStringBuilder.AppendLine("");
enumMapStringBuilder.AppendLine(" // Automatically generated, may contain bugs.");
enumMapStringBuilder.AppendLine("");
foreach (var singleIcon in singleFont.Contents)
_ = enumMapStringBuilder
.AppendLine("// This Source Code Form is subject to the terms of the MIT License.")
.AppendLine(
"// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT."
)
.AppendLine("// Copyright (C) Leszek Pomianowski and WPF UI Contributors.")
.AppendLine("// All Rights Reserved.")
.AppendLine(String.Empty)
.AppendLine("namespace Wpf.Ui.Controls;")
.AppendLine(String.Empty)
.AppendLine("/// <summary>")
.AppendLine($"/// {singleFont.Description.Replace("\n", "\n/// ")}")
.AppendLine("/// </summary>")
.AppendLine("#pragma warning disable CS1591")
.AppendLine("public enum " + enumName)
.AppendLine("{")
.AppendLine(" /// <summary>")
.AppendLine(" /// Actually, this icon is not empty, but makes it easier to navigate.")
.AppendLine(" /// </summary>")
.AppendLine(" Empty = 0x0,")
.AppendLine(String.Empty)
.AppendLine(" // Automatically generated, may contain bugs.")
.AppendLine(String.Empty);
foreach (KeyValuePair<string, long> singleIcon in singleFont.Contents)
{
// Older versions
if (singleIcon.Value < 32)
{
enumMapStringBuilder.AppendLine($"");
enumMapStringBuilder.AppendLine($" /// <summary>");
enumMapStringBuilder.AppendLine($" /// Blank icon.");
enumMapStringBuilder.AppendLine($" /// </summary>");
_ = enumMapStringBuilder
.AppendLine(String.Empty)
.AppendLine(" /// <summary>")
.AppendLine(" /// Blank icon.")
.AppendLine(" /// </summary>");
}
enumMapStringBuilder.AppendLine($" {singleIcon.Key} = 0x{singleIcon.Value:X},");
_ = enumMapStringBuilder.AppendLine($" {singleIcon.Key} = 0x{singleIcon.Value:X},");
}
enumMapStringBuilder.AppendLine("}");
enumMapStringBuilder.AppendLine("");
enumMapStringBuilder.AppendLine("#pragma warning restore CS1591");
enumMapStringBuilder.Append("\r\n");
_ = enumMapStringBuilder
.AppendLine("}")
.AppendLine(String.Empty)
.AppendLine("#pragma warning restore CS1591")
.Append("\r\n");
var fileInfo = new FileInfo(destinationPath);
if (fileInfo.Directory != null && !fileInfo.Directory.Exists)
lock (fileInfo.Directory)
{
fileInfo.Directory.Create();
}
if (fileInfo.Directory is { Exists: false })
{
fileInfo.Directory.Create();
}
File.WriteAllText(destinationPath, enumMapStringBuilder.ToString());
};
await File.WriteAllTextAsync(destinationPath, enumMapStringBuilder.ToString());
}
await writeToFileAsync(regularIcons, workingDirectory);
await writeToFileAsync(filledIcons, workingDirectory);
await WriteToFile(regularIcons, workingDirectory);
await WriteToFile(filledIcons, workingDirectory);
Console.WriteLine("Done.");
System.Diagnostics.Debug.WriteLine("INFO | Done.", "Wpf.Ui.FontMapper");
return 0;
......@@ -7,13 +7,13 @@
IgnorableNamespaces="uap rescap">
<Identity
Name="ead211a9-332e-4aab-9040-88e5b660fc47"
Publisher="CN=Raven"
Version="1.0.0.0" />
Name="RapidDev.WPFUI"
Publisher="CN=F7CE81D0-29F4-45AA-935D-9F9E73C50210"
Version="3.0.1.0" />
<Properties>
<DisplayName>Wpf.Ui.Gallery.Package</DisplayName>
<PublisherDisplayName>Raven</PublisherDisplayName>
<DisplayName>WPF UI</DisplayName>
<PublisherDisplayName>lepo.co</PublisherDisplayName>
<Logo>Images\StoreLogo.png</Logo>
</Properties>
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '15.0'">
<VisualStudioVersion>15.0</VisualStudioVersion>
</PropertyGroup>
......@@ -58,6 +57,12 @@
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
<NoWarn>$(NoWarn);NU1702</NoWarn>
<EntryPointProjectUniqueName>..\Wpf.Ui.Gallery\Wpf.Ui.Gallery.csproj</EntryPointProjectUniqueName>
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundlePlatforms>x86</AppxBundlePlatforms>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
......@@ -116,6 +121,7 @@
<Content Include="Images\Wide310x150Logo.scale-150.png" />
<Content Include="Images\Wide310x150Logo.scale-200.png" />
<Content Include="Images\Wide310x150Logo.scale-400.png" />
<None Include="Package.StoreAssociation.xml" />
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
<ItemGroup>
......
<Application
<Application
x:Class="Wpf.Ui.Gallery.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:helpers="clr-namespace:Wpf.Ui.Gallery.Helpers"
xmlns:local="clr-namespace:Wpf.Ui.Gallery"
xmlns:syntax="http://schemas.lepo.co/wpfui/2022/xaml/syntax"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
DispatcherUnhandledException="OnDispatcherUnhandledException"
Exit="OnExit"
Startup="OnStartup">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary ApplicationTheme="Dark" />
<ui:ThemesDictionary Theme="Dark" />
<ui:ControlsDictionary />
<syntax:SyntaxHighlightDictionary />
<ResourceDictionary Source="Controls/GalleryNavigationPresenter.xaml" />
<ResourceDictionary Source="Controls/ControlExample.xaml" />
<ResourceDictionary Source="Controls/TypographyControl.xaml" />
......@@ -20,6 +25,7 @@
</ResourceDictionary.MergedDictionaries>
<helpers:EnumToBooleanConverter x:Key="EnumToBooleanConverter" />
</ResourceDictionary>
</Application.Resources>
</Application>
// This Source Code Form is subject to the terms of the MIT License.
// 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;
using System.Windows.Threading;
using Wpf.Ui.Gallery.DependencyModel;
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.Collections;
using Wpf.Ui.Gallery.ViewModels.Pages.DateAndTime;
using Wpf.Ui.Gallery.ViewModels.Pages.DesignGuidance;
using Wpf.Ui.Gallery.ViewModels.Pages.DialogsAndFlyouts;
using Wpf.Ui.Gallery.ViewModels.Pages.Layout;
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.Pages.Windows;
using Wpf.Ui.Gallery.ViewModels.Windows;
using Wpf.Ui.Gallery.Views.Pages;
using Wpf.Ui.Gallery.Views.Pages.BasicInput;
using Wpf.Ui.Gallery.Views.Pages.Collections;
using Wpf.Ui.Gallery.Views.Pages.DateAndTime;
using Wpf.Ui.Gallery.Views.Pages.DesignGuidance;
using Wpf.Ui.Gallery.Views.Pages.DialogsAndFlyouts;
using Wpf.Ui.Gallery.Views.Pages.Layout;
using Wpf.Ui.Gallery.Views.Pages.Media;
using Wpf.Ui.Gallery.Views.Pages.Navigation;
using Wpf.Ui.Gallery.Views.Pages.Samples;
using Wpf.Ui.Gallery.Views.Pages.StatusAndInfo;
using Wpf.Ui.Gallery.Views.Pages.Text;
using Wpf.Ui.Gallery.Views.Pages.Windows;
using Wpf.Ui.Gallery.Views.Windows;
using Wpf.Ui.Services;
namespace Wpf.Ui.Gallery;
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
#pragma warning disable IDE0058 // Expression value is never used
public partial class App
{
// The .NET Generic Host provides dependency injection, configuration, logging, and other services.
// https://docs.microsoft.com/dotnet/core/extensions/generic-host
......@@ -57,6 +30,7 @@ public partial class App : Application
(context, services) =>
{
// App Host
services.AddHostedService<ApplicationHostService>();
// Main window container with navigation
......@@ -75,151 +49,15 @@ public partial class App : Application
services.AddSingleton<SettingsPage>();
services.AddSingleton<SettingsViewModel>();
//Design guidance
services.AddTransient<TypographyPage>();
services.AddTransient<TypographyViewModel>();
services.AddTransient<IconsPage>();
services.AddTransient<IconsViewModel>();
services.AddTransient<ColorsPage>();
services.AddTransient<ColorsViewModel>();
// Basic Input
services.AddTransient<BasicInputPage>();
services.AddTransient<BasicInputViewModel>();
services.AddTransient<AnchorPage>();
services.AddTransient<AnchorViewModel>();
services.AddTransient<ButtonPage>();
services.AddTransient<ButtonViewModel>();
services.AddTransient<HyperlinkPage>();
services.AddTransient<HyperlinkViewModel>();
services.AddTransient<ToggleButtonPage>();
services.AddTransient<ToggleButtonViewModel>();
services.AddTransient<ToggleSwitchPage>();
services.AddTransient<ToggleSwitchViewModel>();
services.AddTransient<CheckBoxPage>();
services.AddTransient<CheckBoxViewModel>();
services.AddTransient<ComboBoxPage>();
services.AddTransient<ComboBoxViewModel>();
services.AddTransient<RadioButtonPage>();
services.AddTransient<RadioButtonViewModel>();
services.AddTransient<RatingPage>();
services.AddTransient<RatingViewModel>();
services.AddTransient<ThumbRatePage>();
services.AddTransient<ThumbRateViewModel>();
services.AddTransient<SliderPage>();
services.AddTransient<SliderViewModel>();
// Collections
services.AddTransient<CollectionsPage>();
services.AddTransient<CollectionsViewModel>();
services.AddTransient<DataGridPage>();
services.AddTransient<DataGridViewModel>();
services.AddTransient<ListBoxPage>();
services.AddTransient<ListBoxViewModel>();
services.AddTransient<ListViewPage>();
services.AddTransient<ListViewViewModel>();
services.AddTransient<TreeViewPage>();
services.AddTransient<TreeViewViewModel>();
services.AddTransient<TreeListPage>();
services.AddTransient<TreeListViewModel>();
// Date and Time
services.AddTransient<DateAndTimePage>();
services.AddTransient<DateAndTimeViewModel>();
services.AddTransient<CalendarPage>();
services.AddTransient<CalendarViewModel>();
services.AddTransient<DatePickerPage>();
services.AddTransient<DatePickerViewModel>();
// Dialogs and Flyouts
services.AddTransient<DialogsAndFlyoutsPage>();
services.AddTransient<DialogsAndFlyoutsViewModel>();
services.AddTransient<SnackbarPage>();
services.AddTransient<SnackbarViewModel>();
services.AddTransient<ContentDialogPage>();
services.AddTransient<ContentDialogViewModel>();
services.AddTransient<FlyoutPage>();
services.AddTransient<FlyoutViewModel>();
services.AddTransient<MessageBoxPage>();
services.AddTransient<MessageBoxViewModel>();
// Layout
services.AddTransient<LayoutPage>();
services.AddTransient<LayoutViewModel>();
services.AddTransient<ExpanderPage>();
services.AddTransient<ExpanderViewModel>();
// Web View
services.AddTransient<MediaPage>();
services.AddTransient<MediaViewModel>();
services.AddTransient<ImagePage>();
services.AddTransient<ImageViewModel>();
services.AddTransient<CanvasPage>();
services.AddTransient<CanvasViewModel>();
services.AddTransient<WebViewPage>();
services.AddTransient<WebViewViewModel>();
services.AddTransient<WebBrowserPage>();
services.AddTransient<WebBrowserViewModel>();
// Navigation
services.AddTransient<BreadcrumbBarPage>();
services.AddTransient<BreadcrumbBarViewModel>();
services.AddTransient<MenuPage>();
services.AddTransient<MenuViewModel>();
services.AddTransient<NavigationPage>();
services.AddTransient<NavigationViewModel>();
services.AddTransient<NavigationViewPage>();
services.AddTransient<MultilevelNavigationPage>();
services.AddTransient<NavigationViewViewModel>();
services.AddTransient<TabControlPage>();
services.AddTransient<TabControlViewModel>();
services.AddTransient<TabViewPage>();
services.AddTransient<TabViewViewModel>();
// Multilevel navigation sample Pages
services.AddTransient<MultilevelNavigationSample>();
services.AddTransient<MultilevelNavigationSamplePage1>();
services.AddTransient<MultilevelNavigationSamplePage2>();
services.AddTransient<MultilevelNavigationSamplePage3>();
// Status and Info
services.AddTransient<StatusAndInfoPage>();
services.AddTransient<StatusAndInfoViewModel>();
services.AddTransient<InfoBarPage>();
services.AddTransient<InfoBarViewModel>();
services.AddTransient<ProgressBarPage>();
services.AddTransient<ProgressBarViewModel>();
services.AddTransient<ProgressRingPage>();
services.AddTransient<ProgressRingViewModel>();
services.AddTransient<ToolTipPage>();
services.AddTransient<ToolTipViewModel>();
// Text
services.AddTransient<TextPage>();
services.AddTransient<TextViewModel>();
services.AddTransient<AutoSuggestBoxPage>();
services.AddTransient<AutoSuggestBoxViewModel>();
services.AddTransient<NumberBoxPage>();
services.AddTransient<NumberBoxViewModel>();
services.AddTransient<PasswordBoxPage>();
services.AddTransient<PasswordBoxViewModel>();
services.AddTransient<RichTextBoxPage>();
services.AddTransient<RichTextBoxViewModel>();
services.AddTransient<LabelPage>();
services.AddTransient<LabelViewModel>();
services.AddTransient<TextBlockPage>();
services.AddTransient<TextBlockViewModel>();
services.AddTransient<TextBoxPage>();
services.AddTransient<TextBoxViewModel>();
// Windows
services.AddTransient<WindowsPage>();
services.AddTransient<WindowsViewModel>();
services.AddTransient<EditorWindow>();
services.AddTransient<EditorWindowViewModel>();
services.AddTransient<MonacoWindow>();
services.AddTransient<MonacoWindowViewModel>();
// All other pages and view models
services.AddTransientFromNamespace(
"Wpf.Ui.Gallery.Views",
GalleryAssembly.Asssembly
);
services.AddTransientFromNamespace(
"Wpf.Ui.Gallery.ViewModels",
GalleryAssembly.Asssembly
);
}
)
.Build();
......@@ -229,9 +67,9 @@ public partial class App : Application
/// </summary>
/// <typeparam name="T">Type of the service to get.</typeparam>
/// <returns>Instance of the service or <see langword="null"/>.</returns>
public static T? GetService<T>() where T : class
public static T GetRequiredService<T>() where T : class
{
return _host.Services.GetService(typeof(T)) as T ?? null;
return _host.Services.GetRequiredService<T>();
}
/// <summary>
......@@ -263,3 +101,4 @@ DispatcherUnhandledExceptionEventArgs e
// For more info see https://docs.microsoft.com/en-us/dotnet/api/system.windows.application.dispatcherunhandledexception?view=windowsdesktop-6.0
}
}
#pragma warning restore IDE0058 // Expression value is never used
// This Source Code Form is subject to the terms of the MIT License.
// 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)
//(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)
......
// This Source Code Form is subject to the terms of the MIT License.
// 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;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.Web.WebView2.Wpf;
using Wpf.Ui.Appearance;
......
<ResourceDictionary
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Wpf.Ui.Gallery.Controls"
xmlns:helpers="clr-namespace:Wpf.Ui.Gallery.Helpers"
xmlns:syntax="http://schemas.lepo.co/wpfui/2022/xaml/syntax"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
<helpers:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
......@@ -51,7 +52,7 @@
FontTypography="BodyStrong"
Text="XAML" />
<ui:CodeBlock
<syntax:CodeBlock
Padding="0"
Background="Transparent"
BorderBrush="Transparent"
......@@ -72,7 +73,7 @@
FontTypography="BodyStrong"
Text="CSharp" />
<ui:CodeBlock
<syntax:CodeBlock
Padding="0"
Background="Transparent"
BorderBrush="Transparent"
......
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Windows;
// 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 System.Windows.Markup;
namespace Wpf.Ui.Gallery.Controls;
......@@ -111,9 +111,12 @@ private static string LoadResource(Uri uri)
try
{
if (Application.GetResourceStream(uri) is not { } steamInfo)
return string.Empty;
{
return String.Empty;
}
using StreamReader streamReader = new(steamInfo.Stream, Encoding.UTF8);
return streamReader.ReadToEnd();
}
catch (Exception e)
......
// This Source Code Form is subject to the terms of the MIT License.
// 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;
namespace Wpf.Ui.Gallery.Controls;
public class GalleryNavigationPresenter : System.Windows.Controls.Control
......@@ -25,43 +23,43 @@ public class GalleryNavigationPresenter : System.Windows.Controls.Control
public static readonly DependencyProperty TemplateButtonCommandProperty =
DependencyProperty.Register(
nameof(TemplateButtonCommand),
typeof(Common.IRelayCommand),
typeof(Wpf.Ui.Input.IRelayCommand),
typeof(GalleryNavigationPresenter),
new PropertyMetadata(null)
);
public object ItemsSource
public object? ItemsSource
{
get => GetValue(ItemsSourceProperty);
set => SetValue(ItemsSourceProperty, value);
}
/// <summary>
/// Command triggered after clicking the titlebar button.
/// Gets the command triggered after clicking the titlebar button.
/// </summary>
public Common.IRelayCommand TemplateButtonCommand =>
(Common.IRelayCommand)GetValue(TemplateButtonCommandProperty);
public Wpf.Ui.Input.IRelayCommand TemplateButtonCommand =>
(Wpf.Ui.Input.IRelayCommand)GetValue(TemplateButtonCommandProperty);
/// <summary>
/// Initializes a new instance of the <see cref="GalleryNavigationPresenter"/> class.
/// Creates a new instance of the class and sets the default <see cref="FrameworkElement.Loaded"/> event.
/// </summary>
public GalleryNavigationPresenter()
{
SetValue(
TemplateButtonCommandProperty,
new Common.RelayCommand<Type>(o => OnTemplateButtonClick(o))
new Input.RelayCommand<Type>(o => OnTemplateButtonClick(o))
);
}
private void OnTemplateButtonClick(Type? pageType)
{
var navigationService = App.GetService<INavigationService>();
if (navigationService == null)
return;
INavigationService navigationService = App.GetRequiredService<INavigationService>();
if (pageType is not null)
{
navigationService.Navigate(pageType);
}
#if DEBUG
System.Diagnostics.Debug.WriteLine(
......
......@@ -3,10 +3,7 @@
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Wpf.Ui.Controls;
namespace Wpf.Ui.Gallery.Controls;
......@@ -117,13 +114,17 @@ private void NavigationViewOnNavigated(NavigationView sender, NavigatedEventArgs
Visibility = Visibility.Visible;
if (GetDocumentationType(page) is not null)
{
IsDocumentationLinkVisible = Visibility.Visible;
}
}
private void OnClick(string? param)
{
if (string.IsNullOrWhiteSpace(param) || _page is null)
if (String.IsNullOrWhiteSpace(param) || _page is null)
{
return;
}
// TODO: Refactor switch
if (param == "theme")
......@@ -142,7 +143,9 @@ private void OnClick(string? param)
};
if (String.IsNullOrEmpty(navigationUrl))
{
return;
}
try
{
......@@ -171,17 +174,19 @@ private static string CreateUrlForGithub(Type pageType, ReadOnlySpan<char> fileE
for (int i = 0; i < pageUrl.Length; i++)
{
if (pageUrl[i] == '.')
{
pageUrl[i] = '/';
}
}
return string.Concat(baseUrl, pageUrl, fileExtension);
return String.Concat(baseUrl, pageUrl, fileExtension);
}
private static string CreateUrlForDocumentation(Type type)
{
const string baseUrl = "https://wpfui.lepo.co/documentation/";
const string baseUrl = "https://wpfui.lepo.co/api/";
return string.Concat(baseUrl, type.FullName, ".html");
return String.Concat(baseUrl, type.FullName, ".html");
}
private static void SwitchThemes()
......
using System.Windows;
// 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 Wpf.Ui.Controls;
......
using System.Windows;
// 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;
using System.Windows.Controls;
using Wpf.Ui.Controls;
namespace Wpf.Ui.Gallery.Controls;
......
using System.Reflection;
// 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.ControlsLookup;
......
namespace Wpf.Ui.Gallery.ControlsLookup;
// 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.Controls;
namespace Wpf.Ui.Gallery.ControlsLookup;
record GalleryPage(string Name, string Description, SymbolRegular Icon, Type PageType);
namespace Wpf.Ui.Gallery.ControlsLookup;
// 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.Controls;
namespace Wpf.Ui.Gallery.ControlsLookup;
[AttributeUsage(AttributeTargets.Class)]
class GalleryPageAttribute : Attribute
......
// 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.DependencyModel;
internal static class ServiceCollectionExtensions
{
public static IServiceCollection AddTransientFromNamespace(
this IServiceCollection services,
string namespaceName,
params Assembly[] assemblies
)
{
foreach (Assembly assembly in assemblies)
{
IEnumerable<Type> types = assembly
.GetTypes()
.Where(
x =>
x.IsClass
&& x.Namespace!.StartsWith(
namespaceName,
StringComparison.InvariantCultureIgnoreCase
)
);
foreach (Type? type in types)
{
if (services.All(x => x.ServiceType != type))
{
_ = services.AddTransient(type);
}
}
}
return services;
}
}
using System.Reflection;
// 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;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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
......@@ -14,10 +10,14 @@ 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.ApplicationTheme), value))
{
throw new ArgumentException("ExceptionEnumToBooleanConverterValueMustBeAnEnum");
}
var enumValue = Enum.Parse(typeof(Wpf.Ui.Appearance.ApplicationTheme), enumString);
......@@ -27,7 +27,9 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
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.ApplicationTheme), enumString);
}
......
// This Source Code Form is subject to the terms of the MIT License.
// 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
......
using System.Globalization;
using System.Windows;
using System.Windows.Data;
// 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.Helpers;
public class NullToVisibilityConverter : IValueConverter
{
public object Convert(object? value, Type targetType, object parameter, CultureInfo culture) =>
value is null ? Visibility.Collapsed : Visibility.Visible;
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
return value is null ? Visibility.Collapsed : Visibility.Visible;
}
public object ConvertBack(
object value,
object? value,
Type targetType,
object parameter,
object? parameter,
CultureInfo culture
) => throw new NotImplementedException();
)
{
throw new NotImplementedException();
}
}
// This Source Code Form is subject to the terms of the MIT License.
// 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.Controls;
namespace Wpf.Ui.Gallery.Models;
public struct DisplayableIcon
......@@ -15,5 +17,5 @@ public struct DisplayableIcon
public string Symbol { get; set; }
public Wpf.Ui.Common.SymbolRegular Icon { get; set; }
public SymbolRegular Icon { get; set; }
}
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.Controls;
namespace Wpf.Ui.Gallery.Models;
public record NavigationCard
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.Controls;
namespace Wpf.Ui.Gallery.Models;
public record WindowCard
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.Windows;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
// This Source Code Form is subject to the terms of the MIT License.
// 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;
namespace Wpf.Ui.Gallery.Services;
public class WindowsProviderService
......
global using CommunityToolkit.Mvvm.ComponentModel;
// 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.
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.Input;
global using Microsoft.Extensions.Configuration;
global using Microsoft.Extensions.DependencyInjection;
global using Microsoft.Extensions.Hosting;
global using Wpf.Ui.Common;
global using Wpf.Ui.Contracts;
global using System;
global using System.Collections.Generic;
global using System.Collections.ObjectModel;
global using System.Diagnostics;
global using System.Globalization;
global using System.IO;
global using System.Linq;
global using System.Reflection;
global using System.Text;
global using System.Threading;
global using System.Threading.Tasks;
global using System.Windows;
global using System.Windows.Data;
global using System.Windows.Input;
global using System.Windows.Markup;
global using System.Windows.Media;
global using System.Windows.Threading;
\ No newline at end of file
// This Source Code Form is subject to the terms of the MIT License.
// 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.ObjectModel;
using Wpf.Ui.Gallery.ControlsLookup;
using Wpf.Ui.Gallery.Models;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.ObjectModel;
using Wpf.Ui.Gallery.ControlsLookup;
using Wpf.Ui.Gallery.Models;
using Wpf.Ui.Gallery.Views.Pages.BasicInput;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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
......
// 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.ViewModels.Pages.BasicInput;
public partial class DropDownButtonViewModel : ObservableObject { }
// This Source Code Form is subject to the terms of the MIT License.
// 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;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
// This Source Code Form is subject to the terms of the MIT License.
// 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
......
// 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.ViewModels.Pages.BasicInput;
public partial class SplitButtonViewModel : ObservableObject { }
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......@@ -32,11 +32,11 @@ public ThumbRateState ThumbRateState
ThumRateStateCodeText =
$"<ui:ThumbRate State=\"{(value switch
{
ThumbRateState.Liked => "Liked",
ThumbRateState.Disliked => "Disliked",
_ => "None"
})}\" />";
{
ThumbRateState.Liked => "Liked",
ThumbRateState.Disliked => "Disliked",
_ => "None"
})}\" />";
}
}
}
// This Source Code Form is subject to the terms of the MIT License.
// 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;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.ObjectModel;
using Wpf.Ui.Gallery.ControlsLookup;
using Wpf.Ui.Gallery.Models;
using Wpf.Ui.Gallery.Views.Pages.Collections;
......
using System.Collections.ObjectModel;
// 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.Gallery.Models;
namespace Wpf.Ui.Gallery.ViewModels.Pages.Collections;
......
using System.Collections.ObjectModel;
// 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.ViewModels.Pages.Collections;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.ObjectModel;
using System.Windows.Controls;
using Wpf.Ui.Gallery.Models;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.Collections;
public partial class TreeListViewModel : ObservableObject { }
// This Source Code Form is subject to the terms of the MIT License.
// 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.Collections;
public partial class TreeViewViewModel : ObservableObject { }
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......@@ -20,13 +20,17 @@ public DashboardViewModel(INavigationService navigationService)
private void OnCardClick(string parameter)
{
if (String.IsNullOrWhiteSpace(parameter))
{
return;
}
var pageType = NameToPageTypeConverter.Convert(parameter);
Type? pageType = NameToPageTypeConverter.Convert(parameter);
if (pageType == null)
{
return;
}
_navigationService.Navigate(pageType);
_ = _navigationService.Navigate(pageType);
}
}
// This Source Code Form is subject to the terms of the MIT License.
// 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.DateAndTime;
public partial class CalendarViewModel : ObservableObject { }
// This Source Code Form is subject to the terms of the MIT License.
// 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.ObjectModel;
using Wpf.Ui.Gallery.ControlsLookup;
using Wpf.Ui.Gallery.Models;
using Wpf.Ui.Gallery.Views.Pages.DateAndTime;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.DateAndTime;
public partial class DatePickerViewModel : ObservableObject { }
......@@ -16,7 +16,7 @@ public partial class IconsViewModel : ObservableObject, INavigationAware
private string _autoSuggestBoxText = String.Empty;
[ObservableProperty]
private Wpf.Ui.Common.SymbolRegular _selectedSymbol = Common.SymbolRegular.Empty;
private SymbolRegular _selectedSymbol = SymbolRegular.Empty;
[ObservableProperty]
private string _selectedSymbolName = String.Empty;
......@@ -57,14 +57,14 @@ public IconsViewModel()
_ = Task.Run(() =>
{
var id = 0;
var names = Enum.GetNames(typeof(Common.SymbolRegular));
var names = Enum.GetNames(typeof(SymbolRegular));
var icons = new List<DisplayableIcon>();
names = names.OrderBy(n => n).ToArray();
foreach (string iconName in names)
{
var icon = Common.SymbolGlyph.Parse(iconName);
var icon = SymbolGlyph.Parse(iconName);
icons.Add(
new DisplayableIcon
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.ObjectModel;
using Wpf.Ui.Gallery.ControlsLookup;
using Wpf.Ui.Gallery.Models;
using Wpf.Ui.Gallery.Views.Pages.DialogsAndFlyouts;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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 CommunityToolkit.Mvvm.Input;
namespace Wpf.Ui.Gallery.ViewModels.Pages.DialogsAndFlyouts;
public partial class FlyoutViewModel : ObservableObject
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.ObjectModel;
using Wpf.Ui.Gallery.ControlsLookup;
using Wpf.Ui.Gallery.Models;
using Wpf.Ui.Gallery.Views.Pages.Layout;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.ObjectModel;
using Wpf.Ui.Gallery.ControlsLookup;
using Wpf.Ui.Gallery.Models;
using Wpf.Ui.Gallery.Views.Pages.Media;
......
// This Source Code Form is subject to the terms of the MIT License.
// 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.
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册