Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: PropertyGrid edit defaults editors

$
0
0
Hi,

I am not sure, but it will be great, if we will be able to do like this:

Define "EditorTemplateDefinition.ResolveEditor" to get editor control for the specified type

For example for String type it will be:
<xctk:EditorTemplateDefinition.ResolveEditor TargetPropertyType="{x:Type sys:String}" ValueDependencyProperty="{Binding Value}" />

The example with label:
<!-- Editor for all properties -->
        <xctk:EditorTemplateDefinition TargetProperties="*"> <!-- * - for all properties -->
           <xctk:EditorTemplateDefinition.EditingTemplate>
              <DataTemplate>
                 <Grid>
                    <Grid.ColumnDefinitions>
                       <ColumnDefinition Width="*" />
                       <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <!-- ValueType keeps a type of current Value -->
                    <xctk:EditorTemplateDefinition.ResolveEditor TargetPropertyType="{Binding ValueType}" ValueDependencyProperty="{Binding Value}" /> 

                    <TextBlock Grid.Column="1" Text="Test String" />
                 </Grid>
              </DataTemplate>
           </xctk:EditorTemplateDefinition.EditingTemplate>
        </xctk:EditorTemplateDefinition>
     </xctk:PropertyGrid.EditorDefinitions>
Thanks,

Viewing all articles
Browse latest Browse all 4964


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>