Rename projects to better structure it. The aim is to try and keep it not dependant on the type of UI framework it uses thus allowing us to switch to another UI framework if we need later...

This commit is contained in:
TheXamlGuy
2024-01-06 08:49:12 +00:00
parent b380f06fbf
commit 3e88950669
67 changed files with 211 additions and 196 deletions
@@ -0,0 +1,40 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
namespace Hyperbar.Windows.Controls;
public class DesktopFlyoutPresenter :
ContentControl
{
public static readonly DependencyProperty TemplateSettingsProperty =
DependencyProperty.Register(nameof(TemplateSettings),
typeof(DesktopFlyoutPresenterTemplateSettings), typeof(DesktopFlyoutPresenter),
new PropertyMetadata(null));
internal new DesktopFlyout Parent;
public DesktopFlyoutPresenter()
{
DefaultStyleKey = typeof(DesktopFlyoutPresenter);
TemplateSettings = new DesktopFlyoutPresenterTemplateSettings();
}
protected override void OnApplyTemplate()
{
SetBinding(ContentProperty, new Binding
{
Source = Parent,
Mode = BindingMode.TwoWay,
Path = new PropertyPath(nameof(Parent.Content)),
});
}
public DesktopFlyoutPresenterTemplateSettings TemplateSettings
{
get => (DesktopFlyoutPresenterTemplateSettings)GetValue(TemplateSettingsProperty);
set => SetValue(TemplateSettingsProperty, value);
}
internal void UpdatePlacementState(DesktopFlyoutPlacement placement) => VisualStateManager.GoToState(this, $"{placement}Placement", true);
}