This question is locked. New answers and comments are not allowed.
Hi telerik team,
I succeeded to load RadGauge on my view and bind to my bisiness object,
so I created style in order to bind many gauges in itemscontrol,however
gauge is not shown but needle only does. Following is my style in resource dictionary.
I guess I missed static resouce,so added style with resource dictinary as bellows
but view unresponed for a long time and finally complains stack overflow saying
"element is already another child of ..".
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Fonts.xaml"/>
<ResourceDictionary Source="/Telerik.Windows.Controls.Gauge;component/Themes/Generic.xaml" />
</ResourceDictionary.MergedDictionaries>
Style is added as follows with above code.
<telerik:RadGauge Style="{StaticResource RadialGaugeHalfCircleNStyle}">
and
<telerik:RadialScale Style="{StaticResource RadialScaleHalfCircleNStyle}"
I heared it hurts performance when using sperated module with separate dictionary,
but it looks my ignorance to apply style in this case.
Any sample or advice would be highly appreciated.
Thank you in advance.
RGDS
Kang
I succeeded to load RadGauge on my view and bind to my bisiness object,
so I created style in order to bind many gauges in itemscontrol,however
gauge is not shown but needle only does. Following is my style in resource dictionary.
<Style x:Key="GaugeStyle" TargetType="telerik:HeaderedContentControl"> <Setter Property="HorizontalAlignment" Value="Stretch" /> <Setter Property="VerticalAlignment" Value="Stretch" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="VerticalContentAlignment" Value="Stretch" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="telerik:HeaderedContentControl"> <Border Style="{StaticResource BorderStyle}" Margin="2"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="30"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="0.65*"/> <ColumnDefinition Width="0.35*"/> </Grid.ColumnDefinitions> <TextBlock Grid.Column="0" Text="{Binding Path=HeatPartName}" Style="{StaticResource TextBlockStyle}"/> <TextBlock Grid.Column="1" Text="{Binding Path=CurrentThermo}" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Right" /> <ContentPresenter Grid.Row="1"> <ContentPresenter.Content> <telerik:RadGauge Grid.Row="1" Margin="3"> <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <telerik:RadialScale Min="0" Max="40" MajorTicks="8" MiddleTicks="4" LabelRotationMode="Automatic"> <telerik:RadialScale.MajorTick> <telerik:MajorTickProperties Length="0.1"/> </telerik:RadialScale.MajorTick> <telerik:RadialScale.MiddleTick> <telerik:MiddleTickProperties Length="0.07" /> </telerik:RadialScale.MiddleTick> <telerik:RadialScale.Label> <telerik:LabelProperties FontSize="8" /> </telerik:RadialScale.Label> <telerik:RadialRange Min="{Binding Path=Model.StdThermoLow}" Max="{Binding Path=Model.StdThermoHigh}" StartWidth="0.05" EndWidth="0.05" Background="Green" TickBackground="Green" LabelForeground="Green" IndicatorBackground="Green" /> <telerik:IndicatorList> <telerik:RadialBar IsAnimated="True" Value="{Binding Path=Model.CurrentThermo}" /> <telerik:Needle IsAnimated="true" Value="{Binding Path=Model.CurrentThermo}" /> </telerik:IndicatorList> </telerik:RadialScale> </Grid> </telerik:RadGauge> </ContentPresenter.Content> </ContentPresenter> </Grid> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style>I guess I missed static resouce,so added style with resource dictinary as bellows
but view unresponed for a long time and finally complains stack overflow saying
"element is already another child of ..".
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Fonts.xaml"/>
<ResourceDictionary Source="/Telerik.Windows.Controls.Gauge;component/Themes/Generic.xaml" />
</ResourceDictionary.MergedDictionaries>
Style is added as follows with above code.
<telerik:RadGauge Style="{StaticResource RadialGaugeHalfCircleNStyle}">
and
<telerik:RadialScale Style="{StaticResource RadialScaleHalfCircleNStyle}"
I heared it hurts performance when using sperated module with separate dictionary,
but it looks my ignorance to apply style in this case.
Any sample or advice would be highly appreciated.
Thank you in advance.
RGDS
Kang