Show / Hide Table of Contents

Class Application

Encapsulates a Windows Presentation Foundation application.

Inheritance
object
DispatcherObject
Application
Application
Implements
IQueryAmbient
IProgressNotification
IDisposable
Application.FindResource(object)
Application.GetContentStream(Uri)
Application.GetCookie(Uri)
Application.GetRemoteStream(Uri)
Application.GetResourceStream(Uri)
Application.LoadComponent(object, Uri)
Application.LoadComponent(Uri)
Application.OnActivated(EventArgs)
Application.OnDeactivated(EventArgs)
Application.OnFragmentNavigation(FragmentNavigationEventArgs)
Application.OnLoadCompleted(NavigationEventArgs)
Application.OnNavigated(NavigationEventArgs)
Application.OnNavigating(NavigatingCancelEventArgs)
Application.OnNavigationFailed(NavigationFailedEventArgs)
Application.OnNavigationProgress(NavigationProgressEventArgs)
Application.OnNavigationStopped(NavigationEventArgs)
Application.Run()
Application.Run(Window)
Application.SetCookie(Uri, string)
Application.Shutdown()
Application.Shutdown(int)
Application.TryFindResource(object)
Application.Current
Application.MainWindow
Application.Properties
Application.ResourceAssembly
Application.Resources
Application.ShutdownMode
Application.StartupUri
Application.ThemeMode
Application.Windows
Application.Activated
Application.Deactivated
Application.DispatcherUnhandledException
Application.Exit
Application.FragmentNavigation
Application.LoadCompleted
Application.Navigated
Application.Navigating
Application.NavigationFailed
Application.NavigationProgress
Application.NavigationStopped
Application.SessionEnding
Application.Startup
DispatcherObject.Dispatcher
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.Presentation
Assembly: Sartorius.SAF.Presentation.Application.dll
Syntax
public abstract class Application : Application, IQueryAmbient, IProgressNotification, IDisposable
Remarks

Base functionality are:

  • Bootstrapping the application.
  • Managing single / multiple instances of the application (process).
  • Managing application behavior on windows user switches.
  • Managing the application shutdown mode.
  • Managing application restart processed by a user.
  • Saving UI settings when application exits.

Properties

View Source

ConfigurationRoot

Gets the IConfigurationRoot.

Declaration
protected IConfigurationRoot ConfigurationRoot { get; }
Property Value
Type Description
IConfigurationRoot
View Source

ExceptionHandlingFacade

Gets the IExceptionHandlingFacade of the application.

Declaration
protected IExceptionHandlingFacade ExceptionHandlingFacade { get; set; }
Property Value
Type Description
IExceptionHandlingFacade
View Source

LockConfiguration

Gets the LockConfiguration.

Declaration
protected LockConfiguration LockConfiguration { get; }
Property Value
Type Description
LockConfiguration
View Source

UseLoginDialog

Indicates whether to use an implementation of the ILoginDialog for user login.

Declaration
protected bool UseLoginDialog { get; set; }
Property Value
Type Description
bool

Methods

View Source

AllWindowsClosed()

Tries to close all windows.

Declaration
[Obsolete("Use TryCloseWindows")]
protected virtual bool AllWindowsClosed()
Returns
Type Description
bool

True if all windows have been closed, otherwise false.

View Source

CanStartShell()

Check whether a Shell can be started. A SAF Application can be defined as a single instance.

Declaration
protected virtual bool CanStartShell()
Returns
Type Description
bool

TRUE if a application can be started, otherwise FALSE

View Source

CloseSplashScreen()

Close the async splash screen.

Declaration
public void CloseSplashScreen()
View Source

CreateBootstrapper()

Creates the ApplicationBootstrapper.

Declaration
protected virtual ApplicationBootstrapper CreateBootstrapper()
Returns
Type Description
ApplicationBootstrapper

The created instance.

View Source

CreateSplashScreen()

Creates the splash screen.

Declaration
protected virtual Window CreateSplashScreen()
Returns
Type Description
Window

A new instance of the splash screen.

Remarks

Override the GetNumberOfAdditionalProgressSteps() method to extend the splash screen with additional progress steps

Examples

This example illustrates how to activate the 'splash screen' functionality by overriding the CreateSplashScreen() method. Thereby 'splash screen' functionality means to show an application specific window during application startup and initialization process informing on actually processed steps.

View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
View Source

Dispose(bool)

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing

Indicates disposing.

View Source

GetNumberOfAdditionalProgressSteps()

Gets the number of additional progress steps that occurs during application initialization.

Declaration
protected virtual int GetNumberOfAdditionalProgressSteps()
Returns
Type Description
int

The number of additional progress steps; default 0

Examples

This example illustrates how increase the number of additional progress steps shown in the splash screen during application initialization

View Source

InitializeApplication(StartupEventArgs)

Initializes the application.

Declaration
protected virtual void InitializeApplication(StartupEventArgs e)
Parameters
Type Name Description
StartupEventArgs e

Contain the startup arguments for an application.

View Source

OnCompositionCompleted(CompositionContainer)

Occurs when the composition of the CompositionContainer has been completed.

Declaration
protected virtual void OnCompositionCompleted(CompositionContainer compositionContainer)
Parameters
Type Name Description
CompositionContainer compositionContainer

The CompositionContainer.

View Source

OnEventsThreadShutdown(object, EventArgs)

Occurs before the thread that listens for system events is terminated.

Declaration
protected virtual void OnEventsThreadShutdown(object sender, EventArgs args)
Parameters
Type Name Description
object sender

A sender of this event.

EventArgs args

Provide data for this event.

View Source

OnExit(ExitEventArgs)

Clean up the resources.

Declaration
protected override void OnExit(ExitEventArgs e)
Parameters
Type Name Description
ExitEventArgs e

Event arguments for Exit event.

Overrides
Application.OnExit(ExitEventArgs)
View Source

OnRestartingApplication()

Restarts the entire application.

Declaration
protected virtual void OnRestartingApplication()
Remarks
  • The current main window is closed.
  • A dummy window is set to the current main window to have a dispatcher.
  • All private members are reset.
  • All EventHandlers are detached
  • The OnStartup method is called for a clean restated.
View Source

OnSendException(object, SendExceptionEventArgs)

Occurs when the SendException event is invoked.

Declaration
protected virtual void OnSendException(object sender, SendExceptionEventArgs sendExceptionEventArgs)
Parameters
Type Name Description
object sender

The sender.

SendExceptionEventArgs sendExceptionEventArgs

The SendExceptionEventArgs

Remarks

If overridden in a derived class, the send button of the Sartorius.SAF.Presentation.Controls.ExceptionDialog.ExceptionDialog becomes visible.

Examples

This example illustrates how to activate the 'Send' functionality of the exception dialog by overriding the OnSendException(object, SendExceptionEventArgs) method, using the Sartorius.SAF.MAPI implementation to send the email with the default email client.

View Source

OnSessionEnding(SessionEndingCancelEventArgs)

Raises the SessionEnding event.

Declaration
protected override void OnSessionEnding(SessionEndingCancelEventArgs e)
Parameters
Type Name Description
SessionEndingCancelEventArgs e

A SessionEndingCancelEventArgs that contains the event data.

Overrides
Application.OnSessionEnding(SessionEndingCancelEventArgs)
View Source

OnSessionSwitch(object, SessionSwitchEventArgs)

Occurs when the currently logged-in user has changed.

Declaration
protected virtual void OnSessionSwitch(object sender, SessionSwitchEventArgs args)
Parameters
Type Name Description
object sender

A sender of this event.

SessionSwitchEventArgs args

Provide data for this event.

View Source

OnStartup(StartupEventArgs)

Raises the Startup event.

Declaration
protected override void OnStartup(StartupEventArgs e)
Parameters
Type Name Description
StartupEventArgs e

A StartupEventArgs that contains the event data.

Overrides
Application.OnStartup(StartupEventArgs)
Remarks

Do NOT override this method. Override Application.InitializeApplication.

View Source

ProgressChanged(ProgressNotificationArgs)

Notify that the progress has been changed.

Declaration
public void ProgressChanged(ProgressNotificationArgs args)
Parameters
Type Name Description
ProgressNotificationArgs args

A notification data.

View Source

ProgressChanged(string)

Notify that the progress has been changed.

Declaration
public void ProgressChanged(string text)
Parameters
Type Name Description
string text

A notification text.

View Source

RegisterSystemEventHandler()

Register a SystemEvents.

Declaration
protected virtual void RegisterSystemEventHandler()
View Source

RunBootstrapper()

Runs the bootstrapping process of the application.

Declaration
protected virtual void RunBootstrapper()
View Source

SetDefaultSkin()

Sets the default skin of the application.

Declaration
protected virtual void SetDefaultSkin()
Remarks

If not overridden in a derived class, the default skin is set in the following order:

  1. The skin defined in the app.config is set.
  2. If no default skin is defined in the app.config, the HID skin is applied if the file 'Sartorius.SAF.Skins.Hid.dll' exists in the output directory.
  3. If no HID skin is found, no skin is applied.
View Source

SetShutdownMode()

Sets the shut-down mode for the application.

Declaration
protected virtual void SetShutdownMode()
View Source

TryCloseWindows()

Tries to close all windows.

Declaration
protected virtual bool TryCloseWindows()
Returns
Type Description
bool

True if all windows have been closed, otherwise false.

View Source

UnregisterSystemEventHandler()

Remove SystemEvents.

Declaration
protected virtual void UnregisterSystemEventHandler()

Events

View Source

LoadingCompleted

Invoked when the last value of the progress is reached.

Declaration
public event Action LoadingCompleted
Event Type
Type Description
Action

Implements

IQueryAmbient
IProgressNotification
IDisposable

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX