You definitely can, or maybe I donβt understand the problem, but look if there is this example:
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="SilverlightApplication1.MainPage" Width="640" Height="480"> <UserControl.Resources> <Style x:Key="TextButtonStyle" TargetType="Button"> <Setter Property="Background" Value="LightGray" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ContentControl"> <ContentPresenter Content="{TemplateBinding Content}" /> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="TextButtonInGridStyle" TargetType="Button" BasedOn="{StaticResource TextButtonStyle}"> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="Margin" Value="4,4,4,4" /> <Setter Property="FontFamily" Value="Arial"/> <Setter Property="FontWeight" Value="Bold"/> <Setter Property="Foreground" Value="Red"/> </Style> </UserControl.Resources> <StackPanel x:Name="LayoutRoot" Background="White"> <Button Content="Button" Style="{StaticResource TextButtonStyle}"/> <Button HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="75" Style="{StaticResource TextButtonInGridStyle}" Margin="4,0,0,0"> Button </Button> <Button HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="75" Style="{StaticResource TextButtonInGridStyle}" Margin="4,0,0,0"> <Rectangle Fill="#FFF4F4F5" Height="10" Stroke="Black"/> </Button> </StackPanel>
You can see that the Button does not have a TextBlock, and if the content is a rectangle, it will be shown instead of text.
source share