[WIP] Add context menu support
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using NotificationFlyout.Wpf.UI.Controls;
|
||||
using System;
|
||||
|
||||
namespace NotificationFlyoutSample.Host
|
||||
{
|
||||
@@ -10,7 +11,10 @@ namespace NotificationFlyoutSample.Host
|
||||
using (new NotificationFlyoutSample.App())
|
||||
{
|
||||
var app = new App();
|
||||
new SampleNotificationFlyout();
|
||||
new NotificationFlyoutApplication
|
||||
{
|
||||
Flyout = new Shell()
|
||||
};
|
||||
app.Run();
|
||||
}
|
||||
}
|
||||
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
<NotificationFlyout
|
||||
x:Class="NotificationFlyoutSample.Host.SampleNotificationFlyout"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:uwp="clr-namespace:NotificationFlyoutSample;assembly=NotificationFlyoutSample"
|
||||
IconSource="/Assets/Icon.ico"
|
||||
LightIconSource="/Assets/Icon-Light.ico">
|
||||
<uwp:Shell />
|
||||
</NotificationFlyout>
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
namespace NotificationFlyoutSample.Host
|
||||
{
|
||||
public partial class SampleNotificationFlyout
|
||||
{
|
||||
public SampleNotificationFlyout()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30914.41
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotificationFlyoutSample.Host", "NotificationFlyoutSample.Host\NotificationFlyoutSample.Host.csproj", "{D13742AD-DB71-4269-B3AF-7CA8C4E51A19}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NotificationFlyoutSample.Host", "NotificationFlyoutSample.Host\NotificationFlyoutSample.Host.csproj", "{D13742AD-DB71-4269-B3AF-7CA8C4E51A19}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotificationFlyoutSample", "NotificationFlyoutSample\NotificationFlyoutSample.csproj", "{2057ADE0-C61E-45EE-BB7E-A469FE4D4C41}"
|
||||
EndProject
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
+2
@@ -130,6 +130,8 @@
|
||||
</AppxManifest>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\Icon-Light.ico" />
|
||||
<Content Include="Assets\Icon.ico" />
|
||||
<Content Include="Properties\Default.rd.xml" />
|
||||
<Content Include="Assets\LockScreenLogo.scale-200.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||
|
||||
@@ -1,16 +1,83 @@
|
||||
<UserControl
|
||||
<controls:NotificationFlyout
|
||||
x:Class="NotificationFlyoutSample.Shell"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:winui="using:Microsoft.UI.Xaml.Controls">
|
||||
<StackPanel
|
||||
Width="330"
|
||||
Height="500"
|
||||
Margin="24">
|
||||
xmlns:controls="using:NotificationFlyout.Uwp.UI.Controls"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
IconSource="/Assets/Icon.ico"
|
||||
LightIconSource="/Assets/Icon-Light.ico">
|
||||
<StackPanel Margin="24">
|
||||
<ComboBox
|
||||
x:Name="Theme"
|
||||
Margin="0,0,0,8"
|
||||
SelectionChanged="Theme_SelectionChanged">
|
||||
<ComboBoxItem Content="Default" />
|
||||
<ComboBoxItem Content="Dark" />
|
||||
<ComboBoxItem Content="Light" />
|
||||
</ComboBox>
|
||||
<muxc:MenuBar>
|
||||
<muxc:MenuBarItem Title="File">
|
||||
<MenuFlyoutItem Text="New" />
|
||||
<MenuFlyoutItem Text="Open..." />
|
||||
<MenuFlyoutItem Text="Save" />
|
||||
<MenuFlyoutItem Text="Exit" />
|
||||
</muxc:MenuBarItem>
|
||||
|
||||
<muxc:MenuBarItem Title="Edit">
|
||||
<MenuFlyoutItem Text="Undo" />
|
||||
<MenuFlyoutItem Text="Cut" />
|
||||
<MenuFlyoutItem Text="Copy" />
|
||||
<MenuFlyoutItem Text="Paste" />
|
||||
</muxc:MenuBarItem>
|
||||
|
||||
<muxc:MenuBarItem Title="Help">
|
||||
<MenuFlyoutItem Text="About" />
|
||||
</muxc:MenuBarItem>
|
||||
</muxc:MenuBar>
|
||||
<muxc:ProgressRing Margin="0,0,0,8" IsActive="True" />
|
||||
<muxc:ProgressBar
|
||||
Width="130"
|
||||
Margin="0,0,0,8"
|
||||
IsIndeterminate="True"
|
||||
ShowError="False"
|
||||
ShowPaused="False" />
|
||||
<Button Margin="0,0,0,8" Content="Button" />
|
||||
<Slider Margin="0,0,0,8" />
|
||||
<TextBox Margin="0,0,0,8" />
|
||||
<ToggleButton Margin="0,0,0,8" />
|
||||
<CalendarView Margin="0,0,0,8" />
|
||||
<TimePicker Margin="0,0,0,8" />
|
||||
<DatePicker />
|
||||
<muxc:NumberBox
|
||||
x:Name="NumberBoxSpinButtonPlacementExample"
|
||||
Header="Enter an integer:"
|
||||
LargeChange="100"
|
||||
SmallChange="10"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
Value="1" />
|
||||
<muxc:RadioButtons Header="Options:">
|
||||
<RadioButton Content="Option 1" />
|
||||
<RadioButton Content="Option 2" />
|
||||
<RadioButton Content="Option 3" />
|
||||
</muxc:RadioButtons>
|
||||
<StackPanel>
|
||||
<CheckBox
|
||||
x:Name="OptionsAllCheckBox"
|
||||
Content="Select all"
|
||||
IsThreeState="True" />
|
||||
<CheckBox
|
||||
x:Name="Option1CheckBox"
|
||||
Margin="24,0,0,0"
|
||||
Content="Option 1" />
|
||||
<CheckBox
|
||||
x:Name="Option2CheckBox"
|
||||
Margin="24,0,0,0"
|
||||
Content="Option 2"
|
||||
IsChecked="True" />
|
||||
<CheckBox
|
||||
x:Name="Option3CheckBox"
|
||||
Margin="24,0,0,0"
|
||||
Content="Option 3" />
|
||||
</StackPanel>
|
||||
<muxc:RatingControl AutomationProperties.Name="RatingControl with placeholder" PlaceholderValue="0" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</controls:NotificationFlyout>
|
||||
@@ -1,27 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Primitives;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
||||
|
||||
namespace NotificationFlyoutSample
|
||||
namespace NotificationFlyoutSample
|
||||
{
|
||||
public sealed partial class Shell : UserControl
|
||||
public sealed partial class Shell
|
||||
{
|
||||
public Shell()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Theme_SelectionChanged(object sender, Windows.UI.Xaml.Controls.SelectionChangedEventArgs e)
|
||||
{
|
||||
switch (Theme.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
RequestedTheme = Windows.UI.Xaml.ElementTheme.Default;
|
||||
break;
|
||||
case 1:
|
||||
RequestedTheme = Windows.UI.Xaml.ElementTheme.Dark;
|
||||
break;
|
||||
case 2:
|
||||
RequestedTheme = Windows.UI.Xaml.ElementTheme.Light;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
IconSource="/Assets/Icon.ico"
|
||||
LightIconSource="/Assets/Icon-Light.ico">
|
||||
<controls:NotificationFlyout.ContextMenuItems>
|
||||
<MenuFlyoutItem Text="Close" />
|
||||
</controls:NotificationFlyout.ContextMenuItems>
|
||||
<StackPanel Margin="24">
|
||||
<ComboBox
|
||||
x:Name="Theme"
|
||||
|
||||
Reference in New Issue
Block a user