December 2014
Intermediate to advanced
512 pages
17h 4m
English
Although the Style in Figure 18.1 is shared among three Buttons, it can be shared by any kind of Control if you mark it with TargetType="Control" instead:
<Page ...>... <Style x:Key="PurpleTiltStyle" TargetType="Control" >... <Button Style="{StaticResource PurpleTiltStyle}" Content="1"/> <ToggleSwitch Style="{StaticResource PurpleTiltStyle}"/> <ProgressRing IsActive="True" Style="{StaticResource PurpleTiltStyle}"/>...</Page>
The result is shown in Figure 18.2. Note that ToggleSwitch’s default appearance enforces a minimum width, so it ignores the Style’s Width setting.
FIGURE 18.2 Heterogeneous controls given the same Style
Read now
Unlock full access