clean up wpf.ui some more
This commit is contained in:
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "D:\\git\\CsWin32\\src\\Microsoft.Windows.CsWin32\\settings.schema.json",
|
|
||||||
"emitSingleFile": true
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace NotificationFlyout.Wpf.UI.Extensions
|
|
||||||
{
|
|
||||||
public static class ImageSourceExtensions
|
|
||||||
{
|
|
||||||
//public static Icon ConvertToIcon(this ImageSource imageSource, uint dpi)
|
|
||||||
//{
|
|
||||||
// if (imageSource == null) return null;
|
|
||||||
|
|
||||||
// var uri = new Uri(imageSource.ToString(), UriKind.RelativeOrAbsolute);
|
|
||||||
|
|
||||||
// var streamResource = Application.GetResourceStream(uri);
|
|
||||||
// if (streamResource == null) throw new ArgumentException(nameof(streamResource));
|
|
||||||
|
|
||||||
// return new Icon(streamResource.Stream, new System.Drawing.Size(PInvoke.GetSystemMetricsForDpi((int)SystemMetricFlag.SM_CXICON, dpi), PInvoke.GetSystemMetricsForDpi((int)SystemMetricFlag.SM_CYICON, dpi)));
|
|
||||||
//}
|
|
||||||
|
|
||||||
private enum SystemMetricFlag : int
|
|
||||||
{
|
|
||||||
SM_CXICON = 11,
|
|
||||||
SM_CYICON = 12,
|
|
||||||
SM_CXSMICON = 49,
|
|
||||||
SM_CYSMICON = 50
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -22,18 +22,5 @@ namespace NotificationFlyout.Wpf.UI.Extensions
|
|||||||
{
|
{
|
||||||
return GetDpi(visual).M11;
|
return GetDpi(visual).M11;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool TryGetTransformToDevice(this Visual visual, out Matrix value)
|
|
||||||
{
|
|
||||||
var presentationSource = PresentationSource.FromVisual(visual);
|
|
||||||
if (presentationSource != null)
|
|
||||||
{
|
|
||||||
value = presentationSource.CompositionTarget.TransformToDevice;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
value = default;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "D:\\git\\CsWin32\\src\\Microsoft.Windows.CsWin32\\settings.schema.json",
|
|
||||||
"emitSingleFile": true
|
|
||||||
}
|
|
||||||
@@ -11,14 +11,6 @@
|
|||||||
<Version>1.0.0</Version>
|
<Version>1.0.0</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="NativeMethods.json" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<AdditionalFiles Include="NativeMethods.json" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\NotificationFlyout.Shared.UI\NotificationFlyout.Shared.UI.csproj" />
|
<ProjectReference Include="..\NotificationFlyout.Shared.UI\NotificationFlyout.Shared.UI.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user