Problem with color of the Numericindicator

3 posts, 0 answers
  1. Daniel Ruehle
    Daniel Ruehle avatar
    19 posts
    Member since:
    May 2010

    Posted 05 Nov 2010 Link to this post

    Hello,

    I have a trouble whith the color of the numericindicator in my application namely altough the foreground  is setted to blue and it is the same color like scale, color of th numericindicator darker.

    Could please check code below and screenshot.

    Thnx

    Daniel
    <telerik:IndicatorList>
                                <telerik:Needle x:Name="needleRPM"
                                     Value="{Binding Path=RPM}"
                                     Style="{DynamicResource NeedleStyle1}"                                 
                                     >
                                    <telerik:Needle.ArrowBackground>
                                        <LinearGradientBrush EndPoint="0,0.5" StartPoint="1,0.5" MappingMode="RelativeToBoundingBox">
                                            <GradientStop Color="#FFFFD25A" Offset="0.6"/>
                                            <GradientStop Color="#FFFF2222" Offset="1"/>
                                            <GradientStop Color="#FFFFD25A"/>
                                            <GradientStop Color="Red" Offset="0.323"/>
                                        </LinearGradientBrush>
                                    </telerik:Needle.ArrowBackground>
                                </telerik:Needle>
                                <telerik:NumericIndicator x:Name="Speed"
                                    Panel.ZIndex="-1000"                          
                                    CornerRadius="10"
                                    Top="0.17"
                                    Left="0.33"
                                    RelativeHeight="0.35"
                                    RelativeWidth="0.7"
                                    TemplatePrefix="HexagonalSevenSegs"
                                    Foreground="{Binding BigGaugeScaleColor}"
                                    Background="{x:Null}"                             
                                    Format="{}{0:F0}"
                                    Value="{Binding Path=Speed}"                               
                                    >
                                    <telerik:NumberPosition CornerRadius="25" Margin="1,3,0,3" Background="{x:Null}"/>
                                    <telerik:NumberPosition CornerRadius="25" Margin="1,3" Background="{x:Null}"/>
                                    <telerik:NumberPosition CornerRadius="25" Margin="1,3,0,3" Background="{x:Null}"/>
                                </telerik:NumericIndicator>
                                <telerik:RadialBar x:Name="radialBar"
                                    UseRangeColor="True"
                                    RangeColorMode="Default"
                                    Value="0" VerticalAlignment="Top"
                                />                          
                            </telerik:IndicatorList>
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 10 Nov 2010 Link to this post

    Hello Daniel Ruehle,

    Thank you for feedback.
    We were able to reproduce the problem. The default template for the NumberPosition contains the hardcoded Opacity value. We have created the PITS issue to fix this problem in future releases.
    You can track it using the following link:

    http://www.telerik.com/support/pits.aspx#/public/wpf/3934

    As workaround you can use the a which does not contain this problem.
    The sample code is below.

    <Window x:Class="NumericindicatorColor.MainWindow"
            Title="MainWindow" Height="350" Width="525">
        <Window.Resources>
            <Style x:Key="NumberPositionStyle" TargetType="telerik:NumberPosition">
                <Setter Property="VerticalAlignment" Value="Stretch" />
                <Setter Property="HorizontalAlignment" Value="Stretch"/>
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="telerik:NumberPosition">
                            <Grid>
                                <Border BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="{TemplateBinding BorderThickness}"
                                        Background="{TemplateBinding Background}"
                                        CornerRadius="{TemplateBinding CornerRadius}"
                                        Opacity="{TemplateBinding Opacity}"
                                        Margin="{TemplateBinding Margin}">
                                    <ContentPresenter VerticalAlignment="{TemplateBinding VerticalAlignment}"
                                                      HorizontalAlignment="{TemplateBinding HorizontalAlignment}" />
                                </Border>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Window.Resources>
        <Grid Background="White">
            <Grid Width="200" Height="200" Background="Black">
                <telerik:RadialScale Radius="0.8" Background="Blue">
                    <telerik:IndicatorList>
                        <telerik:NumericIndicator x:Name="Speed"
                                    Top="0.32"
                                    Left="0.32"
                                    Padding="5"
                                    BorderThickness="0"
                                    RelativeHeight="0.75"
                                    RelativeWidth="0.75"
                                    TemplatePrefix="HexagonalSevenSegs"
                                    Foreground="Blue"
                                    Background="Transparent"
                                    Format="{}{0:F0}"
                                    Value="50">
                            <telerik:NumberPosition Style="{StaticResource NumberPositionStyle}"/>
                            <telerik:NumberPosition Style="{StaticResource NumberPositionStyle}"/>
                        </telerik:NumericIndicator>
                    </telerik:IndicatorList>
                </telerik:RadialScale>
            </Grid>
        </Grid>
    </Window>

    Regards,
    Andrey Murzov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Daniel Ruehle
    Daniel Ruehle avatar
    19 posts
    Member since:
    May 2010

    Posted 11 Nov 2010 Link to this post

    Hello Andrey,

    Thanks a lot for your help.

    Best regards,
    Daniel
Back to Top