How do I apply a style defined in my Application.xaml to all the textboxes in a particular window? I don't want to type Style="{StaticResource MyStyle}"
with each and every of them because there are literally dozens of them. This is WPF + VS2010.
相关问题
- VNC control for WPF application
- How to stylize text in an alert box? [duplicate]
- WPF Binding from System.Windows.SystemParameters.P
- Xamarin. The name 'authorEntry does not exist
- XAML: Applying styles to nested controls
Then just add the
Style
to yourApp.Xaml
or yourTheme.xaml
(if you have one) or even yourWindow.Resources
if you just have 1Window
, just make sure you don't set thex:Key
Example:
This will apply to all
TextBoxes
(no x:Key)TextBoxes will have to use
Style="{StaticResource MyStyle}"
to use this :