Skip to content

Commit

Permalink
fix: Adjust InfoBarPanel namespace to match WinUI
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Nov 18, 2021
1 parent 6105d1f commit 9784afa
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,40 +1,82 @@
// MUX reference InfoBarPanel.properties.cpp, commit 533c6b1
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
// MUX reference InfoBarPanel.properties.cpp, commit 533c6b1

using Windows.UI.Xaml;

namespace Microsoft.UI.Xaml.Controls
namespace Microsoft.UI.Xaml.Controls.Primitives
{
public partial class InfoBarPanel
{
/// <summary>
/// Gets the HorizontalOrientationMargin from an object.
/// </summary>
/// <param name="obj">The object that has an HorizontalOrientationMargin.</param>
/// <returns>The HorizontalOrientationMargin thickness.</returns>
public static Thickness GetHorizontalOrientationMargin(DependencyObject obj) => (Thickness)obj.GetValue(HorizontalOrientationMarginProperty);

/// <summary>
/// Sets the HorizontalOrientationMargin to an object.
/// </summary>
/// <param name="obj">The object that the HorizontalOrientationMargin value will be set to.</param>
/// <param name="value">The thickness of the HorizontalOrientationMargin.</param>
public static void SetHorizontalOrientationMargin(DependencyObject obj, Thickness value) => obj.SetValue(HorizontalOrientationMarginProperty, value);

/// <summary>
/// Gets the identifier for the HorizontalOrientationMargin dependency property.
/// </summary>
public static DependencyProperty HorizontalOrientationMarginProperty { get; } =
DependencyProperty.RegisterAttached("HorizontalOrientationMargin", typeof(Thickness), typeof(InfoBarPanel), new FrameworkPropertyMetadata(default(Thickness)));

/// <summary>
/// Gets and sets the distance between the edges of the InfoBarPanel
/// and its children when the panel is oriented horizontally.
/// </summary>
public Thickness HorizontalOrientationPadding
{
get => (Thickness)GetValue(HorizontalOrientationPaddingProperty);
set => SetValue(HorizontalOrientationPaddingProperty, value);
}

/// <summary>
/// Gets the identifier for the HorizontalOrientationPadding dependency property.
/// </summary>
public static DependencyProperty HorizontalOrientationPaddingProperty { get; } =
DependencyProperty.Register(nameof(HorizontalOrientationPadding), typeof(Thickness), typeof(InfoBarPanel), new FrameworkPropertyMetadata(default(Thickness)));

/// <summary>
/// Gets the VerticalOrientationMargin from an object.
/// </summary>
/// <param name="obj">The object that has a VerticalOrientationMargin.</param>
/// <returns>The VerticalOrientationMargin thickness.</returns>
public static Thickness GetVerticalOrientationMargin(DependencyObject obj) => (Thickness)obj.GetValue(VerticalOrientationMarginProperty);

/// <summary>
/// Sets the VerticalOrientationMargin to an object.
/// </summary>
/// <param name="obj">The object that the VerticalOrientationMargin value will be set to.</param>
/// <param name="value">The thickness of the VerticalOrientationMargin.</param>
public static void SetVerticalOrientationMargin(DependencyObject obj, Thickness value) => obj.SetValue(VerticalOrientationMarginProperty, value);

/// <summary>
/// Gets the identifier for the VerticalOrientationMargin dependency property.
/// </summary>
public static DependencyProperty VerticalOrientationMarginProperty { get; } =
DependencyProperty.RegisterAttached("VerticalOrientationMargin", typeof(Thickness), typeof(InfoBarPanel), new FrameworkPropertyMetadata(default(Thickness)));

/// <summary>
/// Gets and sets the distance between the edges of the InfoBarPanel
/// and its children when the panel is oriented vertically.
/// </summary>
public Thickness VerticalOrientationPadding
{
get => (Thickness)GetValue(VerticalOrientationPaddingProperty);
set => SetValue(VerticalOrientationPaddingProperty, value);
}

/// <summary>
/// Gets the identifier for the VerticalOrientationPadding dependency property.
/// </summary>
public static DependencyProperty VerticalOrientationPaddingProperty { get; } =
DependencyProperty.Register(nameof(VerticalOrientationPadding), typeof(Thickness), typeof(InfoBarPanel), new FrameworkPropertyMetadata(default(Thickness)));
}
Expand Down
16 changes: 14 additions & 2 deletions src/Uno.UI/Microsoft/UI/Xaml/Controls/InfoBar/InfoBarPanel.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
// MUX reference InfoBarPanel.cpp, commit d67e625
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
// MUX reference InfoBarPanel.cpp, commit d67e625

using System;
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace Microsoft.UI.Xaml.Controls
namespace Microsoft.UI.Xaml.Controls.Primitives
{
/// <summary>
/// Represents a panel that arranges its items horizontally if there is available space, otherwise vertically.
/// </summary>
public partial class InfoBarPanel : Panel
{
private bool m_isVertical = false;

/// <summary>
/// Initializes a new instance of the InfoBarPanel class.
/// </summary>
public InfoBarPanel()
{
}

protected override Size MeasureOverride(Size availableSize)
{
var desiredSize = new Size();
Expand Down

0 comments on commit 9784afa

Please sign in to comment.