This question is locked. New answers and comments are not allowed.
Hi,
I'm trying to use the sample code that I found at http://demos.telerik.com/silverlight/silverlight3/#Gauge/Gallery/Thermometer, but I am getting a lot of missing style problems.
Here are some of the missing styles:
Additional information:
1.I downloaded the latest library (2011.3.1116.1040)
2.I added all 4 DLL's
MyCode:
I'm trying to use the sample code that I found at http://demos.telerik.com/silverlight/silverlight3/#Gauge/Gallery/Thermometer, but I am getting a lot of missing style problems.
Here are some of the missing styles:
<Style x:Key="ThermometerMajorPropertiesStyle" BasedOn="{StaticResource Telerik.Windows.Controls.Gauges.MajorTickProperties}" TargetType="gauge:MajorTickProperties">
<Style x:Key="ThermometerMinorPropertiesStyle" BasedOn="{StaticResource Telerik.Windows.Controls.Gauges.MinorTickProperties}" TargetType="gauge:MinorTickProperties">
<Style x:Key="CustomTickMarkCelsiusStyle" BasedOn="{StaticResource Telerik.Windows.Controls.Gauges.CustomTickMark}" TargetType="gauge:CustomTickMark">
Value="30" Location="OverCenter" ValueChanged="ThresholdValueCanged" Style="{StaticResource Telerik.Windows.Controls.Gauges.Marker}" />
Additional information:
1.I downloaded the latest library (2011.3.1116.1040)
2.I added all 4 DLL's
MyCode:
<UserControl x:Class="MyControls.DashboardThermometerControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:control="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Gauge" xmlns:gauge="clr-namespace:Telerik.Windows.Controls.Gauges;assembly=Telerik.Windows.Controls.Gauge" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid> <Grid.Resources> <DataTemplate x:Key="DefaultTickShape"> <Rectangle Fill="{Binding Path=Properties.Background}" Stroke="{Binding Path=Properties.BorderBrush}" StrokeThickness="{Binding Path=Properties.BorderThickness.Left}" Stretch="Fill" /> </DataTemplate> <Style x:Key="ThermometerMajorPropertiesStyle" BasedOn="{StaticResource Telerik.Windows.Controls.Gauges.MajorTickProperties}" TargetType="gauge:MajorTickProperties"> <Setter Property="Length" Value="0.05" /> <Setter Property="TickWidth" Value="0.17" /> <Setter Property="Location" Value="OverCenter" /> <Setter Property="Offset" Value="0" /> <Setter Property="Background" Value="White" /> <Setter Property="ItemTemplate" Value="{StaticResource DefaultTickShape}" /> </Style> <Style x:Key="ThermometerMinorPropertiesStyle" BasedOn="{StaticResource Telerik.Windows.Controls.Gauges.MinorTickProperties}" TargetType="gauge:MinorTickProperties"> <Setter Property="Length" Value="0.05" /> <Setter Property="TickWidth" Value="0.039" /> <Setter Property="Location" Value="OverCenter" /> <Setter Property="Offset" Value="0" /> <Setter Property="Background" Value="White" /> <Setter Property="ItemTemplate" Value="{StaticResource DefaultTickShape}" /> </Style> <DataTemplate x:Key="TickLabelEmpty"> <Canvas /> </DataTemplate> <Style x:Key="CustomTickMarkCelsiusStyle" BasedOn="{StaticResource Telerik.Windows.Controls.Gauges.CustomTickMark}" TargetType="gauge:CustomTickMark"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <ContentPresenter> <ContentPresenter.Content> <Canvas> <TextBlock HorizontalAlignment="Center" FontSize="12" Foreground="White" Margin="6,6,0,0" Text="C" /> <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="White" Margin="0,1,0,0" Text="o" /> </Canvas> </ContentPresenter.Content> </ContentPresenter> </ControlTemplate> </Setter.Value> </Setter> <Setter Property="ItemTemplate" Value="{StaticResource TickLabelEmpty}" /> <Setter Property="Length" Value="0.05" /> <Setter Property="Offset" Value="0.02" /> <Setter Property="TickWidth" Value="1" /> <Setter Property="Location" Value="Outside" /> </Style> <Style x:Key="CustomTickMarkFahrenheitStyle" BasedOn="{StaticResource Telerik.Windows.Controls.Gauges.CustomTickMark}" TargetType="gauge:CustomTickMark"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <ContentPresenter> <ContentPresenter.Content> <Canvas> <TextBlock HorizontalAlignment="Center" FontSize="12" Foreground="White" Margin="6,6,0,0" Text="F" /> <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="White" Margin="0,1,0,0" Text="o" /> </Canvas> </ContentPresenter.Content> </ContentPresenter> </ControlTemplate> </Setter.Value> </Setter> <Setter Property="ItemTemplate" Value="{StaticResource TickLabelEmpty}" /> <Setter Property="Length" Value="0.05" /> <Setter Property="Offset" Value="0.02" /> <Setter Property="TickWidth" Value="1" /> <Setter Property="Location" Value="Inside" /> </Style> <Style x:Key="BulbOfThermometerBarStyle" BasedOn="{StaticResource Telerik.Windows.Controls.Gauges.CustomTickMark}" TargetType="gauge:CustomTickMark"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <ContentPresenter> <ContentPresenter.Content> <Grid Margin="-7,23,-5,24" Width="100"> <Grid Margin="39.5,1,39.5,0"> <Ellipse Stretch="Fill" Height="21" Fill="#FF720700" Margin="0,0,0,0" VerticalAlignment="Bottom" Opacity="0.5" /> <Border CornerRadius="6,6,6,6" BorderBrush="#FF720700" BorderThickness="2,2,2,2" Margin="3,0,3,2" Width="12" Opacity="0.5"> <Border.Background> <LinearGradientBrush StartPoint="0.5,0.955317" EndPoint="0.5,0.00861141"> <GradientStop Color="#FF5A0400" Offset="0" /> <GradientStop Color="#FF900C00" Offset="1" /> </LinearGradientBrush> </Border.Background> </Border> <Border Margin="6.5,1,6.5,3" CornerRadius="5,5,5,5" BorderBrush="#FFFF6D00" BorderThickness="1,1,1,1" Background="{x:Null}" VerticalAlignment="Stretch" /> <Ellipse Stretch="Fill" Height="17" VerticalAlignment="Bottom" Stroke="#FFFF6D00" Margin="2,0,2,2" x:Name="redEllipse"> <Ellipse.Fill> <RadialGradientBrush> <GradientStop Offset="0" Color="#FF720700" /> </RadialGradientBrush> </Ellipse.Fill> </Ellipse> <Border Margin="7.5,2,7.5,4" CornerRadius="4,4,4,4" BorderBrush="#FF720700" BorderThickness="1,1,1,1"> <Border.Background> <LinearGradientBrush StartPoint="0.5,0.955317" EndPoint="0.5,0.00861141"> <GradientStop Color="#FF5A0400" Offset="0" /> <GradientStop Color="#FF900C00" Offset="1" /> </LinearGradientBrush> </Border.Background> </Border> <Border Margin="8.5,220,8.5,9" CornerRadius="3,3,3,3"> <Border.Background> <LinearGradientBrush StartPoint="-0.0263883,0.499995" EndPoint="1.01428,0.499995"> <GradientStop Color="#FFFEFFFE" Offset="0" /> <GradientStop Color="#FFFEFFFE" Offset="0.5" /> <GradientStop Color="#FFD8DADB" Offset="0.501" /> <GradientStop Color="#FFB2B5B7" Offset="1" /> </LinearGradientBrush> </Border.Background> </Border> <Ellipse Stretch="Fill" Height="13" Margin="4,0,4,4" VerticalAlignment="Bottom"> <Ellipse.Fill> <LinearGradientBrush StartPoint="-0.0263883,0.499995" EndPoint="1.01428,0.499995"> <GradientStop Color="#FFFEFFFE" Offset="0" /> <GradientStop Color="#FFFEFFFE" Offset="0.50" /> <GradientStop Color="#FFD8DADB" Offset="0.501" /> <GradientStop Color="#FFB2B5B7" Offset="1" /> </LinearGradientBrush> </Ellipse.Fill> </Ellipse> </Grid> </Grid> </ContentPresenter.Content> </ContentPresenter> </ControlTemplate> </Setter.Value> </Setter> <Setter Property="ItemTemplate" Value="{StaticResource TickLabelEmpty}" /> <Setter Property="Length" Value="1" /> <Setter Property="Offset" Value="0" /> <Setter Property="TickWidth" Value="1" /> <Setter Property="Type" Value="Custom" /> </Style> <ControlTemplate x:Key="LinearBarTemplate" TargetType="gauge:LinearBar"> <Grid> <Path x:Name="PART_BarPath" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding StrokeThickness}" /> <Path x:Name="PART_EmptyPath" Fill="{TemplateBinding EmptyFill}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding StrokeThickness}" /> </Grid> </ControlTemplate> <Style x:Key="ThermometerBarStyle" TargetType="gauge:LinearBar"> <Setter Property="StrokeThickness" Value="0" /> <Setter Property="IsAnimated" Value="True" /> <Setter Property="EmptyFill" Value="Transparent" /> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush StartPoint="-0.0263883,0.499995" EndPoint="1.01428,0.499995"> <GradientStop Color="#FFFEFFFE" Offset="0" /> <GradientStop Color="#FFFEFFFE" Offset="0.5" /> <GradientStop Color="#FFD8DADB" Offset="0.501" /> <GradientStop Color="#FFB2B5B7" Offset="1" /> </LinearGradientBrush> </Setter.Value> </Setter> <Setter Property="StartWidth" Value="0.013" /> <Setter Property="EndWidth" Value="0.013" /> <Setter Property="Template" Value="{StaticResource LinearBarTemplate}" /> </Style> </Grid.Resources> <control:RadGauge x:Name="radGauge" Width="150" Height="300" Style="{StaticResource Telerik.Windows.Controls.RadGauge}"> <gauge:LinearGauge Style="{StaticResource Telerik.Windows.Controls.Gauges.LinearGauge}"> <gauge:LinearScale Name="linearScaleF" MajorTicks="6" MiddleTicks="1" MinorTicks="5" Left="0.5" Top="0.17" RelativeHeight="0.65" StrokeThickness="0" StartWidth="0.09" Min="-22" Max="104" StartTickOffset="2" EndTickOffset="-4" Background="Transparent"> <gauge:LinearScale.MajorTick> <gauge:MajorTickProperties Location="CenterInside" Style="{StaticResource ThermometerMajorPropertiesStyle}" /> </gauge:LinearScale.MajorTick> <gauge:LinearScale.MinorTick> <gauge:MinorTickProperties Location="CenterInside" Style="{StaticResource ThermometerMinorPropertiesStyle}" /> </gauge:LinearScale.MinorTick> <gauge:LinearScale.Label> <gauge:LabelProperties Offset="0.02" Location="Inside" Style="{StaticResource Telerik.Windows.Controls.Gauges.LabelProperties}" /> </gauge:LinearScale.Label> </gauge:LinearScale> <gauge:LinearScale Name="linearScaleC" MiddleTicks="1" MinorTicks="5" Left="0.5" Top="0.17" RelativeHeight="0.65" StrokeThickness="0" StartWidth="0.09" MajorTicks="7" Min="-30" Max="40" Background="Transparent"> <gauge:LinearScale.MajorTick> <gauge:MajorTickProperties Location="CenterOutside" Style="{StaticResource ThermometerMajorPropertiesStyle}" /> </gauge:LinearScale.MajorTick> <gauge:LinearScale.MinorTick> <gauge:MinorTickProperties Location="CenterOutside" Style="{StaticResource ThermometerMinorPropertiesStyle}" /> </gauge:LinearScale.MinorTick> <gauge:LinearScale.Label> <gauge:LabelProperties Offset="0.02" Location="Outside" Style="{StaticResource Telerik.Windows.Controls.Gauges.LabelProperties}" /> </gauge:LinearScale.Label> <gauge:TickList> <gauge:CustomTickMark Value="-37" Style="{StaticResource CustomTickMarkCelsiusStyle}" /> <gauge:CustomTickMark Value="-37.3" Style="{StaticResource CustomTickMarkFahrenheitStyle}" /> <gauge:CustomTickMark Value="5" Style="{StaticResource BulbOfThermometerBarStyle}" Location="OverCenter" /> </gauge:TickList> <gauge:IndicatorList> <gauge:LinearBar Name="linearBar" Value="0" Style="{StaticResource ThermometerBarStyle}" Location="OverCenter" /> </gauge:IndicatorList> </gauge:LinearScale> <gauge:LinearScale Left="0.5" Top="0.17" RelativeHeight="0.65" StrokeThickness="0" Min="-30" Max="40" Foreground="Transparent" MajorTicks="-1" IsInteractive="True" Background="Transparent"> <gauge:RangeList> <gauge:LinearRange Name="coldRange" Min="-30" Max="30" StartWidth="0" EndWidth="0" BorderBrush="Transparent"> <gauge:LinearRange.Background> <RadialGradientBrush> <GradientStop Offset="0" Color="LightGreen" /> <GradientStop Offset="1" Color="DarkGreen" /> </RadialGradientBrush> </gauge:LinearRange.Background> </gauge:LinearRange> <gauge:LinearRange Name="overheatRange" Min="30" Max="40" StartWidth="0" EndWidth="0" BorderBrush="Transparent"> <gauge:LinearRange.Background> <RadialGradientBrush> <GradientStop Offset="0" Color="Orange" /> <GradientStop Offset="1" Color="Red" /> </RadialGradientBrush> </gauge:LinearRange.Background> </gauge:LinearRange> </gauge:RangeList> <gauge:IndicatorList> <gauge:Marker Name="threshold" RelativeHeight="0.06" RelativeWidth="0.08" Value="30" Location="OverCenter" ValueChanged="ThresholdValueCanged" Style="{StaticResource Telerik.Windows.Controls.Gauges.Marker}" /> <gauge:StateIndicator Name="overheatState" Left="0.65" Top="0.04" RelativeHeight="0.08" RelativeWidth="0.08" /> </gauge:IndicatorList> </gauge:LinearScale> </gauge:LinearGauge> </control:RadGauge> </Grid> </UserControl>