Demo
你好:
请问如何动态读取c1chart的样式资源文件?比如:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MainScreen"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Shared.xaml" />
</ResourceDictionary.MergedDictionaries>
<!--chart-->
<Style x:Key="ChartStyle" TargetType="c1:C1Chart">
<Setter Property="Foreground" Value="{DynamicResource ResourceKey=ChartForeground}"/>
<Setter Property="OpacityMask" Value="{DynamicResource ResourceKey=chartMask}"/>
<Setter Property="FontSize" Value="26"/>
<!--<Setter Property="Theme" Value="{DynamicResource {ComponentResourceKey TypeInTargetAssembly=c1:C1Chart, ResourceId=DuskBlue}}"/>-->
<Setter Property="Background" Value="{DynamicResource ResourceKey=ChartBackground}"/>
</Style>
</ResourceDictionary>
这样一个文件放在Debug目录下,程序用读取时,如: <c1:C1Chart Name="CHARTTDFDZJ" Margin="5,0,5,5" Grid.Row="1" Style="{DynamicResource ResourceKey=Net_TDChartStyle}">时,报错误(无法从文本“1:C1Chart”中创建“Type”) |