update sample
This commit is contained in:
@@ -4,6 +4,6 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:xamlhost="using:Microsoft.Toolkit.Win32.UI.XamlHost">
|
xmlns:xamlhost="using:Microsoft.Toolkit.Win32.UI.XamlHost">
|
||||||
<xamlhost:XamlApplication.Resources>
|
<xamlhost:XamlApplication.Resources>
|
||||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" Version="Latest" />
|
||||||
</xamlhost:XamlApplication.Resources>
|
</xamlhost:XamlApplication.Resources>
|
||||||
</xamlhost:XamlApplication>
|
</xamlhost:XamlApplication>
|
||||||
|
|||||||
@@ -5,12 +5,14 @@
|
|||||||
xmlns:controls="using:NotificationFlyout.Uwp.UI.Controls"
|
xmlns:controls="using:NotificationFlyout.Uwp.UI.Controls"
|
||||||
IconSource="/Assets/Icon.ico"
|
IconSource="/Assets/Icon.ico"
|
||||||
LightIconSource="/Assets/Icon-Light.ico">
|
LightIconSource="/Assets/Icon-Light.ico">
|
||||||
<controls:NotificationFlyout.Content>
|
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Width="330"
|
Width="330"
|
||||||
Height="500"
|
Height="1000"
|
||||||
Margin="24">
|
Margin="24">
|
||||||
<ComboBox x:Name="Theme" SelectionChanged="Theme_SelectionChanged">
|
<ComboBox
|
||||||
|
x:Name="Theme"
|
||||||
|
Margin="0,0,0,8"
|
||||||
|
SelectionChanged="Theme_SelectionChanged">
|
||||||
<ComboBoxItem Content="Default" />
|
<ComboBoxItem Content="Default" />
|
||||||
<ComboBoxItem Content="Dark" />
|
<ComboBoxItem Content="Dark" />
|
||||||
<ComboBoxItem Content="Light" />
|
<ComboBoxItem Content="Light" />
|
||||||
@@ -18,8 +20,8 @@
|
|||||||
<Button Margin="0,0,0,8" Content="Button" />
|
<Button Margin="0,0,0,8" Content="Button" />
|
||||||
<Slider Margin="0,0,0,8" />
|
<Slider Margin="0,0,0,8" />
|
||||||
<TextBox Margin="0,0,0,8" />
|
<TextBox Margin="0,0,0,8" />
|
||||||
<ToggleButton Margin="0,0,0,8" />
|
|
||||||
<CalendarView Margin="0,0,0,8" />
|
<CalendarView Margin="0,0,0,8" />
|
||||||
|
<TimePicker Margin="0,0,0,8" />
|
||||||
|
<DatePicker />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</controls:NotificationFlyout.Content>
|
|
||||||
</controls:NotificationFlyout>
|
</controls:NotificationFlyout>
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Drawing;
|
|
||||||
|
|
||||||
namespace NotificationFlyout.Shared.UI
|
|
||||||
{
|
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using Windows.UI.Xaml;
|
using Windows.UI.Xaml;
|
||||||
|
using Windows.UI.Xaml.Markup;
|
||||||
using Windows.UI.Xaml.Media;
|
using Windows.UI.Xaml.Media;
|
||||||
|
|
||||||
namespace NotificationFlyout.Uwp.UI.Controls
|
namespace NotificationFlyout.Uwp.UI.Controls
|
||||||
{
|
{
|
||||||
|
[ContentProperty(Name = "Content")]
|
||||||
public class NotificationFlyout : DependencyObject
|
public class NotificationFlyout : DependencyObject
|
||||||
{
|
{
|
||||||
public static readonly DependencyProperty IconSourceProperty =
|
public static readonly DependencyProperty IconSourceProperty =
|
||||||
|
|||||||
Reference in New Issue
Block a user