Skip to content

Commit

Permalink
feat: add .Net 6 target framework
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Dec 3, 2021
1 parent fbb8b5b commit 8f82a68
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.x
6.x
- name: List dotnet sdks
run: dotnet --list-sdks
- name: Run the Cake script
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ environment:
secure: BSPdW2TgnQtoQXXbeDECug==

skip_tags: true
image: Visual Studio 2019
image: Visual Studio 2022
test: off

# install:
# - ps: Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'
# - ps: ./dotnet-install.ps1 -Version 5.0.301 -InstallDir "C:\Program Files\dotnet"
# - ps: ./dotnet-install.ps1 -Version 6.0.100 -InstallDir "C:\Program Files\dotnet"

pull_requests:
do_not_increment_build_number: false
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
A toolkit for creating modern WPF applications. Lots of goodness out-of-the box.
</p>
<p>
Supporting .NET Framework (4.5.2 and greater), .NET Core (3.1) and .NET 5 (on Windows)
Supporting .NET Framework 4.6.2 and greater, .NET Core 3.1, .NET 5 and .NET 6 (on Windows)
</p>
<a href="https://www.nuget.org/packages/MahApps.Metro">
<img src="https://img.shields.io/nuget/dt/MahApps.Metro.svg?style=flat-square">
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.Props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- Project properties -->
<PropertyGroup>
<TargetFrameworks>net462;net47;netcoreapp3.1;net5.0-windows</TargetFrameworks>
<TargetFrameworks>net462;net47;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<AutoGenerateBindingRedirects Condition=" $(TargetFramework.StartsWith('net4')) ">true</AutoGenerateBindingRedirects>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<OutputType>WinExe</OutputType>
<NoWarn>SA1652</NoWarn>
<ApplicationIcon>mahapps.metro.logo2.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
<!-- <ApplicationManifest>app.manifest</ApplicationManifest> -->
<ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ public CleanWindowDemo()

private bool closeMe;

#if NET6_0_OR_GREATER
private async void CleanWindowClosing(object? sender, System.ComponentModel.CancelEventArgs e)
#else
private async void CleanWindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
#endif
{
if (e.Cancel)
{
Expand Down Expand Up @@ -92,15 +96,15 @@ private void Button_Click(object sender, RoutedEventArgs e)
this.settingsFlyout.IsOpen = !this.settingsFlyout.IsOpen;
}

private void Button_Click_1(object sender, RoutedEventArgs e)
private async void Button_Click_1(object sender, RoutedEventArgs e)
{
this.ShowMessageAsync("Something",
"Something should be displayed here.",
MessageDialogStyle.Affirmative,
new MetroDialogSettings
{
ColorScheme = MetroDialogColorScheme.Inverted
});
await this.ShowMessageAsync("Something",
"Something should be displayed here.",
MessageDialogStyle.Affirmative,
new MetroDialogSettings
{
ColorScheme = MetroDialogColorScheme.Inverted
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<OutputType>WinExe</OutputType>
<NoWarn>SA1652;WPF0041</NoWarn>
<ApplicationIcon>mahapps.metro.logo2.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
<!-- <ApplicationManifest>app.manifest</ApplicationManifest> -->
<ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public bool IsHamburgerMenuPaneOpen

public ICommand TextBoxButtonCmdWithParameter { get; }

public string? this[string columnName]
public string this[string columnName]
{
get
{
Expand Down Expand Up @@ -384,7 +384,7 @@ public string? this[string columnName]
return "There is something hidden... \nActivate me to show it up.";
}

return null;
return null!;
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/MahApps.Metro/Controls/MetroNavigationWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ private void PART_BackButton_Click(object sender, RoutedEventArgs e)
}

[System.Diagnostics.DebuggerNonUserCode]
#if NET6_0_OR_GREATER
private void MetroNavigationWindow_Closing(object? sender, System.ComponentModel.CancelEventArgs e)
#else
private void MetroNavigationWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
#endif
{
this.PART_Frame.FragmentNavigation -= this.PART_Frame_FragmentNavigation;
this.PART_Frame.Navigating -= this.PART_Frame_Navigating;
Expand Down
2 changes: 1 addition & 1 deletion src/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "5.0.301",
"version": "6.0.100",
"rollForward": "latestFeature"
}
}

0 comments on commit 8f82a68

Please sign in to comment.