Share via


ColorPicker.Orientation Property

Definition

Gets or sets the orientation of the editing controls in the ColorPicker.

This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

public:
 property Orientation Orientation { Orientation get(); void set(Orientation value); };
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::Orientation::Vertical")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::Orientation::Vertical")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::Orientation::Vertical")]
Orientation Orientation();

void Orientation(Orientation value);
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::Orientation::Vertical")]
public Orientation Orientation { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::Orientation::Vertical")] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::Orientation::Vertical")] set; }
Public Property Orientation As Orientation

Property Value

The orientation of the editing controls in the ColorPicker. The default is Vertical.

Attributes
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

Remarks

When the Orientation property is set to Horizontal, the ColorPicker will not apply the IsMoreButtonEnabled property. Instead, the text input fields will always be displayed to the side of the ColorPicker.

Horizontal Orientation Text Input Margin

When in Horizontal mode and the text input fields are in use, there will be a margin of 122px to the right of the text input fields. This margin accounts for the different localizations of the labels of the fields and ensures that those labels will not be cut off. This margin is determined by the ColorPickerTextInputHorizontalOrientationMargin lightweight styling resource.

  • If your app is only available in English, you can override this resource and set the right margin to 74px to improve the horizontal footprint of the control.
  • The resource does have not have any effect when the Orientation is set to Vertical.

Applies to

See also