Silverlight Toolkit Modifying October 2009 Source

↘锁芯ラ 提交于 2020-01-05 03:44:09

问题


I have some changes I need to make to the Silverlight toolkit Charting source

I downloaded the Silverlight toolkit ... unzipped the source to a new directory

Added the Controls.DataVisualization.Toolkit.csproj Project to my Solution

Removed The reference in my silverlight application to System.Windows.Controls.DataVisualization.Toolkit and Added
A project Reference to The Controls.DataVisualization.Toolkit.csproj Project

I then changed the Legend.xaml
to

<Style TargetType="datavis:Legend">
   <Setter Property="BorderBrush" Value="Lime"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="IsTabStop" Value="False"/>     
    <Setter Property="TitleStyle">
        <Setter.Value>
            <Style TargetType="datavis:Title">
                <Setter Property="Margin" Value="0,5,0,10"/>
                <Setter Property="FontWeight" Value="Bold"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
            </Style>
        </Setter.Value>
    </Setter>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="datavis:Legend">
                <Border
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Padding="2">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <datavis:Title
                            Grid.Row="0"
                            Content="{TemplateBinding Title}"
                            Style="{TemplateBinding TitleStyle}"/>
                            <TextBlock>Yeah</TextBlock>                      
                    </Grid>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Added a simple columnchart to my MainPage.xaml

and Then ran it
neither of the changes are visible in my Silverlight Page.

Thanks

Mark


回答1:


The Silverlight Toolkit uses some build tasks to move the control templates out of the seperate xaml files into the generic.xaml file. Since you probably don't have this build task (I think the team has made it available) you will need to make your changes in generic.xaml instead of Legend.xaml (or get the build task).



来源:https://stackoverflow.com/questions/1681207/silverlight-toolkit-modifying-october-2009-source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!