Skip to content

Commit

Permalink
Merge pull request #817 from lepoco/development
Browse files Browse the repository at this point in the history
Merge Development
  • Loading branch information
pomianowski committed Nov 13, 2023
2 parents a58feed + d9f9fa4 commit 5ed3786
Show file tree
Hide file tree
Showing 98 changed files with 4,053 additions and 1,116 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/wpf-ui-cd-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Setup .NET Core SDK 7.x
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<Version>3.0.0-preview.8</Version>
<Version>3.0.0-preview.9</Version>
<LangVersion>11.0</LangVersion>
<Deterministic>true</Deterministic>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion docs/codesnippet/Rtf/Hyperlink/RtfDocumentProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace RtfDocumentProcessors
using System.Linq;
using System.Web;
using System.Xml.Linq;

using Microsoft.DocAsCode.Plugins;
using Microsoft.DocAsCode.Utility;

Expand Down
1 change: 0 additions & 1 deletion docs/codesnippet/Rtf/RtfBuildStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace RtfDocumentProcessors
using System.Composition;
using System.Threading.Tasks;
using System.Threading.Tasks.Schedulers;

using MarkupConverter;
using Microsoft.DocAsCode.Plugins;

Expand Down
1 change: 0 additions & 1 deletion docs/codesnippet/Rtf/RtfDocumentProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace RtfDocumentProcessors
using System.Collections.Immutable;
using System.Composition;
using System.IO;

using Microsoft.DocAsCode.Common;
using Microsoft.DocAsCode.Plugins;

Expand Down
6 changes: 3 additions & 3 deletions src/Wpf.Ui.Extension.Template.Compact/Usings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
global using System;
global using System.Windows;
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.Input;
global using System;
global using System.Windows;
global using Wpf.Ui.Services;
6 changes: 3 additions & 3 deletions src/Wpf.Ui.Extension.Template.Fluent/Usings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
global using System;
global using System.Windows;
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.Input;
global using System;
global using System.Windows;
global using Wpf.Ui.Services;
3 changes: 2 additions & 1 deletion src/Wpf.Ui.FontMapper/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ async Task<string> FetchVersion()
)
)
?.Last()
?.Ref.Replace("refs/tags/", String.Empty)
?.Ref
.Replace("refs/tags/", String.Empty)
.Trim() ?? throw new Exception("Unable to parse the version string");
}

Expand Down
9 changes: 5 additions & 4 deletions src/Wpf.Ui.Gallery/Controls/ControlExample.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,31 @@
Grid.Row="0"
Margin="0,0,0,10"
FontTypography="BodyStrong"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="{TemplateBinding HeaderText}"
Visibility="{TemplateBinding HeaderText,
Converter={StaticResource NullToVisibilityConverter}}" />

<Border
Grid.Row="1"
Padding="16"
Background="{ui:ThemeResource CardStrokeColorDefaultBrush}"
BorderBrush="{ui:ThemeResource ControlElevationBorderBrush}"
Background="{ui:ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ui:ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="1,1,1,0"
CornerRadius="8,8,0,0">
<ContentPresenter Content="{TemplateBinding ExampleContent}" />
</Border>

<ui:CardExpander
Grid.Row="2"
Background="{ui:ThemeResource CardBackgroundFillColorSecondaryBrush}"
CornerRadius="0,0,8,8"
Header="Source code">
<StackPanel>
<StackPanel x:Name="XamlCodeBlock">
<ui:TextBlock
Margin="0,0,0,5"
FontTypography="BodyStrong"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="XAML" />

<syntax:CodeBlock
Expand All @@ -63,14 +64,14 @@
<Border
x:Name="Border"
Margin="0,20"
BorderBrush="{ui:ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderThickness="1"
Visibility="Visible" />

<StackPanel x:Name="CsharpCodeBlock">
<ui:TextBlock
Margin="0,0,0,5"
FontTypography="BodyStrong"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="C#" />

<syntax:CodeBlock
Expand Down
11 changes: 8 additions & 3 deletions src/Wpf.Ui.Gallery/Controls/GalleryNavigationPresenter.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ResourceDictionary
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:basicInput="clr-namespace:Wpf.Ui.Gallery.Views.Pages.BasicInput"
Expand All @@ -24,16 +24,21 @@
CommandParameter="{Binding PageType, Mode=OneTime}"
IsChevronVisible="True">
<ui:CardAction.Icon>
<ui:SymbolIcon FontSize="30" Symbol="{Binding Icon, Mode=OneTime}" />
<ui:SymbolIcon
FontSize="30"
Symbol="{Binding Icon, Mode=OneTime}"
TextElement.Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
</ui:CardAction.Icon>
<StackPanel>
<ui:TextBlock
Margin="0"
FontTypography="BodyStrong"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="{Binding Name, Mode=OneTime}"
TextWrapping="WrapWithOverflow" />
<ui:TextBlock
Appearance="Tertiary"
Appearance="Secondary"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{Binding Description, Mode=OneTime}"
TextWrapping="WrapWithOverflow" />
</StackPanel>
Expand Down
11 changes: 7 additions & 4 deletions src/Wpf.Ui.Gallery/Controls/GalleryNavigationPresenter.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ private void OnTemplateButtonClick(Type? pageType)
}

#if DEBUG
System.Diagnostics.Debug.WriteLine(
$"INFO | {nameof(GalleryNavigationPresenter)} navigated, ({pageType})",
"Wpf.Ui.Gallery"
);
System
.Diagnostics
.Debug
.WriteLine(
$"INFO | {nameof(GalleryNavigationPresenter)} navigated, ({pageType})",
"Wpf.Ui.Gallery"
);
#endif
}
}
13 changes: 8 additions & 5 deletions src/Wpf.Ui.Gallery/Controls/PageControlDocumentation.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,13 @@ private static void SwitchThemes()
{
var currentTheme = Wpf.Ui.Appearance.ApplicationThemeManager.GetAppTheme();

Wpf.Ui.Appearance.ApplicationThemeManager.Apply(
currentTheme == Wpf.Ui.Appearance.ApplicationTheme.Light
? Wpf.Ui.Appearance.ApplicationTheme.Dark
: Wpf.Ui.Appearance.ApplicationTheme.Light
);
Wpf.Ui
.Appearance
.ApplicationThemeManager
.Apply(
currentTheme == Wpf.Ui.Appearance.ApplicationTheme.Light
? Wpf.Ui.Appearance.ApplicationTheme.Dark
: Wpf.Ui.Appearance.ApplicationTheme.Light
);
}
}
3 changes: 2 additions & 1 deletion src/Wpf.Ui.Gallery/ControlsLookup/ControlPages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ static class ControlPages
public static IEnumerable<GalleryPage> All()
{
foreach (
var type in GalleryAssembly.Asssembly
var type in GalleryAssembly
.Asssembly
.GetTypes()
.Where(t => t.IsDefined(typeof(GalleryPageAttribute)))
)
Expand Down
11 changes: 11 additions & 0 deletions src/Wpf.Ui.Gallery/ViewModels/Pages/Layout/CardControlViewModel.cs
Original file line number Diff line number Diff line change
@@ -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.ViewModels.Pages.Layout;

public partial class CardControlViewModel : ObservableObject
{
public CardControlViewModel() { }
}
6 changes: 5 additions & 1 deletion src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ public partial class MainWindowViewModel : ObservableObject
#if DEBUG
new NavigationViewItem("Layout", SymbolRegular.News24, typeof(LayoutPage))
{
MenuItems = new object[] { new NavigationViewItem("Expander", typeof(ExpanderPage)) }
MenuItems = new object[]
{
new NavigationViewItem("Expander", typeof(ExpanderPage)),
new NavigationViewItem("CardControl", typeof(CardControlPage))
},
},
#endif
new NavigationViewItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.

using Microsoft.Web.WebView2.Wpf;
using System.Windows.Threading;
using Microsoft.Web.WebView2.Wpf;
using Wpf.Ui.Gallery.Controllers;
using Wpf.Ui.Gallery.Models.Monaco;

Expand Down
13 changes: 7 additions & 6 deletions src/Wpf.Ui.Gallery/Views/Pages/DashboardPage.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Page
<Page
x:Class="Wpf.Ui.Gallery.Views.Pages.DashboardPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Expand Down Expand Up @@ -117,7 +117,8 @@
Text="Basic input"
TextWrapping="WrapWithOverflow" />
<ui:TextBlock
Appearance="Tertiary"
Appearance="Secondary"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="Buttons, CheckBoxes, Sliders..."
TextWrapping="WrapWithOverflow" />
</StackPanel>
Expand Down Expand Up @@ -154,8 +155,8 @@
Text="Dialogs &amp; Flyouts"
TextWrapping="WrapWithOverflow" />
<ui:TextBlock
Appearance="Tertiary"
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
Appearance="Secondary"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="Contextual notifications."
TextWrapping="WrapWithOverflow" />
</StackPanel>
Expand Down Expand Up @@ -192,8 +193,8 @@
Text="Navigation"
TextWrapping="WrapWithOverflow" />
<ui:TextBlock
Appearance="Tertiary"
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
Appearance="Secondary"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="Managing the displayed pages."
TextWrapping="WrapWithOverflow" />
</StackPanel>
Expand Down
40 changes: 40 additions & 0 deletions src/Wpf.Ui.Gallery/Views/Pages/Layout/CardControlPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<Page
x:Class="Wpf.Ui.Gallery.Views.Pages.Layout.CardControlPage"
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:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Wpf.Ui.Gallery.Views.Pages.Layout"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="CardControlPage"
d:DesignHeight="450"
d:DesignWidth="800"
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
mc:Ignorable="d">

<controls:ControlExample
Margin="0"
HeaderText="A card control with a header and a button."
XamlCode="&lt;ui:CardControl Header=&quot;This is the header text.&quot; /&gt;">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ui:CardControl Grid.Column="0">
<ui:CardControl.Header>
<TextBlock Text="This is the header text." />
</ui:CardControl.Header>
<ui:CardControl.Content>
<ui:Button Content="Button" />
</ui:CardControl.Content>
</ui:CardControl>

</Grid>
</controls:ControlExample>
<!-- TODO: Add CardAction -->
</Page>
39 changes: 39 additions & 0 deletions src/Wpf.Ui.Gallery/Views/Pages/Layout/CardControlPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Wpf.Ui.Controls;
using Wpf.Ui.Gallery.ControlsLookup;
using Wpf.Ui.Gallery.ViewModels.Pages.Layout;

namespace Wpf.Ui.Gallery.Views.Pages.Layout;

/// <summary>
/// Interaction logic for CardControlPage.xaml
/// </summary>
[GalleryPage("Card control.", SymbolRegular.CardUi24)]
public partial class CardControlPage : INavigableView<CardControlViewModel>
{
public CardControlPage(CardControlViewModel viewModel)
{
InitializeComponent();
ViewModel = viewModel;
}

public CardControlViewModel ViewModel { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
</ui:IconSourceElement>
</Setter.Value>
</Setter>
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="Regular" />
</Style>
</ResourceDictionary>
Expand Down
9 changes: 3 additions & 6 deletions src/Wpf.Ui.Gallery/Views/Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
IsDesignTimeCreatable=False}"
d:DesignHeight="450"
d:DesignWidth="800"
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
mc:Ignorable="d">

<StackPanel Margin="0,0,0,24">
Expand All @@ -37,7 +34,7 @@
Text="App theme" />
<ui:TextBlock
Grid.Row="1"
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}"
Foreground="{ui:ThemeResource TextFillColorSecondaryBrush}"
Text="Select which app theme to display" />
</Grid>
</ui:CardControl.Header>
Expand Down Expand Up @@ -93,15 +90,15 @@
<ui:TextBlock
Grid.Row="1"
Grid.Column="0"
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}"
Foreground="{ui:ThemeResource TextFillColorSecondaryBrush}"
Text="© 2023 lepo.co | Leszek Pomianowski &amp; WPF UI Contributors" />
<TextBlock
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="1"
Margin="0,0,16,0"
VerticalAlignment="Center"
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}"
Foreground="{ui:ThemeResource TextFillColorSecondaryBrush}"
Text="{Binding ViewModel.AppVersion, Mode=OneWay}" />
</Grid>
</ui:CardExpander.Header>
Expand Down
Loading

0 comments on commit 5ed3786

Please sign in to comment.