我创建了一个附加行为,用于在调用行为时执行Func<bool>
类型的Delegate。以下是依赖性属性定义。类型委托的DependencyProperty
public static readonly DependencyProperty SendToDetailBehaviorProperty = DependencyProperty.RegisterAttached("SendToDetailBehavior", typeof(Func<bool>), typeof(ListDetailAspectSendToDetailBehavior), new UIPropertyMetadata(null, SendToDetail));
我已经在我的XAML但预计出现以下错误,阻止装载设计师只是工作。
住宅 'SendToDetailBehavior' 被 找不到或不可序列为 型 'SortableListView'
下面你会发现XAML。
<Controls:SortableListView Grid.Row="0"
Grid.Column="0"
Name="lvwLocations"
MinHeight="150"
MinWidth="{Binding Path=BusinessObject.Locations, ValidatesOnDataErrors=true, Converter={StaticResource AlwaysReturn1Converter}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
Style="{DynamicResource SortableListViewStyle}"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
IsSynchronizedWithCurrentItem="True"
**behaviors:ListDetailAspectSendToDetailBehavior.SendToDetailBehavior="{Binding Path=LocationListDetail.SendFocusToDetail}"**
ItemsSource="{Binding Path=LocationListDetail.MasterList}"
SelectedItem="{Binding Path=LocationListDetail.DetailItem, Mode=TwoWay}"
MouseDoubleClick="lvwLocations_MouseDoubleClick">
如果我更改为bool
例如基本类型的扶养财产,错误消失。
正如我所说的附加行为正在工作,只有设计师爆炸。我已经找到了这方面的文件,并已空出来。我希望这里有人有一些见解。
感谢, BDN
我还没有厌倦。这是一个公平的建议,我会在早上试一试。可悲的是VS2008。 – 2010-09-09 01:40:45