vs10已经具备了查看设计界面的功能,那为什么我的vs中总是会弹出这个东东,无法看到界面呢,异常为:“未将对象引用设置到对象的实例”
。
我做了个实验:当代码为:<UserControl x:Class="SilverlightApplication1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/up-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
</Grid>
</UserControl>
无法显示界面,当把上面的代码中的 <Grid/>替换成<StackPanel />就ok啦。why?why?why?
。
我做了个实验:当代码为:<UserControl x:Class="SilverlightApplication1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/up-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
</Grid>
</UserControl>
无法显示界面,当把上面的代码中的 <Grid/>替换成<StackPanel />就ok啦。why?why?why?
解决方案 »
- datagridview导出到Excel 一个小问题
- 求中文版电子书《Effective C#》
- 关于内网与外网的通信
- 在C#中这样引用VB中的方法?
- MVC 提交整个ListBox内容到action的方法
- 求教在asp.net中使用frameset的几个问题
- 帮忙看看哪里错了
- 请教一下ScrollBar的用法,希望能给点好的代码和技巧
- GDI+ 缩放
- 请用XML语言描述班内10名同学3门功课(数学、英语和计算机)的成绩。 看我写的对吗
- WPF编程:.NetFramework4,明明查到BrushConverter类,里面有成员函数ConvertFromString(String) 。
- 在线等,急。。。。。
{
InitializeComponent();
}
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/SilverlightApplication1;component/MainPage.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
}