Skip to content

Commit 442290d

Browse files
committed
feat: CommandBarFlyoutCommandBar
1 parent 7046e00 commit 442290d

File tree

6 files changed

+1108
-1075
lines changed

6 files changed

+1108
-1075
lines changed

src/Uno.UI/Helpers/WinUI/SharedHelpers.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,19 @@ FrameworkElement FindInVisualTreeInner(DependencyObject parent, Func<FrameworkEl
935935
return FindInVisualTreeInner(parent, isMatch);
936936
}
937937

938+
public static bool IsFrameworkElementLoaded(FrameworkElement frameworkElement)
939+
{
940+
if (IsRS5OrHigher())
941+
{
942+
// TODO:MZ: Does this work everywhere?
943+
return frameworkElement.IsLoaded;
944+
}
945+
else
946+
{
947+
return VisualTreeHelper.GetParent(frameworkElement) != null;
948+
}
949+
}
950+
938951
public static bool IsTrue(bool? nullableBool)
939952
{
940953
if (nullableBool != null)
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
5-
namespace Microsoft.UI.Xaml.Controls;
1+
namespace Microsoft.UI.Xaml.Controls;
62

3+
/// <summary>
4+
/// Defines members to manage the command bar overflow menu.
5+
/// </summary>
76
public partial interface ICommandBarElement2
87
{
8+
/// <summary>
9+
/// Gets or sets the order in which this item is moved to the CommandBar overflow menu.
10+
/// </summary>
911
int DynamicOverflowOrder { get; set; }
12+
13+
/// <summary>
14+
/// Gets a value that indicates whether this item is in the overflow menu.
15+
/// </summary>
1016
bool IsInOverflow { get; }
1117
}

src/Uno.UI/UI/Xaml/Controls/CommandBar/ICommandBarElement3.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
5-
namespace Microsoft.UI.Xaml.Controls;
1+
namespace Microsoft.UI.Xaml.Controls;
62

73
internal interface ICommandBarElement3
84
{
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
1-
using Windows.UI.Xaml.Controls;
1+
using Windows.UI.Xaml;
2+
using Windows.UI.Xaml.Controls;
23

34
namespace Microsoft.UI.Xaml.Controls.Primitives;
45

56
public partial class CommandBarFlyoutCommandBar : CommandBar
67
{
8+
/// <summary>
9+
/// Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup
10+
/// extension sources when defining templates for a CommandBarFlyoutCommandBar control.
11+
/// </summary>
12+
public CommandBarFlyoutCommandBarTemplateSettings FlyoutTemplateSettings
13+
{
14+
get => (CommandBarFlyoutCommandBarTemplateSettings)GetValue(FlyoutTemplateSettingsProperty);
15+
set => SetValue(FlyoutTemplateSettingsProperty, value);
16+
}
17+
18+
internal static DependencyProperty FlyoutTemplateSettingsProperty { get; } =
19+
DependencyProperty.Register(
20+
nameof(FlyoutTemplateSettings),
21+
typeof(CommandBarFlyoutCommandBarTemplateSettings),
22+
typeof(CommandBarFlyoutCommandBar),
23+
new FrameworkPropertyMetadata(null));
24+
25+
726
}

src/Uno.UI/UI/Xaml/Input/StandardUICommand/CommandBarFlyoutCommandBar.h.mux.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ partial class CommandBarFlyoutCommandBar
4141
private FrameworkElement? m_currentSecondaryItemsStartElement;
4242

4343
private CommandBarFlyoutOpenCloseAnimationKind m_openAnimationKind = CommandBarFlyoutOpenCloseAnimationKind.Clip;
44-
private ManagedWeakReference m_flyoutPresenter;
44+
private ManagedWeakReference? m_flyoutPresenter;
4545
private Storyboard? m_openingStoryboard;
4646
private Storyboard? m_closingStoryboard;
4747
private readonly SerialDisposable m_openingStoryboardCompletedRevoker = new();

0 commit comments

Comments
 (0)