Style.Triggers, for example:
Code: Select all
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red" />
</Trigger>
</Style.Triggers>
RelativeSource Binding
I see that RelativeSource Bindings exist, but inside the binding, I cannot set the actual RelativeSource. For example, this does not compile:
Code: Select all
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock
Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" />
</DataTemplate>
</ListBox.ItemTemplate>
MethodBase.GetMethodFromHandle
This would add Strongly-Named PropertyChanged events for MVVM frameworks, for example, allowing you to fire a propertychanged notification using
Code: Select all
this.RaisePropertyChanged(() => this.Name)
rather than
Code: Select all
this.RaisePropertyChanged("Name")
Additionally, what about
Code: Select all
{x:Type ...}
Code: Select all
<Style BasedOn={StaticResource {x:Type ListBoxItem}}" />