Class MainWindow
Represents a wpf main window with None and full chrome functionality.
Inheritance
Implements
Namespace: Sartorius.SAF.Presentation.Controls
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
[TemplatePart(Name = "PART_MenuToggleButton", Type = typeof(ToggleButton))]
public class MainWindow : Window, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild
Examples
This example illustrates how to use the MainWindow.
<SAF:MainWindow x:Class="Sartorius.SAF.Documentation.Examples.Controls.MainWindow.MainWindowExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:SAF="http://www.sartorius.com/SAF"
Title="Example Application">
<!-- #region ApplicationLogo -->
<SAF:MainWindow.ApplicationLogo>
<TextBlock FontFamily="{DynamicResource SAF_Font_Base_Arial}"
VerticalAlignment="Center"
Foreground="White"
Text="Example Application" />
</SAF:MainWindow.ApplicationLogo>
This example illustrates how to use the MainWindow by binding a list of objects that implement IApplicationMenuItem to build the ApplicationMenu.
<SAF:MainWindow x:Class="Sartorius.SAF.Documentation.Examples.Controls.MainWindow.ApplicationMenuExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:SAF="http://www.sartorius.com/SAF"
Title="Example App">
<SAF:MainWindow.ApplicationMenu>
<SAF:ApplicationMenu BackgroundImage="pack://application:,,,/MyAssemblyName;component/Resources/Images/Image"
ItemsSource="{Binding ApplicationMenuItems}">
<SAF:ApplicationMenu.AuxiliaryPane>
<SAF:AuxiliaryPaneItem Header="About"
Command="{Binding ShowAboutDialogCommand}">
<TextBlock TextTrimming="CharacterEllipsis"
LineHeight="16"
TextWrapping="Wrap"
Text="Display information about the SAF SampleApp application and its installed modules." />
</SAF:AuxiliaryPaneItem>
<SAF:AuxiliaryPaneItem Header="Help"
Command="{Binding ShowHelpCommand}">
<TextBlock TextTrimming="CharacterEllipsis"
LineHeight="16"
TextWrapping="Wrap"
Text="Open the help window to get more information on how to use this application." />
</SAF:AuxiliaryPaneItem>
</SAF:ApplicationMenu.AuxiliaryPane>
<SAF:ApplicationMenu.FooterPaneContent>
<TextBlock Text="Copyright 2016 by Sartorius"
Style="{SAF:Style TextBlock}"
VerticalAlignment="Bottom"
Foreground="{SAF:Brush Foreground06}"
Margin="20,0,0,18" />
</SAF:ApplicationMenu.FooterPaneContent>
</SAF:ApplicationMenu>
</SAF:MainWindow.ApplicationMenu>
</SAF:MainWindow>
Constructors
View SourceMainWindow()
Creates a new instance of the MainWindow class.
Declaration
public MainWindow()
Fields
View SourceApplicationLogoProperty
The DependencyProperty for the ApplicationLogo property.
Declaration
public static readonly DependencyProperty ApplicationLogoProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ApplicationMenuProperty
The DependencyProperty for the ApplicationMenu property.
Declaration
public static readonly DependencyProperty ApplicationMenuProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
CompanyLogoProperty
The DependencyProperty for the CompanyLogo property.
Declaration
public static readonly DependencyProperty CompanyLogoProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
IsMenuOpenProperty
The DependencyProperty for the IsMenuOpen property.
Declaration
public static readonly DependencyProperty IsMenuOpenProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
QuickAccessToolBarProperty
The DependencyProperty for the QuickAccessToolBar property.
Declaration
public static readonly DependencyProperty QuickAccessToolBarProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
Properties
View SourceApplicationLogo
Gets or sets the application logo.
Declaration
public object ApplicationLogo { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
ApplicationMenu
Gets or sets the application menu.
Declaration
public ApplicationMenu ApplicationMenu { get; set; }
Property Value
| Type | Description |
|---|---|
| ApplicationMenu |
CompanyLogo
Gets or sets the company logo.
Declaration
public object CompanyLogo { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
IsMenuOpen
Gets or sets a value indicating whether the menu is open.
Declaration
public bool IsMenuOpen { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
QuickAccessToolBar
Gets or sets the quick access toolbar.
Declaration
[SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "Used as dependency property in Xaml.")]
public List<object> QuickAccessToolBar { get; set; }
Property Value
| Type | Description |
|---|---|
| List<object> |
Methods
View SourceCloseMenu()
Closes the application menu.
Declaration
public void CloseMenu()
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
Declaration
public override void OnApplyTemplate()
Overrides
View SourceOpenMenu()
Opens the application menu.
Declaration
public void OpenMenu()