Wpf
Composite Recipes
Recipes that include further recipes, often including the individual recipes below.
Recipes
- Accessor method for attached property should have standard documentation text
- Add MarkupExtensionReturnType attribute
- Add ValueConversion attribute
- Add ValueConversion attribute (unknown types)
- Add [AttachedPropertyBrowsableForType]
- Add [ConstructorArgument]
- Add [TemplatePart] for a looked-up template part
- Add default field to converter
- Avoid side effects in CLR accessors
- Avoid side effects in attached property CLR accessors
- Backing member for DependencyProperty should have standard documentation text
- Backing member for RoutedEvent should have standard documentation text
- Backing member for a DependencyProperty should be static and readonly
- Backing member for a DependencyProperty should match registered name
- Backing member for a DependencyPropertyKey should match registered name
- Backing member for a RoutedCommand should be static and readonly
- Backing member for a RoutedEvent should be static and readonly
- Backing member for a RoutedEvent should match registered name
- CLR accessor for attached property must match registered type
- CLR method for a DependencyProperty must match registered name
- CLR property for a DependencyProperty should match registered name
- CLR property type should match registered type
- Call AddHandler in add
- Call RemoveHandler in remove
- Cast the sender of a dependency property callback to the containing type
- Cast the sender of a dependency property callback to the correct type
- Cast the value of a dependency property callback to the correct type
- Cast the value of a dependency property callback to the exact type
- Containing type should be used as registered owner
- Containing type should be used as registered owner
- ContentProperty should name an existing property
- Convert a CLR event to a routed event
- Convert a dependency property to a read-only dependency property
- Convert a trivial dependency property callback to a lambda
- Convert an auto-property to a dependency property
- Declare the coerce and validate callback value parameter nullable
- Default value is a shared reference type
- Default value type must match registered type
- DependencyPropertyKey member must be declared before DependencyProperty member
- Do not set DataContext or Style using SetCurrentValue
- MarkupExtensionReturnType must use correct return type
- Metadata must be of the same type or a super type
- Name of the event should match registered name
- Name the AddHandler/RemoveHandler callback OnEventName
- Name the CoerceValueCallback CoerceName
- Name the PropertyChangedCallback OnNameChanged
- Name the RegisterClassHandler callback OnEventName
- Name the ValidateValueCallback ValidateName
- Property changed callback should have standard documentation text
- Register a name and an owning type for a RoutedCommand
- Register the containing member as the name for a RoutedCommand
- Register the containing type as the owner for a RoutedCommand
- Registered owner type must inherit DependencyObject
- Set a mutable dependency property using SetCurrentValue
- Set a readonly DependencyProperty using its DependencyPropertyKey
- SetValue must use the registered type
- StyleTypedProperty should be specified for a Style property
- StyleTypedProperty.Property must exist
- StyleTypedProperty.Property should be specified
- StyleTypedProperty.Property should be specified only once
- StyleTypedProperty.Property should name a Style property
- StyleTypedProperty.StyleTargetType should be specified
- StyleTypedProperty.StyleTargetType should support styling
- Target of [DependsOn] should exist
- Target of [XamlSetMarkupExtension] should exist and have correct signature
- Target of [XamlSetTypeConverter] should exist and have correct signature
- Use SetValue in setter
- Use containing type
- Use containing type
- Use correct argument for [AttachedPropertyBrowsableForType]
- Use nameof() instead of a constant
- Use nameof() instead of a string literal
- Use same dependency property in get and set
- Use same event in add and remove
- Use the PART_ prefix for template part names
- Use the containing member as the key when creating a ComponentResourceKey
- Use the containing type when creating a ComponentResourceKey
- Use the declared [TemplatePart] type
- Use the registered handler type
- Use the registered routed event handler type
- ValueConversion must use correct types
- XmlnsDefinition must map to an existing namespace
- XmlnsDefinitions should map all namespaces with public types
- XmlnsPrefix must map to the same url as XmlnsDefinition
- [ConstructorArgument] must match