Silverlight 4.0中的甘特图 [英] Gantt Chart in silverlight 4.0
问题描述
当我在silverlight 4.0中创建甘特图时
通过MAIN.XAML中的这段代码:
xmlns:gantt ="clr-namespace:CoderForRent.Silverlight.Charting.Gantt; assembly = CoderForRent.Silverlight.Charting"
然后我写了这个命名空间,
when i create Gantt Chart in silverlight 4.0
through this code in MAIN.XAML:
xmlns:gantt="clr-namespace:CoderForRent.Silverlight.Charting.Gantt;assembly=CoderForRent.Silverlight.Charting"
I have added this namespace then, I wrote
<gantt:GanttChart x:Name="gantt">
</gantt:GanttChart>
我收到此错误...
System.InvalidOperationException
即使将Infinity作为可用大小传递,元素"Microsoft.Windows.Design.Platform.SilverlightViewProducer + SilverlightContentHost"的布局度量替代也不应返回PositiveInfinity作为其DesiredSize.
在System.Windows.UIElement.Measure(Size availableSize)
在System.Windows.ContextLayoutManager.UpdateLayout()处
在System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
在System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
在System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
在System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
在System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
在System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate回调,对象args,Int32 numArgs)
在MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(对象源,委托方法,对象args,Int32 numArgs,委托catchHandler)
请帮助在我的项目中创建甘特图.....
I got this error...
System.InvalidOperationException
Layout measurement override of element ''Microsoft.Windows.Design.Platform.SilverlightViewProducer+SilverlightContentHost'' should not return PositiveInfinity as its DesiredSize, even if Infinity is passed in as available size.
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
pls help to create Gantt Chart in my project.....
推荐答案
我们只能猜测一个解决方案,因为您还没有给我们任何东西上.您是在设计器中还是在已编译且正在运行的应用程序中获得此信息.如果在设计器中找到它,请尝试从UserControl的xaml中删除DesiredWidth
属性.顺便说一句,我通过搜索以下文本发现了这一点:
即使将Infinity作为可用大小传递,元素"Microsoft.Windows.Design.Platform.SilverlightViewProducer + SilverlightContentHost"的布局度量替代也不应返回PositiveInfinity作为其DesiredSize."
We can only guess at a solution because you haven''t really given us anything to go on. Do you get this in the designer, or in the compiled and running application. If you get it in the designer, try removing theDesiredWidth
property from the UserControl''s xaml. BTW, I found this by googling this text:
"Layout measurement override of element ''Microsoft.Windows.Design.Platform.SilverlightViewProducer+SilverlightContentHost'' should not return PositiveInfinity as its DesiredSize, even if Infinity is passed in as available size."
尝试设置控件的宽度和高度,然后再次运行代码.
如果这不起作用,请尝试将对齐方式设置为自动-您可能需要使用这些设置.
Try setting the width and height of the control and run your code again.
If that does not work, try setting your alignments to auto - you might need to play around with those settings.
这篇关于Silverlight 4.0中的甘特图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!