Func<bool>
ビヘイビアーが呼び出されたときにタイプのデリゲートを実行するために使用されるアタッチされたビヘイビアーを作成しました。以下は、依存プロパティの定義です。
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