【问题标题】:How to return default DataPointStyle?如何返回默认的 DataPointStyle?
【发布时间】:2013-03-18 16:44:17
【问题描述】:

默认ColumnSeries.DataPointStyle很好,但是标签不可见。

所以我应用了自定义样式来制作可见的数据点标签,但在此之后,默认样式现在看起来很难看。

如何在返回默认数据点样式的同时使数据点标签可见?谢谢!

这是我的 XAML:

 <toolkit:ColumnSeries  Title="Male" ItemsSource="{Binding MaleSerie}" IndependentValueBinding="{Binding ItemName}"
            DependentValueBinding="{Binding Count}"   ToolTipService.ToolTip="{Binding Count}"
            AnimationSequence="Simultaneous"  
            HorizontalAlignment="Left" Height="304" VerticalAlignment="Top" Width="266">

            <toolkit:ColumnSeries.DataPointStyle>
                <Style TargetType="toolkit:ColumnDataPoint">
                    <Setter Property="Background" Value="Blue"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="toolkit:ColumnDataPoint">
                                <Grid>
                                    <Rectangle
                            Fill="{TemplateBinding Background}"
                            Stroke="Black"/>
                                    <Grid  Background="#aaffffff"  Margin="0"  HorizontalAlignment="Center"  VerticalAlignment="Center">
                                        <TextBlock  FontSize="10" Text="{TemplateBinding FormattedDependentValue}"  FontWeight="Bold" Width="Auto" Margin="2"/>
                                    </Grid>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </toolkit:ColumnSeries.DataPointStyle>

        </toolkit:ColumnSeries>

【问题讨论】:

    标签: .net silverlight xaml styles


    【解决方案1】:

    对于标准 Silverlight 控件,您通常可以从 MSDN 中找到默认样式。

    示例:ComboBox 默认模板:

    http://msdn.microsoft.com/en-us/library/dd334408(v=vs.95).aspx

    对于工具包,您可能需要下载源代码,复制然后修改您需要的内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-08
      • 1970-01-01
      • 1970-01-01
      • 2013-01-19
      • 2021-02-09
      • 1970-01-01
      • 1970-01-01
      • 2013-02-02
      相关资源
      最近更新 更多