Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make UWP Color Picker Smaller or Larger

Tags:

c#

xaml

uwp

UWP Color Picker Documentation

There doesn't seem to be a way out of the box to adjust the size of the Color Picker in UWP. Setting Width as seen in the example below doesnt seem to do anything. Setting Height just cuts off the rest of the color picker that is below the specified height.

Am I missing something? Has someone else already come up with a workaround? This seems like it should be something that's out of the box.

<ColorPicker x:Name="myColorPicker"
         ColorSpectrumShape=”Ring”
         IsColorPreviewVisible="False"
         IsColorChannelTextInputVisible="False"
         IsHexInputVisible="False"
         Width="50"
         Height="50"
         />
like image 770
Allen Rufolo Avatar asked Mar 05 '23 11:03

Allen Rufolo


1 Answers

Figured it out. All I had to do was wrap the ColorPicker in a ViewBox element.

<Viewbox Margin="5" MaxWidth="150" Stretch="Fill">
    <ColorPicker x:Name="myColorPicker"
     ColorSpectrumShape=”Ring”
     IsColorPreviewVisible="False"
     IsColorChannelTextInputVisible="False"
     IsHexInputVisible="False"
     />
</Viewbox>
like image 88
Allen Rufolo Avatar answered Mar 17 '23 05:03

Allen Rufolo