カラーピッカーを使用したコードがあります:
<xctk:ColorPicker Grid.Row ="10" Grid.ColumnSpan="2" Margin="5, 5, 5, 5" Height="30" DisplayColorAndName="True"
SelectedColor="{Binding SelectedItem.TransparentColor, ElementName=ItemsListBox, Converter={StaticResource BrushColorConverter}, Mode=TwoWay}"/>
これは、ElementName=Window および Path=Background にバインドされている場合に機能しますが、プロパティ System.Windows.Media.Color を使用してオブジェクトを作成すると、次のように表示されます。
Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=SelectedItem.TransparentColor; DataItem='ListBox' (Name='ItemsListBox'); target element is 'ColorPicker' (Name=''); target property is 'SelectedColor' (type 'Color')
プロパティ TransparentColor は新しいオブジェクト ( new System.Windows.Media.Color() ) です... 機能させるにはどうすればよいですか?
その他のようなもの:
<TextBox Grid.Column="7" Text="{Binding SelectedItem.ForbiddenArea.Height, ElementName=ItemsListBox, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
作品...