fixed issue with margin

This commit is contained in:
Daniel Clark
2021-02-27 11:57:23 +00:00
parent 737dbe9b32
commit 240609270e
3 changed files with 7 additions and 6 deletions
@@ -2,16 +2,15 @@
x:Class="NotificationFlyoutSample.SampleFlyout" x:Class="NotificationFlyoutSample.SampleFlyout"
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">
CornerRadius="6">
<controls:NotificationFlyout.ContextFlyout> <controls:NotificationFlyout.ContextFlyout>
<MenuFlyout> <MenuFlyout>
<MenuFlyoutItem Text="Close" Click="OnCloseMenuFlyoutItemClick" /> <MenuFlyoutItem Click="OnCloseMenuFlyoutItemClick" Text="Close" />
</MenuFlyout> </MenuFlyout>
</controls:NotificationFlyout.ContextFlyout> </controls:NotificationFlyout.ContextFlyout>
<Grid Width="500" Height="500"> <Grid Width="500" Height="400">
<Button <Button
HorizontalAlignment="Right" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="Hello World!" /> Content="Hello World!" />
</Grid> </Grid>
@@ -36,7 +36,7 @@
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="controls:NotificationFlyout"> <ControlTemplate TargetType="controls:NotificationFlyout">
<Border x:Name="Container"> <Border x:Name="Container">
<Grid x:Name="LayoutRoot"> <Grid x:Name="LayoutRoot" Margin="{TemplateBinding Margin}">
<Border <Border
x:Name="BackgroundElement" x:Name="BackgroundElement"
Padding="{TemplateBinding Padding}" Padding="{TemplateBinding Padding}"
@@ -107,6 +107,7 @@ namespace TheXamlGuy.NotificationFlyout.Wpf.UI.Controls
UpdateIcons(); UpdateIcons();
} }
private void PrepareFlyoutHost() private void PrepareFlyoutHost()
{ {
_notificationFlyoutXamlHost = new TransparentXamlHost<ContentControl>(); _notificationFlyoutXamlHost = new TransparentXamlHost<ContentControl>();
@@ -126,6 +127,7 @@ namespace TheXamlGuy.NotificationFlyout.Wpf.UI.Controls
_notificationFlyoutXamlHost.Activate(); _notificationFlyoutXamlHost.Activate();
Flyout.Show(); Flyout.Show();
} }
private void UpdateFlyoutPlacement() private void UpdateFlyoutPlacement()
{ {
var taskbarState = _taskbarHelper.GetCurrentState(); var taskbarState = _taskbarHelper.GetCurrentState();