在wpf中使用visifire [英] using visifire in wpf

查看:176
本文介绍了在wpf中使用visifire的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用wpf,并使用visifire绘制图表.我有两个进口-slvisifire.charts和wpfvisifire.charts.
问题是,当我尝试运行它时,它没有启动,因为我有一个例外-slvisifire.charts和wpfvisifire.charts中都存在Visifire.Charts.Chart.

我应该如何解决呢?

I am using wpf, and using visifire for charts. i have two imports - slvisifire.charts and wpfvisifire.charts.
the thing is that when i am trying to run it, it is not starting as i have the exception - Visifire.Charts.Chart exists in both slvisifire.charts and wpfvisifire.charts.

how should i tackle it ?

推荐答案

假设您需要同时导入并且代码看起来像这样
Assuming that you need both imports and you code looks something like this
using Slvisifire.Charts
using Wpfvisifire.Charts
...


Chart x = new Chart() ; // compile error
Chart y = new Chart() ; // compile error



您可以通过两种方式解决它

一个-每次都使用完全限定的名称空间



you can tackle it in two ways

One - use the fully qualified namespace each time

using Slvisifire.Charts
using Wpfvisifire.Charts
...


Slvisifire.Charts.Chart x = new Slvisifire.Charts.Chart() ;
Wpfvisifire.Charts.Chart y = new Wpfvisifire.Charts.Chart() ;




二-别名using语句以减少键入




Two - alias the using statements to reduce typing

using s = Slvisifire.Charts
using w = Wpfvisifire.Charts
...


s.Chart x = new s.Chart() ;
w.Chart y = new w.Chart();


嘿,

slvisifire.charts-用于创建Silverlight图表.
wpfvisifire.charts-用于创建WPF图表.

对于您为什么在WPF项目中使用Silverlight图表,我有些困惑.仅使用 wpfvisifire.charts 即可在WPF应用程序中构建图表.

所以只需添加

Hey,

slvisifire.charts - this is for creating Silverlight charts.
wpfvisifire.charts- this is for creating WPF charts.

I am a little confused as to why you are using Silverlight charts inside a WPF project. Just using the wpfvisifire.charts is sufficient to build charts in a WPF application.

So just add

using Wpfvisifire.Charts



如果您还有其他疑问,请发表.祝您编码愉快!



Please do post if you have any other queries. Happy Coding !!


这篇关于在wpf中使用visifire的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆