Microsoft-ui-xaml: Update InfoBarPanel APIs to match existing concepts of padding and spacing

Created on 25 Nov 2020  ·  2Comments  ·  Source: microsoft/microsoft-ui-xaml

Update the naming of properties on InfoBarPanel to match existing concepts of padding and spacing.

Rename HorizontalMargin and VerticalMargin attached properties and use them just for the children. Currently we are also setting these on InfoBarPanel itself. Instead we should be using the new padding properties named as below for that purpose.

unsealed runtimeclass InfoBarPanel : Windows.UI.Xaml.Controls.Panel
{
    InfoBarPanel();

   // Normal dependency properties to set padding around the children 
    Windows.UI.Xaml.Thickness PaddingInHorizontalOrientation; 
    static Windows.UI.Xaml.DependencyProperty PaddingInHorizontalOrientationProperty{ get; };}

   Windows.UI.Xaml.Thickness PaddingInVerticalOrientation;
    static Windows.UI.Xaml.DependencyProperty PaddingInVerticalOrientationProperty{ get; };}

    // Attached properties to define spacing for each child 
    static void SetSpacingInHorizontalOrientation (Windows.UI.Xaml.DependencyObject object, Windows.UI.Xaml.Thickness value);
    static Windows.UI.Xaml.Thickness GetSpacingInHorizontalOrientation (Windows.UI.Xaml.DependencyObject object);
    static Windows.UI.Xaml.DependencyProperty SpacingInHorizontalOrientationProperty{ get; };

    static void SetSpacingInVerticalOrientation (Windows.UI.Xaml.DependencyObject object, Windows.UI.Xaml.Thickness value);
    static Windows.UI.Xaml.Thickness GetSpacingInVerticalOrientation (Windows.UI.Xaml.DependencyObject object);
    static Windows.UI.Xaml.DependencyProperty SpacingInVerticalOrientationProperty{ get; };
}

These will show up in markup like so (ignore values).

<InfoBarPanel PadingInHorizontalOrientation=”x,x,x,x” PaddingInVerticalOrientation=”x,x,x,x”>
       <ChildControl   InfoBarPanel.SpacingInHorizontalOrientation=”x,x,x,x” InfoBarPanel.SpacingInVerticalOrientation=”x,x,x,x” />
        …
</>

And the theme resources follow this pattern
• InfoBar(Title|Message|Action)(Horizontal|Vertical)LayoutMargin  InfoBar(Title|Message|Action)SpacingIn(Horizontal|Vertical)Orientation
• InfoBarPanel(Horizontal|Vertical)LayoutMargin  InfoBarPanelPaddingIn(Horizontal|Vertical)Orientation

area-InfoBar help wanted team-Controls

Most helpful comment

I'm never going to be able to talk you out of what was decided in API review; however, something along the lines of below makes more sense to me. I wouldn't expect to see "In" used within property names. Historically, words within a property or class name were just reordered to remove connecting words like this.

Thickness HorizontalOrientationPadding; 
DependencyProperty HorizontalOrientationPaddingProperty{ get; };}

Thickness VerticalOrientationPadding;
DependencyProperty VerticalOrientationPaddingProperty{ get; };}

All 2 comments

I would like to work on this.

I'm never going to be able to talk you out of what was decided in API review; however, something along the lines of below makes more sense to me. I wouldn't expect to see "In" used within property names. Historically, words within a property or class name were just reordered to remove connecting words like this.

Thickness HorizontalOrientationPadding; 
DependencyProperty HorizontalOrientationPaddingProperty{ get; };}

Thickness VerticalOrientationPadding;
DependencyProperty VerticalOrientationPaddingProperty{ get; };}
Was this page helpful?
0 / 5 - 0 ratings