开发者

Silverlight Toolkit Modifying October 2009 Source

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:T开发者_开发问答itle">
                <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


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜