Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
SelectedObjects and Values displayed with custom editors
posted

I have a XamPropertyGrid that is displaying properties for multiple objects using the SelectedObjects property. For default controls that represent a property, check box for a bool property for example, the control is able to display an indeterminate state when the properties have both true and false values. How can I accomplish this for my own custom controls I provide in a PropertyGridEditorDefinition? I've provided a sample of one of my definitions below. Thanks!

<ig:PropertyGridEditorDefinition TargetType="{x:Type shared:Weight}">
                    <ig:PropertyGridEditorDefinition.EditTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <controls:WeightEditor Grid.Column="0" Margin="5,1,1,1" WeightValue="{Binding Value, Mode=TwoWay}" ValueUpdateSourceTrigger="LostFocus"/>
                            </Grid>
                        </DataTemplate>
                    </ig:PropertyGridEditorDefinition.EditTemplate>
                </ig:PropertyGridEditorDefinition>