Skip to content

Commit 4c54764

Browse files
committed
bump version
1 parent bc0ffeb commit 4c54764

File tree

3 files changed

+50
-6
lines changed

3 files changed

+50
-6
lines changed

src/Wpf.Ui.Test/Wpf.Ui.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30+
<PackageReference Include="WPF-UI" Version="4.1.0" />
3031
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
31-
<PackageReference Include="WPF-UI" Version="4.0.3" />
3232
<PackageReference Include="ComputedAnimations.WPF" Version="0.5.2" />
3333
<PackageReference Include="ComputedBehaviors.WPF" Version="0.5.2" />
3434
<PackageReference Include="ComputedConverters.WPF" Version="0.5.2" />

src/Wpf.Ui.Violeta/Controls/ShellWindow/ShellWindow.cs

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System;
2+
using System.Reflection;
23
using System.Windows;
34
using System.Windows.Interop;
45
using System.Windows.Shell;
56
using Wpf.Ui.Appearance;
67
using Wpf.Ui.Controls;
7-
using Wpf.Ui.Interop;
88

99
namespace Wpf.Ui.Violeta.Controls;
1010

@@ -222,3 +222,47 @@ protected virtual void OnExtendsContentIntoTitleBarChanged(bool oldValue, bool n
222222
_ = UnsafeNativeMethods.RemoveWindowTitlebarContents(this);
223223
}
224224
}
225+
226+
/// <summary>
227+
/// Reflective access to `Wpf.Ui.Interop.UnsafeNativeMethods` methods.
228+
/// </summary>
229+
file static class UnsafeNativeMethods
230+
{
231+
private static readonly Type? _interopType
232+
= Type.GetType("Wpf.Ui.Interop.UnsafeNativeMethods, Wpf.Ui");
233+
234+
/// <summary>
235+
/// Tries to set the corner preference of the selected window.
236+
/// </summary>
237+
/// <param name="handle">Selected window handle.</param>
238+
/// <param name="cornerPreference">Window corner preference.</param>
239+
/// <returns><see langword="true"/> if invocation of native Windows function succeeds.</returns>
240+
public static bool ApplyWindowCornerPreference(nint handle, object cornerPreference)
241+
{
242+
if (_interopType == null) return false;
243+
244+
MethodInfo? method = _interopType.GetMethod("ApplyWindowCornerPreference", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
245+
if (method == null) return false;
246+
return (bool)method.Invoke(null, [handle, cornerPreference])!;
247+
}
248+
249+
/// <summary>
250+
/// Tries to remove titlebar from selected <see cref="Window"/>.
251+
/// </summary>
252+
/// <param name="window">The window to which the effect is to be applied.</param>
253+
/// <returns><see langword="true"/> if invocation of native Windows function succeeds.</returns>
254+
public static bool RemoveWindowTitlebarContents(Window? window)
255+
{
256+
if (_interopType == null) return false;
257+
258+
MethodInfo? method = _interopType.GetMethod(
259+
"RemoveWindowTitlebarContents",
260+
BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic,
261+
null,
262+
[typeof(Window)],
263+
null
264+
);
265+
if (method == null) return false;
266+
return (bool)method.Invoke(null, [window])!;
267+
}
268+
}

src/Wpf.Ui.Violeta/Wpf.Ui.Violeta.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<EnableWindowsTargeting>true</EnableWindowsTargeting>
1717
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1818
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
19-
<AssemblyVersion>4.0.3.7</AssemblyVersion>
20-
<FileVersion>4.0.3.7</FileVersion>
21-
<Version>$(VersionPrefix)4.0.3.7</Version>
19+
<AssemblyVersion>4.1.0</AssemblyVersion>
20+
<FileVersion>4.1.0</FileVersion>
21+
<Version>$(VersionPrefix)4.1.0</Version>
2222
<Authors>ema</Authors>
2323
<Company>ema</Company>
2424
<Description>WPF UI Violeta is based on WPF UI, and provides the Fluent experience in your known and loved WPF framework. Some new immersive controls like like `Toast`, `Flyout`, `ContentDialog`, `MessageBox` and etc.</Description>
@@ -102,7 +102,7 @@
102102
</ItemGroup>
103103

104104
<ItemGroup>
105-
<PackageReference Include="WPF-UI" Version="4.0.3" />
105+
<PackageReference Include="WPF-UI" Version="4.1.0" />
106106
</ItemGroup>
107107

108108
<ItemGroup Condition="'$(TargetFramework)' == 'net462' Or '$(TargetFramework)' == 'net47' Or '$(TargetFramework)' == 'net471' Or '$(TargetFramework)' == 'net472' Or '$(TargetFramework)' == 'net48' Or '$(TargetFramework)' == 'net481'">

0 commit comments

Comments
 (0)