Window Styles and Templates
This topic describes the styles and templates for the Window control. You can modify the default ControlTemplate to give the control a unique appearance. For more information, see Create a template for a control.
Window Parts
The Window control does not have any named parts.
Window States
The following table lists the visual states for the Window control.
VisualState Name | VisualStateGroup Name | Description |
---|---|---|
Valid | ValidationStates | The control uses the Validation class and the Validation.HasError attached property is false . |
InvalidFocused | ValidationStates | The Validation.HasError attached property is true has the control has focus. |
InvalidUnfocused | ValidationStates | The Validation.HasError attached property is true has the control does not have focus. |
Window ControlTemplate
The following XAML is a generated copy of the Window control template:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="WindowStyle1" TargetType="{x:Type Window}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Window}">
<ContentPresenter/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
See also
Tee yhteistyötä kanssamme GitHubissa
Tämän sisällön lähde on GitHubissa, jossa voit myös luoda ja tarkastella ongelmia ja pull-pyyntöjä. Katso lisätietoja osallistujan oppaasta.
.NET Desktop feedback