Контролы - XCeed. PropertyGrid 

Page / - Изменено Alexandr Fokin в 2024/11/30 19:03 

XCeed. PropertyGrid 
Изменено Alexandr Fokin
в 2024/11/30 19:03

Оглавление

 	XCeed. PropertyGrid, Property Grid	
 	 	
 	Кастомное форматирование свойства	How to use Date Picker in Xceed PropertyGrid?
https://stackoverflow.com/questions/39410875/how-to-use-date-picker-in-xceed-propertygrid
xmlns:sys="clr-namespace:System;assembly=System.Runtime"
xmlns:xs="http://schemas.xceed.com/wpf/xaml/toolkit"

<xs:PropertyGrid x:Name="PropertyGrid">
   
   <!--DateTime?-->
   <xs:PropertyGrid.EditorDefinitions>
       <xs:EditorTemplateDefinition>
           
           <!--Селектор по типу-->
           <xs:EditorTemplateDefinition.TargetProperties>
               <xs:TargetPropertyType Type="{x:Type sys:Nullable`1[System.DateTime]}" />
           </xs:EditorTemplateDefinition.TargetProperties>
           
           <!--Шаблон редактора-->
           <xs:EditorTemplateDefinition.EditingTemplate>
               <DataTemplate>
                   <TextBox Text="{Binding Value, Mode=OneWay}" IsEnabled="False">
                       <TextBox.Resources>
                           <Style TargetType="{x:Type Border}">
                               <Setter Property="Visibility" Value="Hidden"/>
                           </Style>
                       </TextBox.Resources>
                   </TextBox>
               </DataTemplate>
           </xs:EditorTemplateDefinition.EditingTemplate>
       </xs:EditorTemplateDefinition>
   </xs:PropertyGrid.EditorDefinitions>           
</xs:PropertyGrid>