我无法让Blend(v5)与我的DesignInstance一起正常工作。
我有一个简单的项目..
MainPage.xaml中
<UserControl x:Class="SilverlightApplication8.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:local="clr-namespace:SilverlightApplication8"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DataContext="{d:DesignInstance local:VM,IsDesignTimeCreatable=True}"
d:DesignHeight="300"
d:DesignWidth="400"
mc:Ignorable="d">
<Grid x:Name="LayoutRoot" Background="White">
<TextBlock Text="{Binding Test}" />
</Grid>
</UserControl>
和 VM.cs 与
public class VM
{
public string Test
{
get { return "Hello World"; }
}
}
正如所料,在我的VS2010设计师中,它显示了“Hello World”。 但是,如果我将项目加载到Blend(v5)中,则它不会显示任何内容(空白控件)。 谁能指出我做错了什么?
一个有趣的事实...... 如果我在VM.cs的ctor中添加一个断点,并附加到Blend,它会击中ctor,但是不会命中该属性。
任何指针都会受到欢迎!
答案 0 :(得分:2)
这看起来像Blend 4 Silverlight 5预览中的一个错误。我遇到了同样的问题。
这里有一个帖子
看起来MSFT知道它。