[WIP] Non-functional now playing flyout sample

This commit is contained in:
Daniel Clark
2021-02-15 00:06:51 +00:00
parent b920a4622a
commit 49169b1044
8 changed files with 73 additions and 150 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

@@ -123,9 +123,6 @@
<Compile Include="Shell.xaml.cs"> <Compile Include="Shell.xaml.cs">
<DependentUpon>Shell.xaml</DependentUpon> <DependentUpon>Shell.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="WindowContent.xaml.cs">
<DependentUpon>WindowContent.xaml</DependentUpon>
</Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<AppxManifest Include="Package.appxmanifest"> <AppxManifest Include="Package.appxmanifest">
@@ -133,7 +130,10 @@
</AppxManifest> </AppxManifest>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Assets\album.jpg" />
<Content Include="Assets\notification-icon-light.png" /> <Content Include="Assets\notification-icon-light.png" />
<Content Include="Assets\Notification-Icon-Playing-Light.png" />
<Content Include="Assets\Notification-Icon-Playing.png" />
<Content Include="Assets\notification-icon.png" /> <Content Include="Assets\notification-icon.png" />
<Content Include="Properties\Default.rd.xml" /> <Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" /> <Content Include="Assets\LockScreenLogo.scale-200.png" />
@@ -166,10 +166,6 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="WindowContent.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\TheXamlGuy.NotificationFlyout.Uwp.UI.Controls\TheXamlGuy.NotificationFlyout.Uwp.UI.Controls.csproj"> <ProjectReference Include="..\..\src\TheXamlGuy.NotificationFlyout.Uwp.UI.Controls\TheXamlGuy.NotificationFlyout.Uwp.UI.Controls.csproj">
+54 -80
View File
@@ -3,9 +3,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:TheXamlGuy.NotificationFlyout.Uwp.UI.Controls" xmlns:controls="using:TheXamlGuy.NotificationFlyout.Uwp.UI.Controls"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls" IconSource="/Assets/Notification-Icon-Playing.png"
IconSource="/Assets/notification-icon.png" LightIconSource="/Assets/Notification-Icon-Playing-Light.png">
LightIconSource="/Assets/notification-icon-light.png">
<controls:NotificationFlyout.FlyoutPresenterStyle> <controls:NotificationFlyout.FlyoutPresenterStyle>
<Style TargetType="controls:NotificationFlyoutPresenter"> <Style TargetType="controls:NotificationFlyoutPresenter">
<Setter Property="CornerRadius" Value="8" /> <Setter Property="CornerRadius" Value="8" />
@@ -13,84 +12,59 @@
</controls:NotificationFlyout.FlyoutPresenterStyle> </controls:NotificationFlyout.FlyoutPresenterStyle>
<controls:NotificationFlyout.ContextMenu> <controls:NotificationFlyout.ContextMenu>
<controls:NotificationFlyoutContextMenu> <controls:NotificationFlyoutContextMenu>
<MenuFlyoutItem Click="MenuFlyoutItem_Click" Text="Close" /> <MenuFlyoutItem Text="Close" />
</controls:NotificationFlyoutContextMenu> </controls:NotificationFlyoutContextMenu>
</controls:NotificationFlyout.ContextMenu> </controls:NotificationFlyout.ContextMenu>
<StackPanel Margin="24"> <Grid Width="400" Margin="24">
<ComboBox <Grid.RowDefinitions>
x:Name="Theme" <RowDefinition Height="Auto" />
Margin="0,0,0,8" <RowDefinition Height="Auto" />
SelectionChanged="Theme_SelectionChanged"> <RowDefinition Height="Auto" />
<ComboBoxItem Content="Default" /> <RowDefinition Height="Auto" />
<ComboBoxItem Content="Dark" /> </Grid.RowDefinitions>
<ComboBoxItem Content="Light" /> <Grid Grid.Row="0" Margin="0,0,0,4">
</ComboBox> <Grid.ColumnDefinitions>
<muxc:MenuBar> <ColumnDefinition Width="Auto" />
<muxc:MenuBarItem Title="File"> <ColumnDefinition Width="*" />
<MenuFlyoutItem Text="New" /> </Grid.ColumnDefinitions>
<MenuFlyoutItem Text="Open..." /> <Border
<MenuFlyoutItem Text="Save" /> Grid.Column="0"
<MenuFlyoutItem Text="Exit" /> Width="94"
</muxc:MenuBarItem> Height="94"
Background="Gray"
<muxc:MenuBarItem Title="Edit"> CornerRadius="4">
<MenuFlyoutItem Text="Undo" /> <Image Source="/Assets/album.jpg" Stretch="UniformToFill" />
<MenuFlyoutItem Text="Cut" /> </Border>
<MenuFlyoutItem Text="Copy" /> <StackPanel Grid.Column="1" Margin="12,12,0,0">
<MenuFlyoutItem Text="Paste" /> <TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="Foo Fighters" />
</muxc:MenuBarItem> <TextBlock Text="Best of you" />
<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"
Click="Button_Click"
Content="Open window" />
<Slider Margin="0,0,0,8" />
<TextBox Margin="0,0,0,8" />
<CalendarView Margin="0,0,0,8" />
<TimePicker x:Name="foo" 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> </StackPanel>
</Grid>
<Slider Grid.Row="1" />
<Grid Grid.Row="2">
<TextBlock HorizontalAlignment="Left" Text="00:00" />
<TextBlock HorizontalAlignment="Right" Text="04:16" />
</Grid>
<CommandBar
Grid.Row="3"
HorizontalAlignment="Center"
Background="Transparent"
DefaultLabelPosition="Collapsed">
<AppBarButton Width="48" CornerRadius="4">
<AppBarButton.Icon>
<FontIcon Glyph="&#xE100;" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Width="48" CornerRadius="4">
<AppBarButton.Icon>
<FontIcon Glyph="&#xE102;" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Width="48" CornerRadius="4">
<AppBarButton.Icon>
<FontIcon Glyph="&#xE101;" />
</AppBarButton.Icon>
</AppBarButton>
</CommandBar>
</Grid>
</controls:NotificationFlyout> </controls:NotificationFlyout>
+16 -22
View File
@@ -1,4 +1,8 @@
namespace NotificationFlyoutSample using System;
using System.Threading.Tasks;
using Windows.Media.Control;
namespace NotificationFlyoutSample
{ {
public sealed partial class Shell public sealed partial class Shell
{ {
@@ -7,23 +11,6 @@
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;
}
}
private void MenuFlyoutItem_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) private void MenuFlyoutItem_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{ {
@@ -31,10 +18,17 @@
app.Exit(); app.Exit();
} }
private void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) private async void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{ {
var app = GetApplication(); //var gsmtcsm = await GetSystemMediaTransportControlsSessionManager();
app.OpenAsWindow<WindowContent>(); //var mediaProperties = await GetMediaProperties(gsmtcsm.GetCurrentSession());
}
}
//private static async Task<GlobalSystemMediaTransportControlsSessionManager> GetSystemMediaTransportControlsSessionManager() =>
//await GlobalSystemMediaTransportControlsSessionManager.RequestAsync();
//private static async Task<GlobalSystemMediaTransportControlsSessionMediaProperties> GetMediaProperties(GlobalSystemMediaTransportControlsSession session) =>
// await session.TryGetMediaPropertiesAsync();
} }
} }
@@ -1,27 +0,0 @@
<UserControl
x:Class="NotificationFlyoutSample.WindowContent"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls">
<muxc:NavigationView x:Name="nvSample">
<muxc:NavigationView.MenuItems>
<muxc:NavigationViewItem
Content="Menu Item1"
Icon="Play"
Tag="SamplePage1" />
<muxc:NavigationViewItem
Content="Menu Item2"
Icon="Save"
Tag="SamplePage2" />
<muxc:NavigationViewItem
Content="Menu Item3"
Icon="Refresh"
Tag="SamplePage3" />
<muxc:NavigationViewItem
Content="Menu Item4"
Icon="Download"
Tag="SamplePage4" />
</muxc:NavigationView.MenuItems>
<Frame x:Name="contentFrame" />
</muxc:NavigationView>
</UserControl>
@@ -1,14 +0,0 @@
using Windows.UI.Xaml.Controls;
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
namespace NotificationFlyoutSample
{
public sealed partial class WindowContent : UserControl
{
public WindowContent()
{
this.InitializeComponent();
}
}
}