【问题标题】:Setting Description property in XAML - ParseException在 XAML 中设置描述属性 - ParseException
【发布时间】:2014-02-20 09:15:04
【问题描述】:

我使用 D3 DynamicDataDisplay 来满足我的图表需求,但​​是当我尝试为 LineGraph 元素设置图例描述时,它给了我错误:

The TypeConverter for "Description" does not support converting from string

好的,但是如何设置呢? 我试过了:

<d3:LineGraph DataSource="{Binding Path=AvgWaitingTimes}" Stroke="Blue"
              Description="Some description"/>

它给出了我写的错误。 我也试过这个:

<d3:LineGraph DataSource="{Binding Path=AvgConnectedTimes}" Stroke="Green">
    <d3:ViewportElement2D.Description>
        ??
    </d3:ViewportElement2D.Description>
</d3:LineGraph>

问题是我没有什么可以代替??。如何处理? 图书馆真的很棒,但我坚持使用这个。

【问题讨论】:

    标签: c# wpf linegraph dynamic-data-display


    【解决方案1】:

    有趣的是,有时在 SO 上写问题会导致我自己很快找到答案:]

    看来第二个代码没问题,你只需要添加:

    <d3:PenDescription DescriptionString="Description is great!"/>
    

    我不知道为什么我以前没有注意到它。

    【讨论】:

      【解决方案2】:
          <d3:ChartPlotter>
              <d3:LineGraph Stroke="Green" x:Name="line">
                  <d3:ViewportElement2D.Description >
                      <d3:PenDescription DescriptionString="Test"/>
                  </d3:ViewportElement2D.Description>
              </d3:LineGraph>
          </d3:ChartPlotter>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多