Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ColorPicker > change Image on ColorPicker

Answered change Image on ColorPicker

Feed from this thread
  • Posted on Aug 10, 2009 (permalink)

    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.

    Reply

  • Bobi Bobi admin's avatar

    Posted on Aug 11, 2009 (permalink)

    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.

    Reply

  • Posted on Aug 11, 2009 (permalink)

    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.

    Reply

  • Answer Valentin.Stoychev Valentin.Stoychev admin's avatar

    Posted on Aug 11, 2009 (permalink)

    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.

    Reply

  • Posted on Aug 11, 2009 (permalink)

    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> 

    Reply

  • Jugal avatar

    Posted on Sep 7, 2011 (permalink)

    Thanks Dennis...
    It is what I needed.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ColorPicker > change Image on ColorPicker
Related resources for "change Image on ColorPicker"

Silverlight ColorPicker Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]