积极答复者
“Silverlight”页面正常运行,但是设计器却解释错误。

问题
-
“Silverlight”页面正常运行,但是“VS设计器”却解释错误,这是怎么回事啊???
怎么排查这样的问题呢???
ExpressionBlend中看不到“设计视图”:
Science and technology is my lover.
- 已编辑 starrycheng 2012年10月25日 2:09
答案
-
你好,
Silverlight5 应用程序在Blend4里是看不到设计图的。BusyIndicator引发错误,请检查项目是不是少添加了Reference,System.Windows.Controls,System.Windows.Controls.Toolkit,System.Windows.Controls.Toolkit.Internals。如果还不行的话,将你的引用改成
xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
在xaml里输入"<toolkit:"看能不能找到BusyIndicator。
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 Haixia_XieModerator 2012年11月6日 4:38
- 取消答案标记 starrycheng 2012年11月14日 6:50
- 已标记为答案 starrycheng 2012年11月19日 7:03
全部回复
-
ExpressionBlend中看不到“设计视图”:请检查是不是SilverLight版本不对? 或者视图没显示出来。
VS设计器出现错误是因为你的页面是用blend设计的,某些dll或API没有引用到。重新用blend打开一次就OK了,具体什么原因未知!
- 已标记为答案 Haixia_XieModerator 2012年11月6日 4:38
- 取消答案标记 starrycheng 2012年11月14日 6:50
-
“BusyIndicator”引发了一个错误,很奇怪啊。
完整XAML代码:
<controls:ChildWindow x:Class="MyCharts.MeterListChartWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts"
xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
Width="900" Height="300"
>
<Grid x:Name="LayoutRoot" Margin="2">
<toolkit:BusyIndicator Name="bi_Busy" BusyContent="数据加载中,请稍后。。。">
<Grid></Grid>
</toolkit:BusyIndicator>
</Grid>
</controls:ChildWindow>错误 1 [Control_TargetTypeMismatch]
参数:
调试资源字符串不可用。键和参数通常会提供足够的信息来诊断问题。请参见 http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.10411.0&File=System.Windows.dll&Key=Control_TargetTypeMismatch C:\Users\Administrator\Desktop\Tj2.0\MyCharts\MeterListChartWindow.xaml 11 9 MyCharts
问题:大师,只是放了一个“BusyIndicator”,怎么会这个样呢??? 这是什么错误,应该如何解决。
后台代码:
namespace MyCharts
{
public partial class MeterListChartWindow : ChildWindow
{
public MeterListChartWindow(string title,string tag)
{
InitializeComponent();
}
}
}Science and technology is my lover.
-
System.Reflection.TargetInvocationException
调用的目标发生了异常。
在 System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
在 System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
在 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
在 System.Delegate.DynamicInvokeImpl(Object[] args)
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
System.InvalidOperationException
元素“Microsoft.Windows.Design.Platform.SilverlightViewProducer+SilverlightContentHost”的布局测量覆盖不应将 PositiveInfinity 作为其 DesiredSize 返回,即使将 Infinity 作为可用大小传入。
在 System.Windows.UIElement.Measure(Size availableSize)
在 MS.Internal.Designer.ZoomableViewPresenter.DesignerBackground.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 Microsoft.Windows.Design.Interaction.DesignerView.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 MS.Internal.Designer.Viewport.MeasureOverride(Size availableSize)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
在 System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
在 System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
在 System.Windows.Controls.Grid.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Grid.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
在 System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Control.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Interop.HwndSource.SetLayoutSize()
在 System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
在 MS.Internal.DeferredHwndSource.ProcessQueue(Object sender, EventArgs e)Science and technology is my lover.
-
你好,
Silverlight5 应用程序在Blend4里是看不到设计图的。BusyIndicator引发错误,请检查项目是不是少添加了Reference,System.Windows.Controls,System.Windows.Controls.Toolkit,System.Windows.Controls.Toolkit.Internals。如果还不行的话,将你的引用改成
xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
在xaml里输入"<toolkit:"看能不能找到BusyIndicator。
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 Haixia_XieModerator 2012年11月6日 4:38
- 取消答案标记 starrycheng 2012年11月14日 6:50
- 已标记为答案 starrycheng 2012年11月19日 7:03