0

Silverlight 3 では、AreaDataPoint テンプレートがその ControlTemplate に設定されたサイズを無視するようです。

<ControlTemplate TargetType="chartingTK:AreaDataPoint">
    <Grid x:Name="Root" Opacity="1">

<!-- Width and Height are ignored -->
        <Ellipse Width="75" Height="25" 
                    StrokeThickness="{TemplateBinding BorderThickness}" 
                    Stroke="OrangeRed" 
                    Fill="{TemplateBinding Background}"/>
    </Grid>
</ControlTemplate>

誰かが回避策を知っていますか?

4

1 に答える 1

0

1 つの (部分的な) 答えは、データポイントのスタイルでデータポイントの幅と高さを設定することです。例えば:

<chartingTK:AreaSeries.DataPointStyle>
    <Style TargetType="Control">
        <Setter Property="Height" Value="25" />
        <Setter Property="Width"  Value="25" />
            <Setter Property="Template">
              <Setter.Value>
                <ControlTemplate TargetType="chartingTK:AreaDataPoint">
                    <Grid x:Name="Root" Opacity="1">

<!-- Width and Height are no longer ignored, but will still be clipped at 
     the height and width set in the style above -->
                        <Ellipse Width="75" Height="25" 
                                 StrokeThickness="{TemplateBinding BorderThickness}" 
                                 Stroke="OrangeRed" 
                                 Fill="{TemplateBinding Background}"/>
                    </Grid>
                </ControlTemplate>
              </Setter.Value>
        </Setter>
    </Style>
</chartingTK:AreaSeries.DataPointStyle>

最適ではないかもしれませんが、少なくとも出発点です。

于 2010-05-03T21:08:02.017 に答える