Skip to content

Commit 9e3a3e6

Browse files
.net 8 winui
1 parent e0035d0 commit 9e3a3e6

File tree

19 files changed

+59
-71
lines changed

19 files changed

+59
-71
lines changed

4_Apps/Windows/ControlsSamples/ControlsSamples/ControlsSamples.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>ControlsSamples</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/Windows/ControlsSamples/ControlsSamples/Views/ButtonsPage.xaml.cs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
using Microsoft.UI.Xaml;
22
using Microsoft.UI.Xaml.Controls;
33

4-
using Windows.UI.Popups;
5-
6-
using WinRT.Interop;
7-
84
namespace ControlsSamples.Views
95
{
106
public sealed partial class ButtonsPage : Page
@@ -18,7 +14,7 @@ private async void OnButtonClick(object sender, RoutedEventArgs e)
1814
Title = "Message",
1915
Content = "button 1 clicked",
2016
PrimaryButtonText = "OK",
21-
XamlRoot = this.Content.XamlRoot
17+
XamlRoot = Content.XamlRoot
2218
};
2319
await dlg.ShowAsync();
2420
}

4_Apps/Windows/ControlsSamples/ControlsSamples/Views/DateSelectionPage.xaml.cs

+4-7
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
using System.Globalization;
55

66
using Windows.UI;
7-
using Windows.UI.Popups;
8-
9-
using WinRT.Interop;
107

118
namespace ControlsSamples.Views;
129

@@ -60,7 +57,7 @@ async void SetBookings()
6057
var booking = bookings.SingleOrDefault(b => b.day.Date == item.Date.Date);
6158
if (booking.bookings > 0)
6259
{
63-
List<Color> colors = new();
60+
List<Color> colors = [];
6461
for (int i = 0; i < booking.bookings; i++)
6562
{
6663
if (item.Date.DayOfWeek == DayOfWeek.Saturday || item.Date.DayOfWeek == DayOfWeek.Sunday)
@@ -80,16 +77,16 @@ async void SetBookings()
8077

8178
private IEnumerable<(DateTimeOffset day, int bookings)> GetBookings()
8279
{
83-
int[] bookingDays = { 2, 3, 5, 8, 12, 13, 18, 21, 23, 27 };
84-
int[] bookingsPerDay = { 1, 4, 3, 6, 4, 5, 1, 3, 1, 1 };
80+
int[] bookingDays = [2, 3, 5, 8, 12, 13, 18, 21, 23, 27];
81+
int[] bookingsPerDay = [1, 4, 3, 6, 4, 5, 1, 3, 1, 1];
8582

8683
for (int i = 0; i < 10; i++)
8784
{
8885
yield return (DateTimeOffset.Now.Date.AddDays(bookingDays[i]), bookingsPerDay[i]);
8986
}
9087
}
9188

92-
private readonly List<DateTimeOffset> currentDatesSelected = new();
89+
private readonly List<DateTimeOffset> currentDatesSelected = [];
9390

9491
private async void OnDatesChanged(CalendarView sender, CalendarViewSelectedDatesChangedEventArgs args)
9592
{

4_Apps/Windows/ControlsSamples/ControlsSamples/Views/RangeControlsPage.xaml.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ public RangeControlsPage()
1313

1414
private void ShowProgress()
1515
{
16-
DispatcherTimer timer = new();
17-
timer.Interval = TimeSpan.FromSeconds(1);
16+
DispatcherTimer timer = new()
17+
{
18+
Interval = TimeSpan.FromSeconds(1)
19+
};
1820
int i = 0;
1921
timer.Tick += (sender, e) =>
2022
progressBar1.Value = i++ % 100;

4_Apps/Windows/DataBindingSamples/DataBindingSamples/DataBindingSamples.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>DataBindingSamples</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

Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
11
namespace DataBindingSamples.Models;
22

3-
public class Book : ObservableObject
3+
public partial class Book(int id, string title, string publisher, params string[] authors) : ObservableObject
44
{
5-
public Book(int id, string title, string publisher, params string[] authors)
6-
{
7-
BookId = id;
8-
_title = title;
9-
_publisher = publisher;
10-
Authors = authors;
11-
}
12-
13-
public int BookId { get; }
14-
private string _title;
5+
public int BookId { get; } = id;
6+
private string _title = title;
157

168
public string Title
179
{
1810
get => _title;
1911
set => SetProperty(ref _title, value);
2012
}
2113

22-
private string _publisher;
14+
private string _publisher = publisher;
2315
public string Publisher
2416
{
2517
get => _publisher;
2618
set => SetProperty(ref _publisher, value);
2719
}
28-
public IEnumerable<string> Authors { get; }
20+
public IEnumerable<string> Authors { get; } = authors;
2921

3022
public override string ToString() => Title;
3123
}

4_Apps/Windows/DataBindingSamples/DataBindingSamples/Services/BooksService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace DataBindingSamples.Services;
66

77
public class BooksService
88
{
9-
private readonly ObservableCollection<Book> _books = new();
9+
private readonly ObservableCollection<Book> _books = [];
1010

1111
public void RefreshBooks()
1212
{

4_Apps/Windows/DataBindingSamples/DataBindingSamples/Services/SampleBooksService.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ namespace DataBindingSamples.Services;
44

55
public class SampleBooksService
66
{
7-
private readonly List<Book> _books = new()
8-
{
7+
private readonly List<Book> _books =
8+
[
99
new(1, "Professional C# and .NET - 2021 Edition", "Wrox Press", "Christian Nagel"),
1010
new(2, "Professional C# 7 and .NET Core 2", "Wrox Press", "Christian Nagel"),
1111
new(3, "Professional C# 6 and .NET Core 1.0", "Wrox Press", "Christian Nagel"),
1212
new(4, "Professional C# 5.0 and .NET 4.5.1", "Wrox Press", "Christian Nagel", "Jay Glynn", "Morgan Skinner"),
1313
new(5, "Enterprise Services with the .NET Framework", "AWL", "Christian Nagel")
14-
};
14+
];
1515
public IEnumerable<Book> GetSampleBooks() => _books;
1616
}

4_Apps/Windows/DataBindingSamples/DataBindingSamples/Utilities/BookTemplateSelector.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace DataBindingSamples.Utilities;
66

7-
public class BookTemplateSelector : DataTemplateSelector
7+
public partial class BookTemplateSelector : DataTemplateSelector
88
{
99
public DataTemplate? WroxTemplate { get; set; }
1010
public DataTemplate? DefaultTemplate { get; set; }

4_Apps/Windows/DataBindingSamples/DataBindingSamples/Utilities/CollectionToStringConverter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace DataBindingSamples.Utilities;
44

5-
public class CollectionToStringConverter : IValueConverter
5+
public partial class CollectionToStringConverter : IValueConverter
66
{
77
public object Convert(object value, Type targetType, object parameter, string language)
88
{

4_Apps/Windows/LayoutSamples/LayoutSamples/LayoutSamples.csproj

+4-4
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>LayoutSamples</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>

4_Apps/Windows/NavigationControls/NavigationControls/NavigationControls.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>NavigationControls</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/Windows/XAMLIntro/AttachedProperty/AttachedProperty/AttachedProperty.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
</ItemGroup>
2424

2525
<ItemGroup>
26-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
27-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
26+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
27+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
2828
<Manifest Include="$(ApplicationManifest)" />
2929
</ItemGroup>
3030

4_Apps/Windows/XAMLIntro/CustomMarkupExtensions/CustomMarkupExtensions/CustomMarkupExtensions.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
1010
<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>
@@ -33,8 +33,8 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
37-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
36+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
37+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3838
<Manifest Include="$(ApplicationManifest)" />
3939
</ItemGroup>
4040

4_Apps/Windows/XAMLIntro/DependencyObjectSample/DependencyObjectSample/DependencyObjectSample.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
37-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
36+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
37+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3838
<Manifest Include="$(ApplicationManifest)" />
3939
</ItemGroup>
4040

4_Apps/Windows/XAMLIntro/HelloWindows/HelloWindows/HelloWindows.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
37-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
36+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
37+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3838
<Manifest Include="$(ApplicationManifest)" />
3939
</ItemGroup>
4040

4_Apps/Windows/XAMLIntro/Intro/Intro/Intro/Intro.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
3232
</ItemGroup>
3333
<ItemGroup>
34-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
35-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
34+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
35+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3636
<Manifest Include="$(ApplicationManifest)" />
3737
</ItemGroup>
3838
<!-- Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging

4_Apps/Windows/XAMLIntro/MarkupExtensions/MarkupExtensions/MarkupExtensions.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
37-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
36+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
37+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3838
<Manifest Include="$(ApplicationManifest)" />
3939
</ItemGroup>
4040

4_Apps/Windows/XAMLIntro/RoutedEvents/RoutedEvents/RoutedEvents.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<Platforms>x86;x64;arm64</Platforms>
99
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
10-
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
10+
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
1111
<UseWinUI>true</UseWinUI>
1212
<EnableMsixTooling>true</EnableMsixTooling>
1313
<Nullable>enable</Nullable>
@@ -33,8 +33,8 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
37-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
36+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
37+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
3838
<Manifest Include="$(ApplicationManifest)" />
3939
</ItemGroup>
4040

0 commit comments

Comments
 (0)