Summary
An extended, metrofied Window class.
- Namespace
- MahApps
.Metro .Controls - Base Types
-
- Window
- Derived Types
graph BT
Type-->Base0["Window"]
Type["MetroWindow"]
class Type type-node
Derived0["MetroNavigationWindow"]-->Type
click Derived0 "/api/MahApps.Metro.Controls/MetroNavigationWindow"
Syntax
[TemplatePart(Name = PART_Icon, Type = typeof(UIElement))]
[TemplatePart(Name = PART_TitleBar, Type = typeof(UIElement))]
[TemplatePart(Name = PART_WindowTitleBackground, Type = typeof(UIElement))]
[TemplatePart(Name = PART_WindowTitleThumb, Type = typeof(Thumb))]
[TemplatePart(Name = PART_FlyoutModalDragMoveThumb, Type = typeof(Thumb))]
[TemplatePart(Name = PART_LeftWindowCommands, Type = typeof(ContentPresenter))]
[TemplatePart(Name = PART_RightWindowCommands, Type = typeof(ContentPresenter))]
[TemplatePart(Name = PART_WindowButtonCommands, Type = typeof(ContentPresenter))]
[TemplatePart(Name = PART_OverlayBox, Type = typeof(Grid))]
[TemplatePart(Name = PART_MetroActiveDialogContainer, Type = typeof(Grid))]
[TemplatePart(Name = PART_MetroInactiveDialogsContainer, Type = typeof(Grid))]
[TemplatePart(Name = PART_FlyoutModal, Type = typeof(Rectangle))]
public class MetroWindow : Window
Attributes
Type | Description |
---|---|
TemplatePart | |
TemplatePart | |
TemplatePart | |
TemplatePart | |
TemplatePart | |
TemplatePart | |
TemplatePart | |
TemplatePart | |
TemplatePart | |
TemplatePart | |
TemplatePart | |
TemplatePart |
Constructors
Name | Summary |
---|---|
MetroWindow |
Initializes a new instance of the MahApps.Metro.Controls.MetroWindow class. |
Events
Name | Type | Summary |
---|---|---|
FlyoutsStatusChanged | RoutedEventHandler | |
Window |
RoutedEventHandler |
Fields
Properties
Name | Value | Summary |
---|---|---|
FlyoutOverlayBrush | Brush |
Gets or sets the brush used for the Flyouts overlay.
|
Flyouts | FlyoutsControl |
Gets/sets the FlyoutsControl that hosts the window's flyouts.
|
GlowBrush | Brush |
Gets/sets the brush used for the Window's glow.
|
Icon |
BitmapScalingMode |
Gets/sets bitmap scaling mode of the titlebar icon.
|
IconEdgeMode | EdgeMode |
Gets/sets edge mode of the titlebar icon.
|
IconOverlayBehavior | OverlayBehavior | |
IconScalingMode | MultiFrameImageMode |
Gets/sets icon scaling mode of the titlebar.
|
IconTemplate | DataTemplate |
Gets/sets the icon content template to show a custom icon.
|
Ignore |
bool |
Defines if the Taskbar should be ignored when maximizing a Window.
This only works with WindowStyle = None.
|
IsAnyDialogOpen | bool |
Gets whether one or more dialogs are shown.
|
IsCloseButtonEnabled | bool |
Gets/sets if the close button is enabled.
|
Is |
bool |
Gets or sets whether if the close button should be enabled or not if a dialog is shown.
|
Is |
bool |
Gets/sets if the max/restore button is enabled.
|
IsMinButtonEnabled | bool |
Gets/sets if the min button is enabled.
|
IsWindowDraggable | bool | |
KeepBorderOnMaximize | bool |
Gets/sets if the border thickness value should be kept on maximize
if the MaxHeight/MaxWidth of the window is less than the monitor resolution.
|
LeftWindowCommands | WindowCommands |
Gets/sets the left window commands that hosts the user commands.
|
Left |
Window |
|
LogicalChildren | IEnumerator | |
MetroDialogOptions | MetroDialogSettings | |
NonActiveBorderBrush | Brush |
Gets/sets the brush used for the Window's non-active border.
|
NonActiveGlowBrush | Brush |
Gets/sets the brush used for the Window's non-active glow.
|
Non |
Brush |
Gets/sets the brush used for the Window's non-active title bar.
|
OverlayBrush | Brush |
Gets/sets the brush used for the dialog overlay.
|
OverlayFadeIn | Storyboard |
Gets or sets the overlay fade in storyboard.
|
OverlayFadeOut | Storyboard |
Gets or sets the overlay fade out storyboard.
|
OverlayOpacity | double |
Gets/sets the opacity used for the dialog overlay.
|
Override |
Brush |
Allows easy handling of window commands brush. Theme is also applied based on this brush.
|
Resize |
Thickness |
Gets or sets resize border thickness. This enables animation, styling, binding, etc...
|
RightWindowCommands | WindowCommands |
Gets/sets the right window commands that hosts the user commands.
|
Right |
Window |
|
SaveWindowPosition | bool |
Gets/sets whether the window will save it's position between loads.
|
ShowCloseButton | bool |
Gets or sets whether if the close button is visible.
|
Show |
bool |
Get/sets whether dialogs show over the title bar.
|
ShowIconOnTitleBar | bool |
Get/sets whether the titlebar icon is visible or not.
|
ShowMaxRestoreButton | bool |
Gets or sets whether if the maximize/restore button is visible and the maximize/restore system menu is enabled.
|
ShowMinButton | bool |
Gets or sets whether if the minimize button is visible and the minimize system menu is enabled.
|
ShowSystemMenu | bool |
Gets or sets a value that indicates whether the system menu should popup with left mouse click on the window icon.
|
Show |
bool |
Gets or sets a value that indicates whether the system menu should popup with right mouse click if the mouse position is on title bar or on the entire window if it has no title bar (and no title bar height).
|
ShowTitleBar | bool |
Gets/sets whether the TitleBar is visible or not.
|
TitleAlignment | HorizontalAlignment |
Gets/sets the title horizontal alignment.
|
TitleBarHeight | int |
Gets/sets the TitleBar's height.
|
TitleCharacterCasing | CharacterCasing |
Character casing of the title
|
TitleForeground | Brush |
Gets/sets the brush used for the titlebar's foreground.
|
TitleTemplate | DataTemplate |
Gets/sets the title content template to show a custom title.
|
TryToBeFlickerFree | bool |
Gets or sets wether the resizing of the window should be tried in a way that does not cause flicker/jitter, especially when resizing from the left side.
|
UseNoneWindowStyle | bool |
Gets/sets whether the WindowStyle is None or not.
|
WindowButtonCommands | WindowButtonCommands |
Gets/sets the window button commands that hosts the min/max/close commands.
|
Window |
OverlayBehavior | |
Window |
I |
|
WindowTitleBrush | Brush |
Gets/sets the brush used for the Window's title bar.
|
Window |
bool |
Gets/sets whether the window's entrance transition animation is enabled.
|
Methods
Name | Value | Summary |
---|---|---|
Get |
I |
Gets the window placement settings (can be overwritten).
|
HideOverlay |
void | |
HideOverlayAsync |
Task |
Begins to hide the MetroWindow's overlay effect.
|
IsOverlayVisible |
bool | |
OnApplyTemplate |
void | |
OnClosing |
void | |
On |
AutomationPeer |
Creates AutomationPeer (
UIElement.OnCreateAutomationPeer )
|
ResetStoredFocus |
void |
Clears the stored element which would get the focus after closing a dialog.
|
ShowOverlay |
void | |
ShowOverlayAsync |
Task |
Begins to show the MetroWindow's overlay effect.
|
StoreFocus |
void |
Stores the given element, or the last focused element via FocusManager, for restoring the focus after closing a dialog.
|
Extension Methods
Name | Value | Summary |
---|---|---|
Get |
Task |
Gets the current shown dialog in async way.
From DialogManager
|
HideMetroDialogAsync |
Task |
Hides a visible Metro Dialog instance.
From DialogManager
|
ShowInputAsync |
Task |
Creates a InputDialog inside of the current window.
From DialogManager
|
ShowLoginAsync |
Task |
Creates a LoginDialog inside of the current window.
From DialogManager
|
ShowMessageAsync |
Task |
Creates a MessageDialog inside of the current window.
From DialogManager
|
ShowMetroDialogAsync |
Task |
Adds a Metro Dialog instance to the specified window and makes it visible asynchronously.
If you want to wait until the user has closed the dialog, use
WaitUntilUnloadedAsync()
You have to close the resulting dialog yourself with From DialogManager
|
ShowMetroDialogAsync |
Task |
Adds a Metro Dialog instance of the given type to the specified window and makes it visible asynchronously.
If you want to wait until the user has closed the dialog, use
WaitUntilUnloadedAsync()
You have to close the resulting dialog yourself with From DialogManager
|
Show |
string |
Creates a InputDialog outside of the current window.
From DialogManager
|
Show |
LoginDialogData |
Creates a LoginDialog outside of the current window.
From DialogManager
|
Show |
MessageDialogResult |
Creates a MessageDialog ouside of the current window.
From DialogManager
|
ShowProgressAsync |
Task |
Creates a ProgressDialog inside of the current window.
From DialogManager
|