Skip to content

Commit 65e7bc6

Browse files
authored
Merge pull request #996 from lepoco/development
Merge development and bump version to 3.0.1
2 parents baaf749 + 699edcb commit 65e7bc6

20 files changed

+296
-50
lines changed

.github/labeler.yml

+26-15
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
1-
---
21
PR:
32
- "*"
43

4+
dotnet:
5+
- '**/*.cs'
6+
57
github_actions:
6-
- .github/workflows/*
8+
- ".github/workflows/*"
79

810
documentation:
9-
- docs/*
11+
- "docs/*"
1012

1113
update:
12-
- src/Directory.Build.props
14+
- "src/Directory.Build.props"
1315

14-
controls:
15-
- src/Wpf.Ui/Controls/*
16+
dependencies:
17+
- "src/Packages.props"
18+
- "branding/package.json"
19+
- "src/Packages.props"
20+
21+
NuGet:
22+
- "src/Packages.props"
1623

1724
styles:
18-
- src/Wpf.Ui/Styles/*
25+
- "src/Wpf.Ui/**/*.xaml"
1926

20-
icons:
21-
- src/Wpf.Ui/Fonts/FluentSystemIcons-Filled.ttf
22-
- src/Wpf.Ui/Fonts/FluentSystemIcons-Regular.ttf
27+
themes:
28+
- "src/Wpf.Ui/Appearance/*"
2329

24-
dependencies:
25-
- src/Packages.props
26-
- branding/package.json
30+
tray:
31+
- "src/Wpf.Ui.Tray/*"
2732

28-
NuGet:
29-
- src/Packages.props
33+
controls:
34+
- "src/Wpf.Ui/Controls/*"
35+
36+
icons:
37+
- "src/Wpf.Ui/Resources/Fonts/*"
38+
39+
navigation:
40+
- "src/Wpf.Ui/Controls/NavigationView/*"

.github/labels.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
- name: "icons"
32
color: "86CBEC"
43
description: "Fonts and icons updates"
@@ -47,6 +46,9 @@
4746
- name: ".NET"
4847
color: "7121c6"
4948
description: "Pull requests that update .NET code."
49+
- name: "dotnet"
50+
color: "7121c6"
51+
description: "Pull requests that update .NET code."
5052
- name: "NuGet"
5153
color: "004880"
5254
description: "Update of the NuGet package."
@@ -71,3 +73,4 @@
7173
- name: "wontfix"
7274
color: "ffffff"
7375
description: "This will not be worked on."
76+

.github/workflows/codeql-analysis.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ development ]
8+
9+
jobs:
10+
analyze:
11+
name: Analyze
12+
runs-on: windows-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v2
17+
18+
- uses: microsoft/[email protected]
19+
with:
20+
msbuild-architecture: x64
21+
22+
- name: Setup .NET Core SDK 8.x
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: 8.x
26+
27+
- name: Install dependencies
28+
run: dotnet restore
29+
30+
- name: Build
31+
run: dotnet build src\Wpf.Ui.Gallery\Wpf.Ui.Gallery.csproj --configuration Release --no-restore
32+
33+
- name: Initialize CodeQL
34+
uses: github/codeql-action/init@v1
35+
with:
36+
languages: "csharp"
37+
38+
- name: Perform CodeQL Analysis
39+
uses: github/codeql-action/analyze@v1

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<PropertyGroup>
4-
<Version>3.0.0</Version>
4+
<Version>3.0.1</Version>
55
<LangVersion>12.0</LangVersion>
66
<Deterministic>true</Deterministic>
77
</PropertyGroup>

README.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,16 @@ public partial class MainWindow
127127
Now you can create fantastic apps, e.g. with one button:
128128

129129
```xml
130-
<ui:UiWindow
130+
<ui:FluentWindow
131131
...
132132
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
133-
<Grid>
134-
<ui:Button
135-
Content="Hello World"
136-
Icon="Fluent24"/>
137-
</Grid>
138-
</ui:UiWindow>
133+
<StackPanel>
134+
<ui:TitleBar Title="WPF UI"/>
135+
<ui:Card Margin="8">
136+
<ui:Button Content="Hello World" Icon="{ui:SymbolIcon Fluent24}" />
137+
</ui:Card>
138+
</StackPanel>
139+
</ui:FluentWindow>
139140
```
140141

141142
## Special thanks

src/Wpf.Ui/Appearance/ApplicationThemeManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ systemTheme is SystemTheme.HC1 or SystemTheme.HC2 or SystemTheme.HCBlack or Syst
233233
themeToSet = ApplicationTheme.HighContrast;
234234
}
235235

236-
Apply(themeToSet);
236+
Apply(themeToSet, updateAccent: updateAccent);
237237
}
238238

239239
/// <summary>

src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml

+3-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<Thickness x:Key="ComboBoxBorderThemeThickness">1,1,1,1</Thickness>
2121
<Thickness x:Key="ComboBoxAccentBorderThemeThickness">0,0,0,2</Thickness>
2222
<Thickness x:Key="ComboBoxChevronMargin">8,0,10,0</Thickness>
23-
<Thickness x:Key="ComboBoxItemMargin">3,2,3,0</Thickness>
23+
<Thickness x:Key="ComboBoxItemMargin">6,4,6,0</Thickness>
2424
<Thickness x:Key="ComboBoxItemContentMargin">10,8,8,8</Thickness>
2525
<system:Double x:Key="ComboBoxChevronSize">11.0</system:Double>
2626
<system:Double x:Key="ComboBoxPopupMinHeight">32.0</system:Double>
@@ -92,7 +92,6 @@
9292
<!-- Universal WPF UI focus -->
9393
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForeground}" />
9494
<Setter Property="Background" Value="Transparent" />
95-
<Setter Property="Margin" Value="{StaticResource ComboBoxItemMargin}" />
9695
<Setter Property="Padding" Value="{StaticResource ComboBoxItemContentMargin}" />
9796
<Setter Property="Cursor" Value="Hand" />
9897
<Setter Property="Border.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
@@ -101,10 +100,10 @@
101100
<Setter Property="Template">
102101
<Setter.Value>
103102
<ControlTemplate TargetType="{x:Type ComboBoxItem}">
104-
<Grid>
103+
<Grid Background="Transparent">
105104
<Border
106105
Name="ContentBorder"
107-
Margin="{TemplateBinding Margin}"
106+
Margin="{DynamicResource ComboBoxItemMargin}"
108107
Padding="0"
109108
VerticalAlignment="Stretch"
110109
CornerRadius="{TemplateBinding Border.CornerRadius}"

src/Wpf.Ui/Controls/ContentDialog/ContentDialog.xaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
<Setter Property="DialogMaxWidth" Value="1000" />
2525
<Setter Property="VerticalContentAlignment" Value="Stretch" />
2626
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
27-
<Setter Property="Focusable" Value="False" />
27+
<Setter Property="Focusable" Value="True" />
28+
<Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle" />
29+
<Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle" />
2830
<Setter Property="DialogMargin" Value="35" />
2931
<Setter Property="BorderThickness" Value="1" />
3032
<Setter Property="Foreground" Value="{DynamicResource ContentDialogForeground}" />

src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs

+56-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// Copyright(c) Microsoft Corporation.All rights reserved.
88

99
using System.Collections;
10+
using System.Collections.Specialized;
1011
using System.Windows.Controls;
1112
using Wpf.Ui.Animations;
1213

@@ -82,7 +83,7 @@ public partial class NavigationView
8283
nameof(FooterMenuItemsProperty),
8384
typeof(IList),
8485
typeof(NavigationView),
85-
new FrameworkPropertyMetadata(null)
86+
new FrameworkPropertyMetadata(null, OnFooterMenuItemsPropertyChanged)
8687
);
8788

8889
/// <summary>
@@ -513,16 +514,45 @@ private static void OnMenuItemsPropertyChanged(DependencyObject? d, DependencyPr
513514

514515
if (navigationView.MenuItemsItemsControl is null)
515516
{
517+
navigationView.UpdateCollectionChangedEvent(e.OldValue as IList, e.NewValue as IList);
516518
return;
517519
}
518520

519521
if (navigationView.MenuItemsItemsControl.ItemsSource.Equals(enumerableNewValue))
520522
{
523+
navigationView.UpdateMenuItemsTemplate(enumerableNewValue);
521524
return;
522525
}
523526

524527
navigationView.MenuItemsItemsControl.ItemsSource = null;
525528
navigationView.MenuItemsItemsControl.ItemsSource = enumerableNewValue;
529+
navigationView.UpdateMenuItemsTemplate(enumerableNewValue);
530+
navigationView.AddItemsToDictionaries(enumerableNewValue);
531+
532+
navigationView.UpdateCollectionChangedEvent(e.OldValue as IList, e.NewValue as IList);
533+
}
534+
535+
private void UpdateCollectionChangedEvent(IList? oldMenuItems, IList? newMenuItems)
536+
{
537+
if(oldMenuItems is INotifyCollectionChanged notifyCollection)
538+
{
539+
notifyCollection.CollectionChanged -= OnMenuItems_CollectionChanged;
540+
}
541+
if(newMenuItems is INotifyCollectionChanged newNotifyCollection)
542+
{
543+
newNotifyCollection.CollectionChanged += OnMenuItems_CollectionChanged;
544+
}
545+
}
546+
547+
private void OnMenuItems_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
548+
{
549+
if (e.NewItems is null)
550+
{
551+
return;
552+
}
553+
554+
UpdateMenuItemsTemplate(e.NewItems);
555+
AddItemsToDictionaries(e.NewItems);
526556
}
527557

528558
private static void OnMenuItemsSourcePropertyChanged(
@@ -551,6 +581,31 @@ DependencyPropertyChangedEventArgs e
551581
navigationView.FooterMenuItems = enumerableNewValue;
552582
}
553583

584+
private static void OnFooterMenuItemsPropertyChanged(DependencyObject? d, DependencyPropertyChangedEventArgs e)
585+
{
586+
if (d is not NavigationView navigationView || e.NewValue is not IList enumerableNewValue)
587+
{
588+
return;
589+
}
590+
591+
if (navigationView.FooterMenuItemsItemsControl is null)
592+
{
593+
navigationView.UpdateCollectionChangedEvent(e.OldValue as IList, e.NewValue as IList);
594+
return;
595+
}
596+
597+
if (navigationView.FooterMenuItemsItemsControl.ItemsSource.Equals(enumerableNewValue))
598+
{
599+
return;
600+
}
601+
602+
navigationView.FooterMenuItemsItemsControl.ItemsSource = null;
603+
navigationView.FooterMenuItemsItemsControl.ItemsSource = enumerableNewValue;
604+
navigationView.UpdateMenuItemsTemplate(enumerableNewValue);
605+
navigationView.AddItemsToDictionaries(enumerableNewValue);
606+
navigationView.UpdateCollectionChangedEvent(e.OldValue as IList, e.NewValue as IList);
607+
}
608+
554609
private static void OnPaneDisplayModePropertyChanged(
555610
DependencyObject? d,
556611
DependencyPropertyChangedEventArgs e

src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<Border
1818
x:Name="MainBorder"
1919
Grid.Row="0"
20-
MinWidth="310"
20+
MinWidth="40"
2121
MinHeight="40"
2222
Margin="0"
2323
Padding="0"

src/Wpf.Ui/Controls/NavigationView/NavigationViewLeftMinimalCompact.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<Border
1616
x:Name="MainBorder"
1717
Grid.Row="0"
18-
MinWidth="310"
18+
MinWidth="40"
1919
MinHeight="40"
2020
Margin="0"
2121
Padding="0"

src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml

+5
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
VerticalAlignment="Top"
8383
Content="{TemplateBinding Icon}"
8484
FontSize="16"
85+
IsTabStop="False"
8586
Foreground="{TemplateBinding Foreground}" />
8687
<Grid Grid.Column="1" Margin="{TemplateBinding Padding}">
8788
<Decorator
@@ -115,6 +116,7 @@
115116
Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}"
116117
CommandParameter="clear"
117118
Cursor="Arrow"
119+
IsTabStop="False"
118120
Foreground="{DynamicResource TextControlButtonForeground}">
119121
<controls:Button.Icon>
120122
<controls:SymbolIcon FontSize="{StaticResource NumberBoxButtonIconSize}" Symbol="Dismiss24" />
@@ -138,6 +140,7 @@
138140
CommandParameter="increment"
139141
Cursor="Arrow"
140142
Foreground="{DynamicResource TextControlButtonForeground}"
143+
IsTabStop="False"
141144
Visibility="Collapsed">
142145
<controls:Button.Icon>
143146
<controls:SymbolIcon FontSize="{StaticResource NumberBoxButtonIconSize}" Symbol="ChevronUp24" />
@@ -162,6 +165,7 @@
162165
Cursor="Arrow"
163166
FontSize="{StaticResource NumberBoxButtonIconSize}"
164167
Foreground="{DynamicResource TextControlButtonForeground}"
168+
IsTabStop="False"
165169
Visibility="Collapsed">
166170
<controls:Button.Icon>
167171
<controls:SymbolIcon FontSize="{StaticResource NumberBoxButtonIconSize}" Symbol="ChevronDown24" />
@@ -175,6 +179,7 @@
175179
VerticalAlignment="Top"
176180
Content="{TemplateBinding Icon}"
177181
FontSize="16"
182+
IsTabStop="False"
178183
Foreground="{TemplateBinding Foreground}" />
179184
</Grid>
180185
</Border>

src/Wpf.Ui/Controls/PasswordBox/PasswordBox.xaml

+2
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}"
207207
CommandParameter="clear"
208208
Cursor="Arrow"
209+
IsTabStop="False"
209210
Foreground="{DynamicResource TextControlButtonForeground}">
210211
<controls:Button.Icon>
211212
<controls:SymbolIcon FontSize="{StaticResource PasswordBoxButtonIconSize}" Symbol="Dismiss24" />
@@ -229,6 +230,7 @@
229230
Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}"
230231
CommandParameter="reveal"
231232
Cursor="Arrow"
233+
IsTabStop="False"
232234
Foreground="{DynamicResource TextControlButtonForeground}">
233235
<controls:Button.Icon>
234236
<controls:SymbolIcon FontSize="{StaticResource PasswordBoxButtonIconSize}" Symbol="Eye24" />

0 commit comments

Comments
 (0)