Hello,
How Can I use custom NodataTemplate with theming (Metro)?
<UserControl.Resources>
<Style x:Key="sszchartloading" TargetType="telerik:NoDataControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="telerik:NoDataControl">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock x:Name="tbAbort" Text="Vorschau wird geladen..." Foreground="Black"></TextBlock>
<telerik:RadProgressBar IsIndeterminate="True" telerik:Theming.Theme="Metro" Height="40" Width="400" />
<Button x:Name="btnAbort" Content="Abbrechen" Click="btnAbort_Click" Width="100" HorizontalAlignment="Right"></Button>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<telerik:RadChart x:Name="RadChart1" telerik:Theming.Theme="Metro" >
<telerik:RadChart.DefaultView>
<telerik:ChartDefaultView>
<telerik:ChartDefaultView.ChartArea>
<telerik:ChartArea LegendName="legend" Grid.Row="0" Grid.RowSpan="2"
x:Name="ChartArea"
EnableAnimations="true"
Padding="5,15,20,10" NoDataControlStyle="{StaticResource sszchartloading}">
</telerik:ChartArea>
</telerik:ChartDefaultView.ChartArea>
</telerik:ChartDefaultView>
</telerik:RadChart.DefaultView>
</telerik:RadChart>
This doesn't work:
RadChart1.DefaultView.ChartArea.NoDataControlStyle = this.Resources["sszchartloading"] as Style;
How Can I use custom NodataTemplate with theming (Metro)?
<UserControl.Resources>
<Style x:Key="sszchartloading" TargetType="telerik:NoDataControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="telerik:NoDataControl">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock x:Name="tbAbort" Text="Vorschau wird geladen..." Foreground="Black"></TextBlock>
<telerik:RadProgressBar IsIndeterminate="True" telerik:Theming.Theme="Metro" Height="40" Width="400" />
<Button x:Name="btnAbort" Content="Abbrechen" Click="btnAbort_Click" Width="100" HorizontalAlignment="Right"></Button>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<telerik:RadChart x:Name="RadChart1" telerik:Theming.Theme="Metro" >
<telerik:RadChart.DefaultView>
<telerik:ChartDefaultView>
<telerik:ChartDefaultView.ChartArea>
<telerik:ChartArea LegendName="legend" Grid.Row="0" Grid.RowSpan="2"
x:Name="ChartArea"
EnableAnimations="true"
Padding="5,15,20,10" NoDataControlStyle="{StaticResource sszchartloading}">
</telerik:ChartArea>
</telerik:ChartDefaultView.ChartArea>
</telerik:ChartDefaultView>
</telerik:RadChart.DefaultView>
</telerik:RadChart>
This doesn't work:
RadChart1.DefaultView.ChartArea.NoDataControlStyle = this.Resources["sszchartloading"] as Style;