This is a migrated thread and some comments may be shown as answers.

change Image on ColorPicker

5 Answers 80 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 10 Aug 2009, 11:38 PM
I would like to change the image on the ColorPicker to one that I provide (to the bucket "fill" image). Is this possible? It would be nice to have this image built into the control and then just specify Foreground/Background as a property to determine which image is to be displayed.

5 Answers, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 11 Aug 2009, 06:53 AM
Hello Dennis,

You can customize the appearance of colorpicker button by using  ColorButtonStyle property.
Please take a look at the following example:
http://demos.telerik.com/silverlight/#ColorPicker/FirstLook

I hope that this will help you. Please let us know if you have any other questions.

Regards,
Boryana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Dennis
Top achievements
Rank 1
answered on 11 Aug 2009, 03:36 PM
I agree that this example looks like what I want to accomplish, but I am very confused by the static resource - it looks like you are hand drawing the "image". I just want to say image="paintbucket.png" and be done with it. Is there a way to simply assign a new image, or do I have to "draw" the image using the resources. I will admit to you that I am new to Silverlight.
0
Accepted
Valentin.Stoychev
Telerik team
answered on 11 Aug 2009, 03:40 PM
Hello Dennis,

You can insert any xaml code there - including an Image element with the appropriate content. Just replace the Path elements with Images. Please let us know if you need more help on that.

Greetings,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Dennis
Top achievements
Rank 1
answered on 11 Aug 2009, 04:11 PM
Thanks for the help. I was able to figure it out with the below style (in case someone else wants a quick example).

 
<Style x:Key="StyleBackgroundColorButtonStyle" TargetType="Button">  
 
    <Setter Property="Template">  
 
        <Setter.Value> 
 
            <ControlTemplate TargetType="Button">  
                  
                <Grid> 
                      
                    <Border x:Name="BackgroundGradient" BorderThickness="1" Background="Transparent">  
                          
                        <Grid> 
                              
                            <Grid.RowDefinitions> 
                                  
                                <RowDefinition Height="0.664*"></RowDefinition> 
                                  
                                <RowDefinition Height="0.336*"></RowDefinition> 
                                  
                            </Grid.RowDefinitions> 
 
                            <Image Width="20" Height="20" Source="../../Images/Common20/BackgroundColorFill.png" ToolTipService.ToolTip="Background Color" /> 
 
                            <Rectangle Width="16" Fill="{TemplateBinding Background}" Height="4.232" Grid.Row="1" VerticalAlignment="Top"></Rectangle> 
 
                        </Grid> 
                          
                    </Border> 
                      
                      
                </Grid> 
 
            </ControlTemplate> 
 
        </Setter.Value> 
 
    </Setter> 
 
</Style> 
0
Jugal
Top achievements
Rank 2
answered on 07 Sep 2011, 10:02 AM
Thanks Dennis...
It is what I needed.
Tags
ColorPicker
Asked by
Dennis
Top achievements
Rank 1
Answers by
Bobi
Telerik team
Dennis
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
Jugal
Top achievements
Rank 2
Share this question
or