Skip to content

Commit a4e4111

Browse files
committed
Remove Changes
1 parent 49f6ad5 commit a4e4111

File tree

10 files changed

+19
-71
lines changed

10 files changed

+19
-71
lines changed

Directory.Build.targets

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
<Project>
2-
<PropertyGroup>
3-
<Version>0.10.0</Version>
4-
<Authors>Yimeng Wu</Authors>
5-
<Product>ModernWPF UI Library</Product>
6-
</PropertyGroup>
7-
82
<PropertyGroup Condition="'$(PackageId)' != ''">
93
<PackageLicenseExpression>MIT</PackageLicenseExpression>
104
<PackageProjectUrl>https://github.com/Kinnara/ModernWpf</PackageProjectUrl>
@@ -75,4 +69,4 @@
7569
</Choose>
7670
</When>
7771
</Choose>
78-
</Project>
72+
</Project>

ModernWpf.Controls/AutoSuggestBox/AutoSuggestBoxTextChangedEventArgs.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Windows;
23

34
namespace ModernWpf.Controls
45
{

ModernWpf.Controls/ModernWpf.Controls.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);GetDocumentationFile</TargetsForTfmSpecificBuildOutput>
88
<NuspecFile>$(MSBuildThisFileDirectory)ModernWpfUI.nuspec</NuspecFile>
99
<PackageId>ModernWpfUI</PackageId>
10+
<LangVersion>latest</LangVersion>
1011
</PropertyGroup>
1112

1213
<ItemGroup>

ModernWpf.SampleApp/ModernWpf.SampleApp.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<TargetFrameworks>net4.6.2</TargetFrameworks>
66
<UseWPF>true</UseWPF>
77
<ApplicationIcon>Assets\AppIcon.ico</ApplicationIcon>
8+
<LangVersion>latest</LangVersion>
89
</PropertyGroup>
910

1011
<PropertyGroup>
@@ -279,4 +280,4 @@
279280
</Resource>
280281
</ItemGroup>
281282

282-
</Project>
283+
</Project>

ModernWpf/Common/DpiScale2.cs

-23
This file was deleted.

ModernWpf/Controls/Primitives/MaximizedWindowFixer.cs

+12-2
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,22 @@ private Thickness GetMaximizedWindowBorder()
214214
return new Thickness();
215215
}
216216

217-
var dpi = _window.GetDpi();
217+
double dpiScaleX, dpiScaleY;
218+
#if NET462_OR_NEWER
219+
DpiScale dpi = VisualTreeHelper.GetDpi(_window);
220+
dpiScaleX = dpi.DpiScaleX;
221+
dpiScaleY = dpi.DpiScaleY;
222+
#else
223+
Matrix transformToDevice = _hwndSource.CompositionTarget.TransformToDevice;
224+
dpiScaleX = transformToDevice.M11;
225+
dpiScaleY = transformToDevice.M22;
226+
#endif
227+
218228
int frameWidth = NativeMethods.GetSystemMetrics(SM.CXSIZEFRAME);
219229
int frameHeight = NativeMethods.GetSystemMetrics(SM.CYSIZEFRAME);
220230
int borderPadding = NativeMethods.GetSystemMetrics(SM.CXPADDEDBORDER);
221231
Size borderSize = new Size(frameWidth + borderPadding, frameHeight + borderPadding);
222-
Size borderSizeInDips = DpiHelper.DeviceSizeToLogical(borderSize, dpi.DpiScaleX, dpi.DpiScaleY);
232+
Size borderSizeInDips = DpiHelper.DeviceSizeToLogical(borderSize, dpiScaleX, dpiScaleY);
223233

224234
return new Thickness(borderSizeInDips.Width, borderSizeInDips.Height, borderSizeInDips.Width, borderSizeInDips.Height);
225235
}

ModernWpf/Helpers/Helper.cs

+1-26
Original file line numberDiff line numberDiff line change
@@ -82,33 +82,8 @@ public static bool HasLocalValue(this DependencyObject d, DependencyProperty dp)
8282
{
8383
return d.ReadLocalValue(dp) != DependencyProperty.UnsetValue;
8484
}
85-
86-
public static DpiScale2 GetDpi(this Window window)
87-
{
88-
if (window is null)
89-
{
90-
throw new ArgumentNullException(nameof(window));
91-
}
92-
93-
#if NET462_OR_NEWER
94-
return new DpiScale2(VisualTreeHelper.GetDpi(window));
95-
#else
96-
var hwnd = new WindowInteropHelper(window).Handle;
97-
var hwndSource = HwndSource.FromHwnd(hwnd);
98-
if (hwndSource != null)
99-
{
100-
Matrix transformToDevice = hwndSource.CompositionTarget.TransformToDevice;
101-
return new DpiScale2(transformToDevice.M11, transformToDevice.M22);
102-
}
103-
else
104-
{
105-
Debug.Fail("Should not reach here");
106-
return new DpiScale2(1, 1);
107-
}
108-
#endif
109-
}
11085
}
111-
86+
11287
internal enum InterestPoint
11388
{
11489
TopLeft = 0,

ModernWpf/Helpers/OSVersionHelper.cs

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ public static class OSVersionHelper
2222

2323
public static bool IsWindows11OrGreater { get; } = IsWindowsNT && OSVersion >= new Version(10, 0, 21996);
2424

25-
internal static bool IsWindows11OrGreater { get; } = IsWindowsNT && _osVersion >= new Version(10, 0, 22000);
26-
2725
private static Version GetOSVersion()
2826
{
2927
var osv = new RTL_OSVERSIONINFOEX();

ModernWpf/NativeMethods.txt

-7
This file was deleted.

ModernWpf/Styles/AutoSuggestBox.xaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,6 @@
195195
Grid.Row="1"
196196
Grid.ColumnSpan="3"
197197
Margin="{TemplateBinding BorderThickness}"
198-
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
199-
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
200198
Padding="{TemplateBinding Padding}"
201199
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
202200
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
@@ -302,4 +300,4 @@
302300
</Style.Triggers>
303301
</Style>
304302

305-
</ResourceDictionary>
303+
</ResourceDictionary>

0 commit comments

Comments
 (0)