February 2015
Intermediate to advanced
768 pages
26h 24m
English
Although the Style in Figure 17.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 17.2. Note that ToggleSwitch’s default appearance enforces a minimum width, so it ignores the Style’s Width setting.
FIGURE 17.2 Heterogeneous controls given the same Style
Read now
Unlock full access