简体   繁体   English

在XAML中设置Description属性-ParseException

[英]Setting Description property in XAML - ParseException

I use D3 DynamicDataDisplay for my chart needs but when I try to setup Legend description for LineGraph element it gives me error: 我将D3 DynamicDataDisplay用于我的图表需求,但​​是当我尝试为LineGraph元素设置图例说明时,它给了我错误:

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

Ok, but how to set this up? 好的,但是如何设置呢? I tried that: 我尝试过:

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

It gives the error I wrote. 它给出了我写的错误。 I also tried this: 我也试过这个:

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

Problem is that there is nothing I can put instead of ?? 问题是我没有什么可以代替的?? . How to deal with it? 怎么处理呢? The library is really great but I stucked on this one. 图书馆真的很棒,但是我坚持了这一点。

Funny, sometimes writing question on SO results in finding the answer very quickly by myself :] 有趣的,有时在SO上写问题会导致自己很快找到答案:]

It seems second code is ok, you just have to add: 看来第二个代码还可以,您只需添加:

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

I have no idea why I haven't noticed it before. 我不知道为什么我以前没有注意到它。

    <d3:ChartPlotter>
        <d3:LineGraph Stroke="Green" x:Name="line">
            <d3:ViewportElement2D.Description >
                <d3:PenDescription DescriptionString="Test"/>
            </d3:ViewportElement2D.Description>
        </d3:LineGraph>
    </d3:ChartPlotter>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM