Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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
.NET Desktop feedback