Why doesn't my TextBlock/TextBox apply values from a Base Style?

前端 未结 2 366
忘了有多久
忘了有多久 2020-12-09 23:30

It\'s not uncommon for me to write something like below for styling a data entry form, but my problem is that TextBox and TextBlock don\'t seem to

2条回答
  •  萌比男神i
    2020-12-10 00:16

    I would like to suggest the two possible workarounds. It seems that each of Key and Type can be used but both of them cannot be used together as your question case, x:Key="BaseElementStyle" TargetType="{x:Type FrameworkElement}".

    1. using x:Key