Use style. This automatically applies to all buttons in the window:
<Window.Resources>
<Style TargetType="Button">
<Setter Property="Width" Value="100" />
<Setter Property="Height" Value="100" />
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="ButtonBg.png" />
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
Sets the default values ββfor width, height, and background for all buttons. It is assumed that you have a bitmap called ButtonBg.png compiled into your project - this is a background image.
If you want to apply this style only to certain buttons, you must change the first line this way:
<Style x:Key="imgBtnStyle" TargetType="Button">
, , :
<Button Style="{StaticResource imgBtnStyle}" ... />
, Visual Studio 2010, . . , .