ColorPicker ToolTip Removal

2 posts, 0 answers
  1. Anabayan
    Anabayan avatar
    3 posts
    Member since:
    Feb 2012

    Posted 28 Feb 2012 Link to this post

    Hi,
    Is there any specific style that I can use to remove the tooltip(#FF00FF00) For ColorPicker?
  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 29 Feb 2012 Link to this post

    Hi Anabayan,

    You can try and remove the tooltip from the rectangle as shown bellow:

    <UserControl x:Class="ID_517059.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d" d:DesignHeight="300"
            d:DesignWidth="400">
        <UserControl.Resources>
            <SolidColorBrush x:Key="ColorPaletteViewItem_Border" Color="#FFC9C9CB" />
            <SolidColorBrush x:Key="ColorPaletteViewItem_OuterBorder_MouseOver" Color="#FFFFC92B" />
            <SolidColorBrush x:Key="ColorPaletteViewItem_InnerBorder_MouseOver" Color="#FFFFFFFF" />
            <SolidColorBrush x:Key="ColorPaletteViewItem_OuterBorder_Selected" Color="#FF5D5D5D" />
            <LinearGradientBrush x:Key="ColorPaletteViewItem_InnerBorder_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFB69A78" />
                <GradientStop Color="#FFFFE17A" Offset="0.126" />
            </LinearGradientBrush>
            <!--RadcolorPaletteViewItem-->
            <Style x:Key="RadColorPaletteViewItemStyle" TargetType="telerik:RadColorPaletteViewItem">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="telerik:RadColorPaletteViewItem">
                            <Grid x:Name="RootElement" Margin="0">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="FocusStates">
                                        <VisualState x:Name="Unfocused" />
                                        <VisualState x:Name="Focused" />
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="MouseOver">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                        Storyboard.TargetName="border">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Visible</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Normal" />
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="SelectionStates">
                                        <VisualState x:Name="Unselected" />
                                        <VisualState x:Name="Selected">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush"
                                                        Storyboard.TargetName="border">
                                                    <DiscreteObjectKeyFrame KeyTime="0"
                                                            Value="{StaticResource ColorPaletteViewItem_OuterBorder_Selected}" />
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush"
                                                        Storyboard.TargetName="Innerborder">
                                                    <DiscreteObjectKeyFrame KeyTime="0"
                                                            Value="{StaticResource ColorPaletteViewItem_InnerBorder_Selected}" />
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                        Storyboard.TargetName="border">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Visible</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="PositionStates">
                                        <VisualState x:Name="Top">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderThickness"
                                                        Storyboard.TargetName="borderContent">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="1 1 1 0" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Single">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderThickness"
                                                        Storyboard.TargetName="borderContent">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="1" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Middle">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderThickness"
                                                        Storyboard.TargetName="borderContent">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="1 0" />
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="MinWidth"
                                                        Storyboard.TargetName="borderContent">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="13" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Bottom">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderThickness"
                                                        Storyboard.TargetName="borderContent">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="1 0 1 1" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Rectangle x:Name="color" MinHeight="11" MinWidth="11" Stretch="Fill" Margin="2 0"
                                        Fill="{TemplateBinding Content}" ToolTipService.ToolTip="{Binding}" />
                                <Border MinHeight="13" MinWidth="13"
                                        BorderBrush="{StaticResource ColorPaletteViewItem_Border}" Margin="2 0"
                                        x:Name="borderContent" VerticalAlignment="Stretch" BorderThickness="1">
                                    <Border BorderThickness="1" x:Name="InnerborderContent" />
                                </Border>
                                <Border MinHeight="13" MinWidth="13"
                                        BorderBrush="{StaticResource ColorPaletteViewItem_OuterBorder_MouseOver}"
                                        Margin="2 0" x:Name="border" VerticalAlignment="Stretch" BorderThickness="1"
                                        Visibility="Collapsed">
                                    <Border BorderThickness="1" x:Name="Innerborder"
                                            BorderBrush="{StaticResource ColorPaletteViewItem_InnerBorder_MouseOver}" />
                                </Border>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Content" Value="Color" />
                <Setter Property="Color" Value="Green" />
            </Style>
        </UserControl.Resources>
        <Grid x:Name="LayoutRoot" Background="White">
            <telerik:RadColorPicker MainPaletteItemsStyle="{StaticResource RadColorPaletteViewItemStyle}" />
        </Grid>
    </UserControl>

    The code you need to remove is marked with orange color. Give it a try and let me know how it goes.

    All the best,
    Kiril Stanoev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
Back to Top