Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Today's faulty, pain-in-the-ass code.
<xctk:EditorDefinitionCollection x:Key="StandardPropertyEditors" x:Shared="False">
<xctk:EditorTemplateDefinition TargetProperties="{arkane:Nullable TypeName=system:Boolean}" >
<xctk:EditorTemplateDefinition.EditingTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Value}" IsThreeState="True" />
</DataTemplate>
</xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:EditorTemplateDefinition>
<xctk:EditorTemplateDefinition TargetProperties="{arkane:Nullable system:DateTime}">
<xctk:EditorTemplateDefinition.EditingTemplate>
<DataTemplate>
<DatePicker SelectedDate="{Binding Value}" />
</DataTemplate>
</xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:EditorTemplateDefinition>
<xctk:EditorTemplateDefinition TargetProperties="{x:Type database:User}">
<xctk:EditorTemplateDefinition.EditingTemplate>
<DataTemplate>
<controls1:NullItemSelectorAdapter
ItemsSource="{Binding Mode=OneWay, Source={StaticResource UserLookup}}">
<ComboBox SelectedItem="{Binding Value, UpdateSourceTrigger=PropertyChanged, TargetNullValue=(None)}" ItemContainerStyleSelector="{StaticResource InactiveUserStyleSelector}" />
</controls1:NullItemSelectorAdapter>
</DataTemplate>
</xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:EditorTemplateDefinition>
<xctk:EditorTemplateDefinition TargetProperties="{x:Type database:EnumerationValue}">
<xctk:EditorTemplateDefinition.EditingTemplate>
<DataTemplate>
<controls:EnumerationFilterAdapter
ItemsSource="{Binding Mode=OneWay, Source={StaticResource EnumerationValueLookup}}"
DatabasePropertyName="{Binding DisplayName, Mode=OneWay}">
<ComboBox
SelectedItem="{Binding Value, UpdateSourceTrigger=PropertyChanged, TargetNullValue=(None)}" />
</controls:EnumerationFilterAdapter>
</DataTemplate>
</xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:EditorTemplateDefinition>
</xctk:EditorDefinitionCollection>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment