Skip to content
This repository was archived by the owner on Nov 15, 2021. It is now read-only.

Commit f6bec56

Browse files
committed
Add support for .NET 6
1 parent 50638e1 commit f6bec56

35 files changed

+894
-1122
lines changed

.github/dependabot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
8+
updates:
9+
# Maintain dependencies for GitHub Actions
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
schedule:
13+
interval: "daily"
14+
15+
# Maintain dependencies for nuget
16+
- package-ecosystem: "nuget"
17+
directory: "MaterialWPF/"
18+
schedule:
19+
interval: "daily"
20+
21+
# Maintain dependencies for nuget
22+
- package-ecosystem: "nuget"
23+
directory: "MaterialWPF.Demo/"
24+
schedule:
25+
interval: "daily"
26+
27+
# Maintain dependencies for nuget
28+
- package-ecosystem: "npm"
29+
directory: "Assets/"
30+
schedule:
31+
interval: "daily"

.github/workflows/main.yml renamed to .github/workflows/CI.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
1-
# This is a basic workflow to help you get started with Actions
2-
1+
# Taken from LibreHardwareMonitor https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/blob/master/.github/workflows/main.yml
32
name: CI
43

5-
# Controls when the action will run.
64
on:
7-
# Triggers the workflow on push or pull request events but only for the master branch
85
push:
96
branches: [ master ]
107
pull_request:
118
branches: [ master ]
129

13-
# Allows you to run this workflow manually from the Actions tab
1410
workflow_dispatch:
1511

16-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1712
jobs:
18-
# This workflow contains a single job called "build"
1913
build:
20-
# The type of runner that the job will run on
21-
runs-on: windows-latest
14+
runs-on: windows-2022
2215
if: contains(github.event.head_commit.message, 'ci skip') == false
2316

24-
# Steps represent a sequence of tasks that will be executed as part of the job
2517
steps:
26-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2718
- uses: actions/checkout@v2
2819
- uses: nuget/setup-nuget@v1
29-
- uses: microsoft/[email protected]
30-
31-
# Taken from LibreHardwareMonitor https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/blob/master/.github/workflows/main.yml
20+
with:
21+
nuget-version: 'latest'
22+
- uses: microsoft/[email protected]
23+
with:
24+
msbuild-architecture: x64
3225
- uses: dorny/paths-filter@v2
3326
id: changes
3427
with:
@@ -80,4 +73,4 @@ jobs:
8073
VERSION_FILE_PATH: Directory.Build.props
8174
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
8275
INCLUDE_SYMBOLS: false
83-
TAG_COMMIT: false
76+
TAG_COMMIT: false

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>1.0.4</Version>
3+
<Version>1.0.5</Version>
44
<Copyright>MaterialWPF</Copyright>
55
</PropertyGroup>
66
</Project>

MaterialWPF.Demo/MaterialWPF.Demo.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net5.0-windows10.0.17763.0</TargetFramework>
5+
<TargetFramework>net6.0-windows10.0.22000.0</TargetFramework>
66
<UseWPF>true</UseWPF>
77
<StartupObject>MaterialWPF.Demo.App</StartupObject>
88
<ApplicationIcon>material_wpf.ico</ApplicationIcon>
9+
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
910
</PropertyGroup>
1011

1112
<ItemGroup>

MaterialWPF/Controls/Card.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
// Copyright (C) Leszek Pomianowski and MaterialWPF Contributors.
44
// All Rights Reserved.
55

6-
using System;
7-
using System.Windows;
8-
96
namespace MaterialWPF.Controls
107
{
11-
public partial class Card : System.Windows.Controls.Grid
12-
{}
8+
public class Card : System.Windows.Controls.Grid
9+
{ }
1310
}

MaterialWPF/Controls/Dialog.cs

Lines changed: 28 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,33 @@
99

1010
namespace MaterialWPF.Controls
1111
{
12-
public partial class Dialog : System.Windows.Controls.ContentControl
12+
public class Dialog : System.Windows.Controls.ContentControl
1313
{
1414
private bool _status = false;
15-
15+
1616
private Action
1717
_closeButtonClickAction = null,
1818
_actionButtonClickAction = null;
1919

2020
public static readonly DependencyProperty
21-
EnabledProperty = DependencyProperty.Register("Enabled", typeof(bool), typeof(Controls.Dialog), new PropertyMetadata(false)),
22-
CloseButtonTextProperty = DependencyProperty.Register("CloseButtonText", typeof(string), typeof(Controls.Dialog), new PropertyMetadata("Close")),
23-
CloseButtonGlyphProperty = DependencyProperty.Register("CloseButtonGlyph", typeof(char), typeof(Controls.Dialog), new PropertyMetadata(UI.MiconIcons.Cancel)),
24-
CloseButtonCommandProperty = DependencyProperty.Register("CloseButtonCommand", typeof(ICommand), typeof(Controls.Dialog), new UIPropertyMetadata(null)),
25-
ActionButtonTextProperty = DependencyProperty.Register("ActionButtonText", typeof(string), typeof(Controls.Dialog), new PropertyMetadata("Action Button")),
26-
ActionButtonGlyphProperty = DependencyProperty.Register("ActionButtonGlyph", typeof(char), typeof(Controls.Dialog), new PropertyMetadata(UI.MiconIcons.Accept)),
27-
ActionButtonCommandProperty = DependencyProperty.Register("ActionButtonCommand", typeof(ICommand), typeof(Controls.Dialog), new UIPropertyMetadata(null));
21+
EnabledProperty = DependencyProperty.Register("Enabled", typeof(bool), typeof(Controls.Dialog),
22+
new PropertyMetadata(false)),
23+
CloseButtonTextProperty = DependencyProperty.Register("CloseButtonText", typeof(string),
24+
typeof(Controls.Dialog), new PropertyMetadata("Close")),
25+
CloseButtonGlyphProperty = DependencyProperty.Register("CloseButtonGlyph", typeof(char),
26+
typeof(Controls.Dialog), new PropertyMetadata(UI.MiconIcons.Cancel)),
27+
CloseButtonCommandProperty = DependencyProperty.Register("CloseButtonCommand", typeof(ICommand),
28+
typeof(Controls.Dialog), new UIPropertyMetadata(null)),
29+
ActionButtonTextProperty = DependencyProperty.Register("ActionButtonText", typeof(string),
30+
typeof(Controls.Dialog), new PropertyMetadata("Action Button")),
31+
ActionButtonGlyphProperty = DependencyProperty.Register("ActionButtonGlyph", typeof(char),
32+
typeof(Controls.Dialog), new PropertyMetadata(UI.MiconIcons.Accept)),
33+
ActionButtonCommandProperty = DependencyProperty.Register("ActionButtonCommand", typeof(ICommand),
34+
typeof(Controls.Dialog), new UIPropertyMetadata(null));
2835

2936
public bool? Enabled
3037
{
31-
get
32-
{
33-
return this.GetValue(EnabledProperty) as bool?;
34-
}
38+
get { return this.GetValue(EnabledProperty) as bool?; }
3539
set
3640
{
3741
this.SetValue(EnabledProperty, value);
@@ -51,66 +55,36 @@ public bool? Enabled
5155

5256
public string CloseButtonText
5357
{
54-
get
55-
{
56-
return this.GetValue(CloseButtonTextProperty) as string;
57-
}
58-
set
59-
{
60-
this.SetValue(CloseButtonTextProperty, value);
61-
}
58+
get { return this.GetValue(CloseButtonTextProperty) as string; }
59+
set { this.SetValue(CloseButtonTextProperty, value); }
6260
}
6361

6462
public char CloseButtonGlyph
6563
{
66-
get
67-
{
68-
return (char)(this.GetValue(CloseButtonGlyphProperty) as char?);
69-
}
70-
set
71-
{
72-
this.SetValue(CloseButtonGlyphProperty, value);
73-
}
64+
get { return (char)(this.GetValue(CloseButtonGlyphProperty) as char?); }
65+
set { this.SetValue(CloseButtonGlyphProperty, value); }
7466
}
7567

7668
public string ActionButtonText
7769
{
78-
get
79-
{
80-
return this.GetValue(ActionButtonTextProperty) as string;
81-
}
82-
set
83-
{
84-
this.SetValue(ActionButtonTextProperty, value);
85-
}
70+
get { return this.GetValue(ActionButtonTextProperty) as string; }
71+
set { this.SetValue(ActionButtonTextProperty, value); }
8672
}
8773

8874
public char ActionButtonGlyph
8975
{
90-
get
91-
{
92-
return (char)(this.GetValue(ActionButtonGlyphProperty) as char?);
93-
}
94-
set
95-
{
96-
this.SetValue(ActionButtonGlyphProperty, value);
97-
}
76+
get { return (char)(this.GetValue(ActionButtonGlyphProperty) as char?); }
77+
set { this.SetValue(ActionButtonGlyphProperty, value); }
9878
}
9979

10080
public Action CloseButtonClick
10181
{
102-
set
103-
{
104-
this._closeButtonClickAction = value;
105-
}
82+
set { this._closeButtonClickAction = value; }
10683
}
10784

10885
public Action ActionButtonClick
10986
{
110-
set
111-
{
112-
this._actionButtonClickAction = value;
113-
}
87+
set { this._actionButtonClickAction = value; }
11488
}
11589

11690
public Dialog() : base()
@@ -140,17 +114,6 @@ public void Show()
140114
if (this._status)
141115
return;
142116

143-
/*
144-
DoubleAnimation db = new DoubleAnimation();
145-
db.EasingFunction = new CubicEase { EasingMode = EasingMode.EaseOut };
146-
db.To = 0;
147-
db.From = this.ActualHeight;
148-
db.Duration = TimeSpan.FromSeconds(0.5);
149-
150-
151-
slideTransform.BeginAnimation(TranslateTransform.YProperty, db);
152-
*/
153-
154117
this.Visibility = Visibility.Visible;
155118
this._status = true;
156119
}
@@ -175,4 +138,4 @@ private void ActionButtonCommandAction()
175138
this._actionButtonClickAction();
176139
}
177140
}
178-
}
141+
}

MaterialWPF/Controls/Hyperlink.cs

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,31 @@
88

99
namespace MaterialWPF.Controls
1010
{
11-
public partial class Hyperlink : System.Windows.Controls.Button
11+
public class Hyperlink : System.Windows.Controls.Button
1212
{
13-
public static readonly DependencyProperty NavigateUriProperty = DependencyProperty.Register("NavigateUri", typeof(string), typeof(Controls.Hyperlink), new PropertyMetadata(String.Empty));
13+
public static readonly DependencyProperty NavigateUriProperty = DependencyProperty.Register("NavigateUri",
14+
typeof(string), typeof(Controls.Hyperlink), new PropertyMetadata(String.Empty));
1415

1516
public string NavigateUri
1617
{
17-
get
18-
{
19-
return this.GetValue(NavigateUriProperty) as string;
20-
}
21-
set
22-
{
23-
this.SetValue(NavigateUriProperty, value);
24-
}
18+
get => GetValue(NavigateUriProperty) as string;
19+
set => SetValue(NavigateUriProperty, value);
2520
}
2621

27-
public Hyperlink() : base()
28-
{
29-
this.Click += RequestNavigate;
30-
}
22+
public Hyperlink() => Click += RequestNavigate;
3123

3224
private void RequestNavigate(object sender, RoutedEventArgs e)
3325
{
34-
if(!string.IsNullOrEmpty(NavigateUri))
26+
if (!string.IsNullOrEmpty(NavigateUri))
3527
{
36-
System.Diagnostics.ProcessStartInfo sInfo = new System.Diagnostics.ProcessStartInfo(new Uri(NavigateUri).AbsoluteUri)
37-
{
38-
UseShellExecute = true,
39-
};
28+
System.Diagnostics.ProcessStartInfo sInfo =
29+
new System.Diagnostics.ProcessStartInfo(new Uri(NavigateUri).AbsoluteUri)
30+
{
31+
UseShellExecute = true,
32+
};
4033

4134
System.Diagnostics.Process.Start(sInfo);
4235
}
4336
}
4437
}
45-
}
38+
}

MaterialWPF/Controls/Icon.cs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77

88
namespace MaterialWPF.Controls
99
{
10-
public partial class Icon : System.Windows.Controls.Label
10+
public class Icon : System.Windows.Controls.Label
1111
{
12-
public static readonly DependencyProperty GlyphProperty = DependencyProperty.Register("Glyph", typeof(UI.MaterialIcon), typeof(MaterialWPF.Controls.Icon), new PropertyMetadata(UI.MaterialIcon.Accept, new PropertyChangedCallback(OnGlyphChanged)));
13-
public static readonly DependencyProperty RawGlyphProperty = DependencyProperty.Register("RawGlyph", typeof(string), typeof(MaterialWPF.Controls.Icon), new PropertyMetadata("\uEA01"));
12+
public static readonly DependencyProperty GlyphProperty = DependencyProperty.Register("Glyph",
13+
typeof(UI.MaterialIcon), typeof(MaterialWPF.Controls.Icon),
14+
new PropertyMetadata(UI.MaterialIcon.Accept, new PropertyChangedCallback(OnGlyphChanged)));
15+
16+
public static readonly DependencyProperty RawGlyphProperty = DependencyProperty.Register("RawGlyph",
17+
typeof(string), typeof(MaterialWPF.Controls.Icon), new PropertyMetadata("\uEA01"));
1418

1519
private static void OnGlyphChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
1620
{
@@ -19,14 +23,8 @@ private static void OnGlyphChanged(DependencyObject d, DependencyPropertyChanged
1923

2024
public UI.MaterialIcon Glyph
2125
{
22-
get
23-
{
24-
return (UI.MaterialIcon)(this.GetValue(GlyphProperty) as UI.MaterialIcon?);
25-
}
26-
set
27-
{
28-
this.SetValue(GlyphProperty, value);
29-
}
26+
get => (UI.MaterialIcon)(this.GetValue(GlyphProperty) as UI.MaterialIcon?);
27+
set => SetValue(GlyphProperty, value);
3028
}
3129
}
32-
}
30+
}

0 commit comments

Comments
 (0)