Skip to content

Commit 20e0d17

Browse files
.net 9 styles
1 parent 9488b8c commit 20e0d17

16 files changed

+87
-76
lines changed

4_Apps/Styles/Animations/Animations.csproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
4-
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
4+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
55
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
66
<RootNamespace>Animations</RootNamespace>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<Platforms>x86;x64;arm64</Platforms>
9-
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
10-
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
9+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
10+
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
1111
<UseWinUI>true</UseWinUI>
12-
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
12+
<EnableMsixTooling>true</EnableMsixTooling>
1313
<Nullable>enable</Nullable>
1414
<ImplicitUsings>enable</ImplicitUsings>
1515
</PropertyGroup>
@@ -25,8 +25,8 @@
2525
</ItemGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
29-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
28+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
29+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3030
<Manifest Include="$(ApplicationManifest)" />
3131
</ItemGroup>
3232

4_Apps/Styles/Animations/EasingChartControl.xaml.cs

+14-8
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,30 @@ public void Draw(EasingFunctionBase easingFunction)
1616
{
1717
canvas1.Children.Clear();
1818

19-
PathSegmentCollection pathSegments = new();
19+
PathSegmentCollection pathSegments = [];
2020

2121
for (double i = 0; i < 1; i += SamplingInterval)
2222
{
2323
double x = i * canvas1.Width;
2424
double y = easingFunction.Ease(i) * canvas1.Height;
2525

26-
LineSegment segment = new();
27-
segment.Point = new Point(x, y);
26+
LineSegment segment = new()
27+
{
28+
Point = new Point(x, y)
29+
};
2830

2931
pathSegments.Add(segment);
3032
}
3133

32-
XamlShapes.Path p = new();
33-
p.Stroke = new SolidColorBrush(Colors.Black);
34-
p.StrokeThickness = 3;
35-
PathFigureCollection figures = new();
36-
figures.Add(new PathFigure { Segments = pathSegments });
34+
XamlShapes.Path p = new()
35+
{
36+
Stroke = new SolidColorBrush(Colors.Black),
37+
StrokeThickness = 3
38+
};
39+
PathFigureCollection figures =
40+
[
41+
new PathFigure { Segments = pathSegments }
42+
];
3743
p.Data = new PathGeometry { Figures = figures };
3844
canvas1.Children.Add(p);
3945
}

4_Apps/Styles/Brushes/Brushes.csproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
4-
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
4+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
55
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
66
<RootNamespace>Brushes</RootNamespace>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<Platforms>x86;x64;arm64</Platforms>
9-
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
10-
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
9+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
10+
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
1111
<UseWinUI>true</UseWinUI>
12-
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
12+
<EnableMsixTooling>true</EnableMsixTooling>
1313
<Nullable>enable</Nullable>
1414
<ImplicitUsings>enable</ImplicitUsings>
1515
</PropertyGroup>
@@ -25,8 +25,8 @@
2525
</ItemGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
29-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
28+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
29+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3030
<Manifest Include="$(ApplicationManifest)" />
3131
</ItemGroup>
3232

4_Apps/Styles/Geometries/Geometries.csproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
4-
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
4+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
55
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
66
<RootNamespace>Geometries</RootNamespace>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<Platforms>x86;x64;arm64</Platforms>
9-
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
10-
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
9+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
10+
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
1111
<UseWinUI>true</UseWinUI>
12-
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
12+
<EnableMsixTooling>true</EnableMsixTooling>
1313
<Nullable>enable</Nullable>
1414
<ImplicitUsings>enable</ImplicitUsings>
1515
</PropertyGroup>
@@ -25,8 +25,8 @@
2525
</ItemGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
29-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
28+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
29+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3030
<Manifest Include="$(ApplicationManifest)" />
3131
</ItemGroup>
3232

4_Apps/Styles/Models/CountryRepository.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ public sealed class CountryRepository
44
{
55
private static IEnumerable<Country>? s_countries;
66

7-
public IEnumerable<Country> GetCountries() => s_countries ??= new List<Country>
8-
{
7+
public IEnumerable<Country> GetCountries() => s_countries ??=
8+
[
99
new() { Name = "Austria", ImagePath = "/Images/Austria.bmp" },
1010
new() { Name = "Germany", ImagePath = "/Images/Germany.bmp" },
1111
new() { Name = "Norway", ImagePath = "/Images/Norway.bmp" },
1212
new() { Name = "USA", ImagePath = "/Images/USA.bmp" }
13-
};
13+
];
1414
}

4_Apps/Styles/Models/Models.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>

4_Apps/Styles/Shapes/MainWindow.xaml.cs

+9-4
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,22 @@ public void SetMouth()
2222
{
2323
int index = _laugh ? 0 : 1;
2424

25-
PathFigure figure = new() { StartPoint = _mouthPoints[index, 0] };
26-
figure.Segments = new PathSegmentCollection();
25+
PathFigure figure = new()
26+
{
27+
StartPoint = _mouthPoints[index, 0],
28+
Segments = []
29+
};
2730
QuadraticBezierSegment segment1 = new()
2831
{
2932
Point1 = _mouthPoints[index, 1],
3033
Point2 = _mouthPoints[index, 2]
3134
};
3235

3336
figure.Segments.Add(segment1);
34-
PathGeometry geometry = new();
35-
geometry.Figures = new PathFigureCollection();
37+
PathGeometry geometry = new()
38+
{
39+
Figures = []
40+
};
3641
geometry.Figures.Add(figure);
3742

3843
mouth.Data = geometry;

4_Apps/Styles/Shapes/Shapes.csproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
4-
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
4+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
55
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
66
<RootNamespace>Shapes</RootNamespace>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<Platforms>x86;x64;arm64</Platforms>
9-
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
10-
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
9+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
10+
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
1111
<UseWinUI>true</UseWinUI>
12-
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
12+
<EnableMsixTooling>true</EnableMsixTooling>
1313
<Nullable>enable</Nullable>
1414
<ImplicitUsings>enable</ImplicitUsings>
1515
</PropertyGroup>
@@ -25,8 +25,8 @@
2525
</ItemGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
29-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
28+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
29+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3030
<Manifest Include="$(ApplicationManifest)" />
3131
</ItemGroup>
3232

4_Apps/Styles/StylesAndResources/App.xaml.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ public partial class App : Application
88

99
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
1010
{
11-
m_window = new MainWindow();
12-
m_window.Activate();
11+
_window = new MainWindow();
12+
_window.Activate();
1313
}
1414

15-
private Window? m_window;
15+
private Window? _window;
1616
}

4_Apps/Styles/StylesAndResources/StylesAndResources.csproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
4-
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
4+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
55
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
66
<RootNamespace>StylesAndResources</RootNamespace>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<Platforms>x86;x64;arm64</Platforms>
9-
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
10-
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
9+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
10+
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
1111
<UseWinUI>true</UseWinUI>
12-
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
12+
<EnableMsixTooling>true</EnableMsixTooling>
1313
<Nullable>enable</Nullable>
1414
<ImplicitUsings>enable</ImplicitUsings>
1515
</PropertyGroup>
@@ -25,8 +25,8 @@
2525
</ItemGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
29-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
28+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
29+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3030
<Manifest Include="$(ApplicationManifest)" />
3131
</ItemGroup>
3232

4_Apps/Styles/Templates/Templates.csproj

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
4-
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
4+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
55
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
66
<RootNamespace>Template</RootNamespace>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<Platforms>x86;x64;arm64</Platforms>
9-
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
10-
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
9+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
10+
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
1111
<UseWinUI>true</UseWinUI>
12-
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
12+
<EnableMsixTooling>true</EnableMsixTooling>
1313
<Nullable>enable</Nullable>
1414
<ImplicitUsings>enable</ImplicitUsings>
15+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1516
</PropertyGroup>
1617

1718
<ItemGroup>
@@ -25,8 +26,8 @@
2526
</ItemGroup>
2627

2728
<ItemGroup>
28-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
29-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
29+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
30+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3031
<Manifest Include="$(ApplicationManifest)" />
3132
</ItemGroup>
3233

4_Apps/Styles/Templates/Views/StyledListUserControl.xaml.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ namespace Templates.Views
99
{
1010
public sealed partial class StyledListUserControl : UserControl
1111
{
12-
public ObservableCollection<Country> Countries { get; } =
13-
new ObservableCollection<Country>();
12+
public ObservableCollection<Country> Countries { get; } =[];
1413

1514
public StyledListUserControl()
1615
{

4_Apps/Styles/Transformations/Transformations.csproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
5+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
66
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
77
<RootNamespace>Transformations</RootNamespace>
88
<ApplicationManifest>app.manifest</ApplicationManifest>
99
<Platforms>x86;x64;arm64</Platforms>
10-
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
11-
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
10+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
11+
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
1212
<UseWinUI>true</UseWinUI>
13-
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
13+
<EnableMsixTooling>true</EnableMsixTooling>
1414
<Nullable>enable</Nullable>
1515
<ImplicitUsings>enable</ImplicitUsings>
1616
</PropertyGroup>
@@ -26,8 +26,8 @@
2626
</ItemGroup>
2727

2828
<ItemGroup>
29-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
30-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
29+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
30+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3131
<Manifest Include="$(ApplicationManifest)" />
3232
</ItemGroup>
3333

4_Apps/Styles/Transitions/Transitions.csproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
4-
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
4+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
55
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
66
<RootNamespace>Transitions</RootNamespace>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<Platforms>x86;x64;arm64</Platforms>
9-
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
10-
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
9+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
10+
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
1111
<UseWinUI>true</UseWinUI>
12-
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
12+
<EnableMsixTooling>true</EnableMsixTooling>
1313
<Nullable>enable</Nullable>
1414
<ImplicitUsings>enable</ImplicitUsings>
1515
</PropertyGroup>
@@ -25,8 +25,8 @@
2525
</ItemGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
29-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
28+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
29+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3030
<Manifest Include="$(ApplicationManifest)" />
3131
</ItemGroup>
3232

4_Apps/Styles/Transitions/Views/ListItemsUserControl.xaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ private void OnAdd(object sender, RoutedEventArgs e)
1717
}
1818

1919
private Rectangle CreateRectangle() =>
20-
new Rectangle
20+
new()
2121
{
2222
Width = 90,
2323
Height = 40,

0 commit comments

Comments
 (0)