d:DataContext="{d:DesignInstance viewModel:ContactViewModel}"
这样再xaml里面写binding 能联想出来
http://technet.microsoft.com/zh-CN/library/ee839627(v=vs.100)
WPF 设计器提供下列设计时特性。
|
设计时特性 |
说明 |
示例用法 |
|---|---|---|
|
d:DesignHeight |
在您单击根大小标记 () 时自动增加。 |
<Window x:Class="DesignDataDemo.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:DesignDataDemo" Title="MainWindow" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="350" d:DesignWidth="525" SizeToContent="WidthAndHeight"> |
|
d:DesignWidth |
在您单击根大小标记 () 时自动增加。 |
<Window x:Class="DesignDataDemo.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:DesignDataDemo" Title="MainWindow" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="350" d:DesignWidth="525" SizeToContent="WidthAndHeight"> |
|
d:DataContext |
演练:使用 WPF 设计器创建数据绑定。 |
|
|
d:DesignInstance |
演练:在设计器中使用 DesignInstance 绑定到数据。 |
|
|
d:DesignData |
演练:使用 WPF 设计器中的示例数据。 |
|
|
d:DesignSource |
这样便可使用数据绑定生成器创建绑定。 |
<CollectionViewSource x:Key="CustomerViewSource" d:DesignSource="{d:DesignInstance local:Customer, CreateList=True}" />
|
|
d:IsDesignTimeCreatable |
d:DesignInstance 标记扩展中,指定根据您的类型创建设计实例,而非设计器生成的替代类型。 |
<Grid d:DataContext="{d:DesignInstance local:Customer, IsDesignTimeCreatable=True}">
|
|
d:CreateList |
d:DesignInstance 标记扩展中,指定设计实例是指定类型的列表。 |
<CollectionViewSource x:Key="CustomerViewSource" d:DesignSource="{d:DesignInstance local:Customer, CreateList=True}" />
|
|
d:Type |
d:IsDesignTimeCreatable 可以指定是创建某一实例或您的类型还是设计器生成的替代类型。 |
<CollectionViewSource x:Key="CustomerViewSource" d:DesignSource="{d:DesignInstance Type=local:Customer, CreateList=True}" />
|