Ja, Sie können die Style
der Steuerelemente an Ihre Bedürfnisse anpassen.
<Style x:Key="TextBox.Ellipse" TargetType="{x:Type TextBox}">
<!--Here you can set the default properties of this style.-->
<Setter Property="FontWeight" Value="Bold"/>
<!--You can change the shape of the control by setting the template-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Grid>
<Ellipse x:Name="Border" Stroke="#FF393785" StrokeThickness="2">
<Ellipse.Fill>
<RadialGradientBrush GradientOrigin="0.25,0.25"
RadiusY="0.75" RadiusX="0.75">
<GradientStop Color="White" Offset="0.2"/>
<GradientStop Color="#FF2EC452" Offset="0.5"/>
<GradientStop Color="#FF606060" Offset="1"/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
<!-- The implementation places the Content into the ScrollViewer.
It must be named PART_ContentHost
for the control to function -->
<ScrollViewer x:Name="PART_ContentHost" Background="Transparent"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Fill" Value="#000" TargetName="Border"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Diesen Style
in einem Ressourcenverzeichnis wie die App.Xaml
usw.
Dann können Sie den Stil eines TextBox
wie folgt festgelegt:
<TextBox Style="{StaticResource TextBox.Ellipse}" />