NumericIndicator does not support NumberPosition as content.

3 posts, 1 answers
  1. Neil
    Neil avatar
    6 posts
    Member since:
    Jul 2008

    Posted 10 Jan 2009 Link to this post

    I am trying to use a timer like the one shown in the examples (Gauge -> First Look -> Time Monitor) and have used the forum posting here as a starting point. I have managed to get something that is editable in Expression Blend by extracting the styles and templates and it compiles however if I run this in Visual Studio debug I get the error in the subject. Below is a snippet of the xaml I'm using any help much appriciated.

    Cheers.

    <telerikCharting:RadGauge 
                              Width="115"  
                              Height="44"  
                              Style="{StaticResource RadGaugeStyle}"
     
                <telerikGuages:NumericScale Style="{StaticResource NumericScaleStyle}"
     
                    <telerikGuages:NumericScale.Indicators> 
     
                        <telerikGuages:NumericIndicator 
                            Format="{}{0:F2}" 
                            Foreground="Black" 
                            Left="0.05" 
                            Top="0.05" 
                            RelativeWidth="0.9" 
                            RelativeHeight="0.9" 
                            Background="Transparent" 
                            Value="88.88" 
                            Style="{StaticResource NumericIndicatorStyle}"
                             
                            <telerikGuages:NumberPosition Foreground="#FF9B9B9B" Style="{StaticResource SevenSegsPosition}" /> 
                            <telerikGuages:NumberPosition Foreground="#FF9B9B9B" Style="{StaticResource SevenSegsPosition}" /> 
                            <telerikGuages:NumberPosition Foreground="#FF9B9B9B" RelativeWidth="0.4" Style="{StaticResource SevenSegsPosition}" /> 
                            <telerikGuages:NumberPosition Foreground="#FF9B9B9B" Style="{StaticResource SevenSegsPosition}" /> 
                            <telerikGuages:NumberPosition Foreground="#FF9B9B9B" Style="{StaticResource SevenSegsPosition}" /> 
                             
                        </telerikGuages:NumericIndicator> 
     
                        <telerikGuages:NumericIndicator 
                            x:Name="numericIndicator"  
                            Format="{}{0:F2}" 
                            Foreground="Black" 
                            Left="0.05" 
                            Top="0.05" 
                            RelativeWidth="0.9" 
                            RelativeHeight="0.9" 
                            Background="Transparent" 
                            Value="0"
     
                            <telerikGuages:NumberPosition Foreground="Black" Style="{StaticResource SevenSegsPosition}" /> 
                            <telerikGuages:NumberPosition Foreground="Black" Style="{StaticResource SevenSegsPosition}" /> 
                            <telerikGuages:NumberPosition Foreground="Black" RelativeWidth="0.4" Style="{StaticResource SevenSegsPosition}" /> 
                            <telerikGuages:NumberPosition Foreground="Black" Style="{StaticResource SevenSegsPosition}" /> 
                            <telerikGuages:NumberPosition Foreground="Black" Style="{StaticResource SevenSegsPosition}" /> 
     
                        </telerikGuages:NumericIndicator> 
     
                    </telerikGuages:NumericScale.Indicators> 
     
                </telerikGuages:NumericScale> 
     
            </telerikCharting:RadGauge> 

  2. Answer
    Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 13 Jan 2009 Link to this post

    Hi Neil,

    Unfortunately your observations are correct and we must admit we are aware of this problem. Our developers investigated the issue locally and it seems the current implementation of the numeric control does not work seamlessly in Silverlight. While we believe the problem is not related to the control itself but the Silverlight memory handling logic, we are currently redesigning the control to work around the problem and we believe we will be able to release a fixed version for the Q1 2009 release in February.

    Greetings,
    Andrey Murzov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Neil
    Neil avatar
    6 posts
    Member since:
    Jul 2008

    Posted 13 Jan 2009 Link to this post

    Thanks for letting me know. I'll put a temporary control in place for now.

    For anyone interested here is the whole control with extracted styles (I used .NET Reflector to extact the templates and styles from the DLL) so that I could view them locally and edit them in Expression Blend. In the code behind I've just used a DispatcherTimer to update the display (numericIndicator.Value = <whatever>).

    Neil.

    <UserControl x:Class="Timer" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
        xmlns:telerikCharting="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting" 
        xmlns:telerikGuages="clr-namespace:Telerik.Windows.Controls.Gauges;assembly=Telerik.Windows.Controls.Charting" 
        > 
        <UserControl.Resources> 
     
            <ControlTemplate x:Key="RadGaugeTemplate" TargetType="telerikCharting:RadGauge"
                <Border Background="{TemplateBinding Background}" 
                                    BorderBrush="{TemplateBinding BorderBrush}" 
                                    BorderThickness="{TemplateBinding BorderThickness}"
                    <Grid x:Name="PART_ContainerGrid"
                        <ContentPresenter Content="{TemplateBinding Content}"/> 
                    </Grid> 
                </Border> 
            </ControlTemplate> 
             
            <Style x:Key="RadGaugeStyle" TargetType="telerikCharting:RadGauge"
                <Setter Property="Template" Value="{StaticResource RadGaugeTemplate}" /> 
            </Style> 
             
            <ControlTemplate x:Key="IndicatorListTemplate" TargetType="telerikGuages:IndicatorList"
                <ItemsPresenter /> 
            </ControlTemplate> 
     
            <ItemsPanelTemplate x:Key="IndicatorListPanelTemplate"
                <Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> 
            </ItemsPanelTemplate> 
                     
            <Style x:Key="IndicatorListStyle" TargetType="telerikGuages:IndicatorList"
                <Setter Property="Template" Value="{StaticResource IndicatorListTemplate}" /> 
                <Setter Property="ItemsPanel" Value="{StaticResource IndicatorListPanelTemplate}" /> 
            </Style> 
                     
            <ControlTemplate x:Key="NumericScaleTemplate" TargetType="telerikGuages:NumericScale"
                <Grid x:Name="PART_ScaleGrid"
                    <telerikGuages:IndicatorList x:Name="PART_IndicatorList" 
                                     HorizontalAlignment="Stretch" 
                                     VerticalAlignment="Stretch" 
                                     Style="{StaticResource IndicatorListStyle}" /> 
                </Grid> 
            </ControlTemplate> 
             
            <Style x:Key="NumericScaleStyle" TargetType="telerikGuages:NumericScale"
                <Setter Property="Background" Value="Transparent" /> 
                <Setter Property="Multiplier" Value="1" /> 
                <Setter Property="Template" Value="{StaticResource NumericScaleTemplate}" /> 
            </Style> 
     
            <ControlTemplate x:Key="NumericIndicatorTemplate" TargetType="telerikGuages:NumericIndicator"
                <Border BorderBrush="{TemplateBinding BorderBrush}" 
                    BorderThickness="{TemplateBinding BorderThickness}" 
                    Background="{TemplateBinding Background}"
                    <ItemsControl ItemsSource="{TemplateBinding NumberPositions}"
                        <ItemsControl.ItemsPanel> 
                            <ItemsPanelTemplate> 
                                <StackPanel Orientation="Horizontal"/> 
                            </ItemsPanelTemplate> 
                        </ItemsControl.ItemsPanel> 
                    </ItemsControl> 
                </Border> 
            </ControlTemplate> 
                 
            <Style x:Key="NumericIndicatorStyle" TargetType="telerikGuages:NumericIndicator"
                <Setter Property="Template" Value="{StaticResource NumericIndicatorTemplate}" /> 
            </Style> 
     
            <ControlTemplate x:Key="NumberPositionTemplate" TargetType="telerikGuages:NumberPosition"
                <Border BorderBrush="{TemplateBinding BorderBrush}" 
                    BorderThickness="{TemplateBinding BorderThickness}" 
                    Background="{TemplateBinding Background}"
                    <Grid Margin="1,1,1,1"
                        <ContentPresenter VerticalAlignment="{TemplateBinding VerticalAlignment}" 
                                      HorizontalAlignment="{TemplateBinding HorizontalAlignment}"/> 
                    </Grid> 
                </Border> 
            </ControlTemplate> 
             
            <Style x:Key="SevenSegsShapeFill" TargetType="Shape"
                <Setter Property="Stretch" Value="Fill" /> 
                <Setter Property="Fill" Value="Black" /> 
            </Style> 
             
            <DataTemplate x:Key="SevenSegsZero"
                <Grid> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                    </Grid.RowDefinitions> 
     
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="1*" /> 
                        <ColumnDefinition Width="5*" /> 
                        <ColumnDefinition Width="1*" /> 
                    </Grid.ColumnDefinitions> 
     
                    <Rectangle Grid.Row="0" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="1" Grid.Column="0" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="3" Grid.Column="0" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="4" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="3" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="1" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                </Grid> 
            </DataTemplate> 
     
            <DataTemplate x:Key="SevenSegsOne"
                <Grid> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                    </Grid.RowDefinitions> 
     
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="1*" /> 
                        <ColumnDefinition Width="5*" /> 
                        <ColumnDefinition Width="1*" /> 
                    </Grid.ColumnDefinitions> 
     
                    <Rectangle Grid.Row="1" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="3" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                </Grid> 
            </DataTemplate> 
     
            <DataTemplate x:Key="SevenSegsTwo"
                <Grid> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                    </Grid.RowDefinitions> 
     
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="1*" /> 
                        <ColumnDefinition Width="5*" /> 
                        <ColumnDefinition Width="1*" /> 
                    </Grid.ColumnDefinitions> 
     
                    <Rectangle Grid.Row="0" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="1" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="2" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="3" Grid.Column="0" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="4" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                </Grid> 
            </DataTemplate> 
     
            <DataTemplate x:Key="SevenSegsThree"
                <Grid> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                    </Grid.RowDefinitions> 
     
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="1*" /> 
                        <ColumnDefinition Width="5*" /> 
                        <ColumnDefinition Width="1*" /> 
                    </Grid.ColumnDefinitions> 
     
                    <Rectangle Grid.Row="0" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="1" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="2" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="3" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="4" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                </Grid> 
            </DataTemplate> 
     
            <DataTemplate x:Key="SevenSegsFour"
                <Grid> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                    </Grid.RowDefinitions> 
     
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="1*" /> 
                        <ColumnDefinition Width="5*" /> 
                        <ColumnDefinition Width="1*" /> 
                    </Grid.ColumnDefinitions> 
     
                    <Rectangle Grid.Row="1" Grid.Column="0" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="1" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="2" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="3" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                </Grid> 
            </DataTemplate> 
     
            <DataTemplate x:Key="SevenSegsFive"
                <Grid> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                    </Grid.RowDefinitions> 
     
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="1*" /> 
                        <ColumnDefinition Width="5*" /> 
                        <ColumnDefinition Width="1*" /> 
                    </Grid.ColumnDefinitions> 
     
                    <Rectangle Grid.Row="0" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="1" Grid.Column="0" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="2" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="3" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="4" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                </Grid> 
            </DataTemplate> 
     
            <DataTemplate x:Key="SevenSegsSix"
                <Grid> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                    </Grid.RowDefinitions> 
     
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="1*" /> 
                        <ColumnDefinition Width="5*" /> 
                        <ColumnDefinition Width="1*" /> 
                    </Grid.ColumnDefinitions> 
     
                    <Rectangle Grid.Row="0" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="1" Grid.Column="0" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="2" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="3" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="3" Grid.Column="0" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="4" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                </Grid> 
            </DataTemplate> 
     
            <DataTemplate x:Key="SevenSegsSeven"
                <Grid> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                    </Grid.RowDefinitions> 
     
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="1*" /> 
                        <ColumnDefinition Width="5*" /> 
                        <ColumnDefinition Width="1*" /> 
                    </Grid.ColumnDefinitions> 
     
                    <Rectangle Grid.Row="0" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="1" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="3" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                </Grid> 
            </DataTemplate> 
     
            <DataTemplate x:Key="SevenSegsEight"
                <Grid> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                    </Grid.RowDefinitions> 
     
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="1*" /> 
                        <ColumnDefinition Width="5*" /> 
                        <ColumnDefinition Width="1*" /> 
                    </Grid.ColumnDefinitions> 
     
                    <Rectangle Grid.Row="0" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="1" Grid.Column="0" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="1" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="2" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="3" Grid.Column="0" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="3" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="4" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                </Grid> 
            </DataTemplate> 
     
            <DataTemplate x:Key="SevenSegsNine"
                <Grid> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                    </Grid.RowDefinitions> 
     
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="1*" /> 
                        <ColumnDefinition Width="5*" /> 
                        <ColumnDefinition Width="1*" /> 
                    </Grid.ColumnDefinitions> 
     
                    <Rectangle Grid.Row="0" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="1" Grid.Column="0" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="1" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="2" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="3" Grid.Column="2" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                    <Rectangle Grid.Row="4" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                </Grid> 
            </DataTemplate> 
     
            <DataTemplate x:Key="SevenSegsPoint"
                <Grid> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                    </Grid.RowDefinitions> 
     
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="1*" /> 
                        <ColumnDefinition Width="5*" /> 
                        <ColumnDefinition Width="1*" /> 
                    </Grid.ColumnDefinitions> 
     
                    <Rectangle Grid.Row="3" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                </Grid> 
            </DataTemplate> 
     
            <DataTemplate x:Key="SevenSegsComa"
                <Grid> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                    </Grid.RowDefinitions> 
     
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="1*" /> 
                        <ColumnDefinition Width="5*" /> 
                        <ColumnDefinition Width="1*" /> 
                    </Grid.ColumnDefinitions> 
     
                    <Polygon Grid.Row="3" Grid.Column="1"  
                         Points="0,5 10,5 0,10" 
                         Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                </Grid> 
            </DataTemplate> 
     
            <DataTemplate x:Key="SevenSegsMinus"
                <Grid> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                        <RowDefinition Height="5*" /> 
                        <RowDefinition Height="1*" /> 
                    </Grid.RowDefinitions> 
     
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="1*" /> 
                        <ColumnDefinition Width="5*" /> 
                        <ColumnDefinition Width="1*" /> 
                    </Grid.ColumnDefinitions> 
     
                    <Rectangle Grid.Row="2" Grid.Column="1" Style="{StaticResource SevenSegsShapeFill}" Fill="{Binding Foreground}" /> 
                </Grid> 
            </DataTemplate> 
     
            <Style x:Key="SevenSegsPosition" TargetType="telerikGuages:NumberPosition"
                <Setter Property="Foreground" Value="Black" /> 
                <Setter Property="Template" Value="{StaticResource NumberPositionTemplate}" /> 
                <Setter Property="VerticalAlignment" Value="Stretch" /> 
                <Setter Property="HorizontalAlignment" Value="Stretch" /> 
                <Setter Property="TemplateList"
                    <Setter.Value> 
                        <telerikGuages:NumberTemplateList> 
                            <telerikGuages:NumberTemplate Char="0" ItemTemplate="{StaticResource SevenSegsZero}" /> 
                            <telerikGuages:NumberTemplate Char="1" ItemTemplate="{StaticResource SevenSegsOne}" /> 
                            <telerikGuages:NumberTemplate Char="2" ItemTemplate="{StaticResource SevenSegsTwo}" /> 
                            <telerikGuages:NumberTemplate Char="3" ItemTemplate="{StaticResource SevenSegsThree}" /> 
                            <telerikGuages:NumberTemplate Char="4" ItemTemplate="{StaticResource SevenSegsFour}" /> 
                            <telerikGuages:NumberTemplate Char="5" ItemTemplate="{StaticResource SevenSegsFive}" /> 
                            <telerikGuages:NumberTemplate Char="6" ItemTemplate="{StaticResource SevenSegsSix}" /> 
                            <telerikGuages:NumberTemplate Char="7" ItemTemplate="{StaticResource SevenSegsSeven}" /> 
                            <telerikGuages:NumberTemplate Char="8" ItemTemplate="{StaticResource SevenSegsEight}" /> 
                            <telerikGuages:NumberTemplate Char="9" ItemTemplate="{StaticResource SevenSegsNine}" /> 
                            <telerikGuages:NumberTemplate Char="." ItemTemplate="{StaticResource SevenSegsPoint}" /> 
                            <telerikGuages:NumberTemplate Char="," ItemTemplate="{StaticResource SevenSegsComa}" /> 
                            <telerikGuages:NumberTemplate Char="-" ItemTemplate="{StaticResource SevenSegsMinus}" /> 
                        </telerikGuages:NumberTemplateList> 
                    </Setter.Value> 
                </Setter> 
            </Style> 
             
        </UserControl.Resources> 
         
        <Grid> 
            <Grid.ColumnDefinitions> 
                <ColumnDefinition Width="0.096*"/> 
                <ColumnDefinition Width="0.904*"/> 
            </Grid.ColumnDefinitions> 
     
            <Border BorderThickness="2,2,2,2" CornerRadius="5,5,5,5" HorizontalAlignment="Left" VerticalAlignment="Top" Height="44.044" Width="115.385" Grid.ColumnSpan="2"
                <Border.BorderBrush> 
                    <LinearGradientBrush EndPoint="0.491356224416577,0.974451988955925" StartPoint="0.777113682471078,-0.027352265088688"
                        <GradientStop Color="#FF7D7D7D" Offset="0.032501"/> 
                        <GradientStop Color="#FF4D4D4D" Offset="0.036112000000000033"/> 
                        <GradientStop Color="#FF656565" Offset="0.065002"/> 
                        <GradientStop Color="#FF454545" Offset="0.068613000000000035"/> 
                        <GradientStop Color="#FF353535" Offset="0.72841"/> 
                        <GradientStop Color="#FF050505" Offset="0.987361"/> 
                        <GradientStop Color="#FF9F9F9F" Offset="0.54499999999999993"/> 
                        <GradientStop Color="#FF454545" Offset="0.381"/> 
                        <GradientStop Color="#FF1C1C1C" Offset="0.65999999999999992"/> 
                    </LinearGradientBrush> 
                </Border.BorderBrush> 
                <Border.Background> 
                    <LinearGradientBrush EndPoint="0.807584166526794,0.893263757228851" StartPoint="0.805126397323723,0.0151588807433606"
                        <GradientStop Color="#FFD8DEE4" Offset="0"/> 
                        <GradientStop Color="#FFBFC6CF" Offset="0.35822325944900513"/> 
                        <GradientStop Color="#FF9DA9B5" Offset="0.3745061457157135"/> 
                        <GradientStop Color="#FFCDD3D8" Offset="0.60921096801757812"/> 
                        <GradientStop Color="#FFCCDCDE" Offset="0.873"/> 
                    </LinearGradientBrush> 
                </Border.Background> 
            </Border> 
             
            <telerikCharting:RadGauge 
                              Width="115"  
                              Height="44"  
                              Style="{StaticResource RadGaugeStyle}" Grid.ColumnSpan="2"
     
                <telerikGuages:NumericScale Style="{StaticResource NumericScaleStyle}"
     
                    <telerikGuages:NumericScale.Indicators> 
     
                    <telerikGuages:NumericIndicator 
                                    Format="{}{0:F2}" 
                                    Foreground="Black" 
                                    Left="0.05" 
                                    Top="0.05" 
                                    RelativeWidth="0.9" 
                                    RelativeHeight="0.9" 
                                    Background="Transparent" 
                                    Value="88.88" 
                                    Style="{StaticResource NumericIndicatorStyle}"
     
                        <telerikGuages:NumberPosition Foreground="#FF9B9B9B" Style="{StaticResource SevenSegsPosition}" /> 
                        <telerikGuages:NumberPosition Foreground="#FF9B9B9B" Style="{StaticResource SevenSegsPosition}" /> 
                        <telerikGuages:NumberPosition Foreground="#FF9B9B9B" RelativeWidth="0.4" Style="{StaticResource SevenSegsPosition}" /> 
                        <telerikGuages:NumberPosition Foreground="#FF9B9B9B" Style="{StaticResource SevenSegsPosition}" /> 
                        <telerikGuages:NumberPosition Foreground="#FF9B9B9B" Style="{StaticResource SevenSegsPosition}" /> 
     
                    </telerikGuages:NumericIndicator> 
                         
                        <telerikGuages:NumericIndicator 
                            x:Name="numericIndicator"  
                            Format="{}{0:F2}" 
                            Foreground="Black" 
                            Left="0.05" 
                            Top="0.05" 
                            RelativeWidth="0.9" 
                            RelativeHeight="0.9" 
                            Background="Transparent" 
                            Value="0"
     
                            <telerikGuages:NumberPosition Foreground="Black" Style="{StaticResource SevenSegsPosition}" /> 
                            <telerikGuages:NumberPosition Foreground="Black" Style="{StaticResource SevenSegsPosition}" /> 
                            <telerikGuages:NumberPosition Foreground="Black" RelativeWidth="0.4" Style="{StaticResource SevenSegsPosition}" /> 
                            <telerikGuages:NumberPosition Foreground="Black" Style="{StaticResource SevenSegsPosition}" /> 
                            <telerikGuages:NumberPosition Foreground="Black" Style="{StaticResource SevenSegsPosition}" /> 
     
                        </telerikGuages:NumericIndicator> 
     
                    </telerikGuages:NumericScale.Indicators> 
     
                </telerikGuages:NumericScale> 
     
            </telerikCharting:RadGauge> 
     
        </Grid> 
    </UserControl> 
     

Back to Top