Skip to content

Commit 39a9ca5

Browse files
add Net6 to all projects (#2632)
* Target dot net 6 for all projects * Update nuget packages to latest version * Fixing nullability warnings * Bumping up global.jon Updating XAMLTest to latest Co-authored-by: Kevin Bost <[email protected]>
1 parent 8af6429 commit 39a9ca5

24 files changed

+87
-85
lines changed

Directory.packages.props

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
<ItemGroup>
33
<PackageVersion Include="BluwolfIcons" Version="1.0.1" />
44
<PackageVersion Include="Dragablz" Version="0.0.3.223" />
5-
<PackageVersion Include="Humanizer" Version="2.11.10" />
6-
<PackageVersion Include="MahApps.Metro" Version="2.3.0" />
7-
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2" PrivateAssets="all" />
8-
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="3.11.0" />
9-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" />
10-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.11.0" />
11-
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="3.11.0" />
5+
<PackageVersion Include="Humanizer" Version="2.14.1" />
6+
<PackageVersion Include="MahApps.Metro" Version="2.4.9" />
7+
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
8+
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.1.0" />
9+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" />
10+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.1.0" />
11+
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.1.0" />
1212
<PackageVersion Include="Microsoft.Composition" Version="1.0.31" />
1313
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
1414
<PackageVersion Include="Microsoft.NETCore.Platforms" Version="5.0.0" />
15-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
16-
<PackageVersion Include="Microsoft.Toolkit.MVVM" Version="7.0.2" />
17-
<PackageVersion Include="Newtonsoft.Json" Version="12.0.3" />
15+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
16+
<PackageVersion Include="Microsoft.Toolkit.MVVM" Version="7.1.2" />
17+
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
1818
<PackageVersion Include="Shouldly" Version="4.0.3" />
1919
<PackageVersion Include="ShowMeTheXAML" Version="2.0.0" />
2020
<PackageVersion Include="ShowMeTheXAML.AvalonEdit" Version="2.0.0" />
2121
<PackageVersion Include="ShowMeTheXAML.MSBuild" Version="2.0.0" />
22-
<PackageVersion Include="VirtualizingWrapPanel" Version="1.5.4" />
23-
<PackageVersion Include="XAMLTest" Version="1.0.0-ci221" />
22+
<PackageVersion Include="VirtualizingWrapPanel" Version="1.5.7" />
23+
<PackageVersion Include="XAMLTest" Version="1.0.0-ci233" />
2424
<PackageVersion Include="xunit" Version="2.4.1" />
2525
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.3" />
26-
<PackageVersion Include="Xunit.StaFact" Version="1.0.37" />
26+
<PackageVersion Include="Xunit.StaFact" Version="1.1.11" />
2727
</ItemGroup>
2828
</Project>

MahMaterialDragablzMashUp/AnotherCommandImplementation.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@ namespace MahMaterialDragablzMashUp
88
/// </summary>
99
public class AnotherCommandImplementation : ICommand
1010
{
11-
private readonly Action<object> _execute;
12-
private readonly Func<object, bool> _canExecute;
11+
private readonly Action<object?> _execute;
12+
private readonly Func<object?, bool> _canExecute;
1313

14-
public AnotherCommandImplementation(Action<object> execute)
14+
public AnotherCommandImplementation(Action<object?> execute)
1515
: this(execute, null)
1616
{
1717
}
1818

19-
public AnotherCommandImplementation(Action<object> execute, Func<object, bool>? canExecute)
19+
public AnotherCommandImplementation(Action<object?> execute, Func<object?, bool>? canExecute)
2020
{
2121
if (execute is null) throw new ArgumentNullException(nameof(execute));
2222

2323
_execute = execute;
2424
_canExecute = canExecute ?? (x => true);
2525
}
2626

27-
public bool CanExecute(object parameter) => _canExecute(parameter);
27+
public bool CanExecute(object? parameter) => _canExecute(parameter);
2828

29-
public void Execute(object parameter) => _execute(parameter);
29+
public void Execute(object? parameter) => _execute(parameter);
3030

31-
public event EventHandler CanExecuteChanged
31+
public event EventHandler? CanExecuteChanged
3232
{
3333
add
3434
{

MahMaterialDragablzMashUp/MahAppsDragablzDemo.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2+
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
5+
<TargetFrameworks>net472;netcoreapp3.1;net6.0-windows</TargetFrameworks>
66
<UseWPF>true</UseWPF>
77
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
88
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

MahMaterialDragablzMashUp/PaletteSelectorViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ public PaletteSelectorViewModel()
2323
IsDarkTheme = theme.GetBaseTheme() == BaseTheme.Dark;
2424
}
2525

26-
public ICommand ToggleStyleCommand { get; } = new AnotherCommandImplementation(o => ApplyStyle((bool)o));
26+
public ICommand ToggleStyleCommand { get; } = new AnotherCommandImplementation(o => ApplyStyle((bool)o!));
2727

2828
public IEnumerable<Swatch> Swatches { get; }
2929

30-
public ICommand ApplyPrimaryCommand { get; } = new AnotherCommandImplementation(o => ApplyPrimary((Swatch)o));
30+
public ICommand ApplyPrimaryCommand { get; } = new AnotherCommandImplementation(o => ApplyPrimary((Swatch)o!));
3131

32-
public ICommand ApplyAccentCommand { get; } = new AnotherCommandImplementation(o => ApplyAccent((Swatch)o));
32+
public ICommand ApplyAccentCommand { get; } = new AnotherCommandImplementation(o => ApplyAccent((Swatch)o!));
3333

3434
private bool _isDarkTheme;
3535
public bool IsDarkTheme

MainDemo.Wpf/Domain/AnotherCommandImplementation.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@ namespace MaterialDesignDemo.Domain
88
/// </summary>
99
public class AnotherCommandImplementation : ICommand
1010
{
11-
private readonly Action<object> _execute;
12-
private readonly Func<object, bool> _canExecute;
11+
private readonly Action<object?> _execute;
12+
private readonly Func<object?, bool> _canExecute;
1313

14-
public AnotherCommandImplementation(Action<object> execute)
14+
public AnotherCommandImplementation(Action<object?> execute)
1515
: this(execute, null)
1616
{ }
1717

18-
public AnotherCommandImplementation(Action<object> execute, Func<object, bool>? canExecute)
18+
public AnotherCommandImplementation(Action<object?> execute, Func<object?, bool>? canExecute)
1919
{
2020
if (execute is null) throw new ArgumentNullException(nameof(execute));
2121

2222
_execute = execute;
2323
_canExecute = canExecute ?? (x => true);
2424
}
2525

26-
public bool CanExecute(object parameter) => _canExecute(parameter);
26+
public bool CanExecute(object? parameter) => _canExecute(parameter);
2727

28-
public void Execute(object parameter) => _execute(parameter);
28+
public void Execute(object? parameter) => _execute(parameter);
2929

30-
public event EventHandler CanExecuteChanged
30+
public event EventHandler? CanExecuteChanged
3131
{
3232
add
3333
{

MainDemo.Wpf/Domain/ColorToolViewModel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private void ApplyBase(bool isDark)
7777

7878
public ColorToolViewModel()
7979
{
80-
ToggleBaseCommand = new AnotherCommandImplementation(o => ApplyBase((bool)o));
80+
ToggleBaseCommand = new AnotherCommandImplementation(o => ApplyBase((bool)o!));
8181
ChangeHueCommand = new AnotherCommandImplementation(ChangeHue);
8282
ChangeCustomHueCommand = new AnotherCommandImplementation(ChangeCustomColor);
8383
ChangeToPrimaryCommand = new AnotherCommandImplementation(o => ChangeScheme(ColorScheme.Primary));
@@ -94,9 +94,9 @@ public ColorToolViewModel()
9494
SelectedColor = _primaryColor;
9595
}
9696

97-
private void ChangeCustomColor(object obj)
97+
private void ChangeCustomColor(object? obj)
9898
{
99-
var color = (Color)obj;
99+
var color = (Color)obj!;
100100

101101
if (ActiveScheme == ColorScheme.Primary)
102102
{
@@ -149,9 +149,9 @@ private void ChangeScheme(ColorScheme scheme)
149149

150150
private Color? _secondaryForegroundColor;
151151

152-
private void ChangeHue(object obj)
152+
private void ChangeHue(object? obj)
153153
{
154-
var hue = (Color)obj;
154+
var hue = (Color)obj!;
155155

156156
SelectedColor = hue;
157157
if (ActiveScheme == ColorScheme.Primary)

MainDemo.Wpf/Domain/DialogsViewModel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public DialogsViewModel()
2222

2323
public ICommand RunExtendedDialogCommand => new AnotherCommandImplementation(ExecuteRunExtendedDialog);
2424

25-
private async void ExecuteRunDialog(object o)
25+
private async void ExecuteRunDialog(object? _)
2626
{
2727
//let's set up a little MVVM, cos that's what the cool kids are doing:
2828
var view = new SampleDialog
@@ -40,7 +40,7 @@ private async void ExecuteRunDialog(object o)
4040
private void ClosingEventHandler(object sender, DialogClosingEventArgs eventArgs)
4141
=> Debug.WriteLine("You can intercept the closing event, and cancel here.");
4242

43-
private async void ExecuteRunExtendedDialog(object o)
43+
private async void ExecuteRunExtendedDialog(object? _)
4444
{
4545
//let's set up a little MVVM, cos that's what the cool kids are doing:
4646
var view = new SampleDialog
@@ -100,15 +100,15 @@ public object? Sample4Content
100100
set => SetProperty(ref _sample4Content, value);
101101
}
102102

103-
private void OpenSample4Dialog(object obj)
103+
private void OpenSample4Dialog(object? _)
104104
{
105105
Sample4Content = new Sample4Dialog();
106106
IsSample4DialogOpen = true;
107107
}
108108

109-
private void CancelSample4Dialog(object obj) => IsSample4DialogOpen = false;
109+
private void CancelSample4Dialog(object? _) => IsSample4DialogOpen = false;
110110

111-
private void AcceptSample4Dialog(object obj)
111+
private void AcceptSample4Dialog(object? _)
112112
{
113113
//pretend to do something for 3 seconds, then close
114114
Sample4Content = new SampleProgressDialog();

MainDemo.Wpf/Domain/DocumentationLink.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static DocumentationLink DemoPageLink<TDemoPage>(string? label, string? @
8585

8686
public ICommand Open { get; }
8787

88-
private void Execute(object o)
88+
private void Execute(object? _)
8989
{
9090
Link.OpenInBrowser(Url);
9191
}

MainDemo.Wpf/Domain/IconPackViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ public PackIconKind PackIconKind
9090
set => SetProperty(ref _packIconKind, value);
9191
}
9292

93-
private void OpenDotCom(object obj)
93+
private void OpenDotCom(object? _)
9494
=> Link.OpenInBrowser("https://materialdesignicons.com/");
9595

96-
private async void Search(object obj)
96+
private async void Search(object? obj)
9797
{
9898
var text = obj as string;
9999
if (string.IsNullOrWhiteSpace(text))
@@ -108,7 +108,7 @@ private async void Search(object obj)
108108
}
109109
}
110110

111-
private void CopyToClipboard(object obj)
111+
private void CopyToClipboard(object? obj)
112112
{
113113
var toBeCopied = $"<materialDesign:PackIcon Kind=\"{obj}\" />";
114114
Clipboard.SetDataObject(toBeCopied);
@@ -140,7 +140,7 @@ public Color GeneratedIconForeground
140140
private ICommand? _saveIconCommand;
141141
public ICommand SaveIconCommand => _saveIconCommand ??= new AnotherCommandImplementation(OnSaveIcon);
142142

143-
private void OnSaveIcon(object _)
143+
private void OnSaveIcon(object? _)
144144
{
145145
var saveDialog = new SaveFileDialog
146146
{

MainDemo.Wpf/Domain/Link.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ namespace MaterialDesignDemo.Domain
55
{
66
public static class Link
77
{
8-
public static void OpenInBrowser(string url)
8+
public static void OpenInBrowser(string? url)
99
{
10+
if (url is null) return;
1011
//https://github.com/dotnet/corefx/issues/10361
1112
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
1213
{

0 commit comments

Comments
 (0)