I'm trying to create a properties panel in an editor I'm working on, in which I'd like to be able to modify multiple selected items in the view. I can't come up with a straightforward "WPF" way of doing this that doesn't involve either a lot of code behind or type-specific converters or implementations. Any suggestions for the cleanest way to accomplish something like this? Just to make it concrete, here's what I'm talking about:
The "cues" on the right are implemented as an ItemsControl so I'm binding the Properties panel to the SelectedItems property like this:
<ContentControl>
<ContentControl.Style>
<Style TargetType="{x:Type ContentControl}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Count}" Value="1">
<Setter Property="Content" Value="{Binding Path=[0]}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
The DataTrigger ensures that the panel is only available when one item is selected but I'd like to be able to bind to multiple items simultaneously. Ideally the source binding would aggregate the current property values for consensus (and show nothing when multiple values are present). The setting I'm most interested in is Color but it would be nice if there was a at least somewhat generic solution.
null
based on the length of theValues
array it receives. – BradleyDotNETItemsControl
in the UI side for the PropertyGrid-like UI. – Federico Berasategui