Previous method introduced in 4241fd8331
caused issue #503, because ContentPresenter should only use Content as
its DataContext when it is not a control. Take the WPF approach and make
ContentPresenter choose its own DataContext. Fixes#503.
When updating DataContext, defer changes to SelectedIndex/Items until
after DataContext has finished changing. Use the same method between
BeginInit and EndInit meaning that [DependsOn] is no longer needed.
Make sure the object on which the property changed occurred is the
correct type. Previously, e.g. the `AffectsGeometry(BoundsProperty,
StrokeThicknessProperty)` call in `Rectangle` caused *all* shapes to be
invalidated when `Bounds` changed, where it should only affect
`Rectangle.
To the owner control's Content property. In WPF this is done
automatically, but from looking on the internet it seems that causes
some confusion so do it explicitly.
Fixes#499 .
Correctly track the current ContentControl child. Fixes a bug in
MenuItem where the first child MenuItem was not a logical child after
the template got applied.
StyleResources cannot currently be found in other style resources
because the style resource binding is evaluated before the style is
attached to the parent. Described in #492.
Previous its color was immutable but because it inherited from Brush, its Opacity was mutable. This wasn't good, as it meant that e.g. Brushes.Red could be changed. Make it properly immutable by using the IBrush interface everywhere and not inheriting from Brush.