Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
The Window control does not have any named parts.
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. |
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>
.NET Desktop feedback feedback
.NET Desktop feedback is an open source project. Select a link to provide feedback:
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Design consistent .NET MAUI XAML pages by using shared resources - Training
Learn how to use static and dynamic shared resources to build a .NET Multi-platform App UI (MAUI) user interface. And see how styles can make the user interface both consistent and accessible.