关于wpf中设计时支持的问题
我贴出一段代码,这个代码是Csla.net4中的,大家帮我分析一下
<UserControl x:Class="WpfUI.Views.ProductList" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:bxf="clr-namespace:Bxf.Xaml;assembly=Bxf" mc:Ignorable="d" xmlns:my="clr-namespace:WpfUI.ViewModels" d:DesignHeight="300" d:DesignWidth="300"> <UserControl.Resources> <CollectionViewSource x:Key="productListViewSource" d:DesignSource="{d:DesignInstance my:ProductList,CreateList=True}"/> <CollectionViewSource x:Key="productListModelViewSource" Source="{Binding Path=Model, Source={StaticResource productListViewSource}}" /> <CollectionViewSource x:Key="productListItemListViewSource" Source="{Binding Path=ItemList, Source={StaticResource productListViewSource}}" /> </UserControl.Resources> <Grid x:Name="LayoutRoot" DataContext="{StaticResource productListModelViewSource}"> <ListBox Grid.Row="1" ItemsSource="{Binding Source={StaticResource productListItemListViewSource}}" Name="modelListBox" DataContext="{Binding}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=Model.Id}" Width="50"/> <TextBlock Text="{Binding Path=Model.Name}" Width="200"/> <TextBlock Text="{Binding Path=Model.Specs}" Width="200"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Grid></UserControl>