INotifyPropertyChanged vs. DependencyProperty in ViewModel

Kent wrote an interesting blog about this topic: View Models: POCOs versus DependencyObjects. Short summary: DependencyObjects are not marked as serializable The DependencyObject class overrides and seals the Equals() and GetHashCode() methods A DependencyObject has thread affinity – it can only be accessed on the thread on which it was created I prefer the POCO … Read more

How to bind RadioButtons to an enum?

You can further simplify the accepted answer. Instead of typing out the enums as strings in xaml and doing more work in your converter than needed, you can explicitly pass in the enum value instead of a string representation, and as CrimsonX commented, errors get thrown at compile time rather than runtime: ConverterParameter={x:Static local:YourEnumType.Enum1} <StackPanel> … Read more

How do I use WPF bindings with RelativeSource?

If you want to bind to another property on the object: {Binding Path=PathToProperty, RelativeSource={RelativeSource Self}} If you want to get a property on an ancestor: {Binding Path=PathToProperty, RelativeSource={RelativeSource AncestorType={x:Type typeOfAncestor}}} If you want to get a property on the templated parent (so you can do 2 way bindings in a ControlTemplate) {Binding Path=PathToProperty, RelativeSource={RelativeSource TemplatedParent}} … Read more

Jackson with JSON: Unrecognized field, not marked as ignorable

You can use Jackson’s class-level annotation: import com.fasterxml.jackson.annotation.JsonIgnoreProperties @JsonIgnoreProperties class { … } It will ignore every property you haven’t defined in your POJO. Very useful when you are just looking for a couple of properties in the JSON and don’t want to write the whole mapping. More info at Jackson’s website. If you want to … Read more