This project is read-only.

Background property

May 18, 2010 at 8:58 AM

Hi,

I want to set the background property of a ToggleButton but this does not work, the background of the control is always transparent!

How can I get this work, or does anybody know a workaround for this problem? I want to show some standard colors like in paint also I want to be able to show a customize color on a ToggleButton!!

 

Thanks Alex

May 18, 2010 at 11:20 AM

Hello, Alex. Like paint? You can set DrawingImage to DropDownButton.LargeIcon & DropDownButton.Icon (in XAML or code), somthing like this:

<DrawingImage>
    <DrawingImage.Drawing>
         <GeometryDrawing Brush="{Binding SelectedBrush ....}">
            <GeometryDrawing.Geometry>
              <GeometryGroup>
                <RectangleGeometry Rect="0,0,32,32"/>
              </GeometryGroup>
                ....
                ....

To show palette you may use Gallery.

Is it helpful?
Daniel

May 19, 2010 at 2:00 PM

thanks, everything works fine now!!