This commit is contained in:
TheXamlGuy
2024-01-06 14:34:25 +00:00
parent 53537aa4c7
commit e1c7846e45
73 changed files with 251 additions and 198 deletions
@@ -53,4 +53,4 @@ public class DesktopFlyout :
private void OnPlacementPropertyChanged() => UpdatePlacement();
private void UpdatePlacement() => host.UpdatePlacement(Placement);
}
}
@@ -1,7 +1,7 @@
using Microsoft.UI.Xaml;
using Hyperbar.Windows.Win32;
using Microsoft.UI.Xaml.Controls.Primitives;
using Hyperbar.Windows.Win32;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
namespace Hyperbar.Windows.Controls;
@@ -20,7 +20,7 @@ internal class DesktopFlyoutHost : Window
presenter.SizeChanged += OnChildSizeChanged;
Content = root;
this.SetOpacity(0);
this.SetStyle(WindowStyle.SysMenu | WindowStyle.Visible);
this.SetTopMost(true);
@@ -37,7 +37,7 @@ internal class DesktopFlyoutHost : Window
return;
}
// presenter.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
// presenter.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
double height = presenter.DesiredSize.Height;
double width = presenter.DesiredSize.Width;
@@ -47,15 +47,19 @@ internal class DesktopFlyoutHost : Window
case DesktopFlyoutPlacement.Left:
this.Snap(WindowPlacement.Left, 0, 0);
break;
case DesktopFlyoutPlacement.Top:
this.Snap(WindowPlacement.Top, width, height);
break;
case DesktopFlyoutPlacement.Right:
this.Snap(WindowPlacement.Right, 0, 0);
break;
case DesktopFlyoutPlacement.Bottom:
this.Snap(WindowPlacement.Bottom, width, height);
break;
default:
break;
}
@@ -85,4 +89,4 @@ internal class DesktopFlyoutHost : Window
UpdatePlacement(placement);
}
}
}
@@ -6,4 +6,4 @@ public enum DesktopFlyoutPlacement
Top,
Right,
Bottom
}
}
@@ -37,4 +37,4 @@ public class DesktopFlyoutPresenter :
}
internal void UpdatePlacementState(DesktopFlyoutPlacement placement) => VisualStateManager.GoToState(this, $"{placement}Placement", true);
}
}
@@ -83,4 +83,4 @@
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</ResourceDictionary>
@@ -29,6 +29,7 @@ public class DesktopFlyoutPresenterTemplateSettings : DependencyObject
get => (double)GetValue(HeightProperty);
set => SetValue(HeightProperty, value);
}
public double NegativeHeight
{
get => (double)GetValue(NegativeHeightProperty);
@@ -46,4 +47,4 @@ public class DesktopFlyoutPresenterTemplateSettings : DependencyObject
get => (double)GetValue(WidthProperty);
set => SetValue(WidthProperty, value);
}
}
}
@@ -3,4 +3,4 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ResourceDictionary>