Class AboutDialogCommand
An implementation of ICommand allowing to show an about dialog.
Implements
Namespace: Sartorius.SAF.Presentation.Controls
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
public class AboutDialogCommand : DependencyObject, ICommand
Examples
The following example shows how to use AboutDialogCommand.
<saf:AuxiliaryPaneItem x:Class="App.AboutDialogPane"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:saf="http://www.sartorius.com/SAF"
xmlns:resources="clr-namespace:App.Resources"
mc:Ignorable="d"
Header="{x:Static resources:Resource.AboutDialogPaneHeader}"
d:DesignHeight="450" d:DesignWidth="800">
<saf:AuxiliaryPaneItem.Command>
<saf:AboutDialogCommand ApplicationId="12345678"
CompanyWebsite="www.sartorius.com">
<saf:AboutDialogCommand.AdditionalInformation>
<saf:AdditionalInformation Label="Licensed to" Value="{Binding LicensedTo}" />
</saf:AboutDialogCommand.AdditionalInformation>
</saf:AboutDialogCommand>
</saf:AuxiliaryPaneItem.Command>
<TextBlock TextTrimming="CharacterEllipsis"
LineHeight="16"
TextWrapping="Wrap"
Text="{x:Static resources:Resource.AboutDialogPaneText}" />
</saf:AuxiliaryPaneItem>
The following example shows how to use AboutDialogCommand with grouped modules.
<saf:AuxiliaryPaneItem x:Class="App.AboutAuxiliaryPane"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:saf="http://www.sartorius.com/SAF"
xmlns:resources="clr-namespace:App.Resources"
xmlns:modularity="clr-namespace:Sartorius.SAF.Presentation.Modularity;assembly=Sartorius.SAF.Presentation"
mc:Ignorable="d"
Header="{x:Static resources:Resource.AboutDialogPaneHeader}"
d:DesignHeight="450" d:DesignWidth="800">
<Control.Resources>
<DataTemplate x:Key="LicensedModuleTemplate" DataType="{x:Type modularity:IModule}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Caption}" />
<TextBlock Grid.Column="1" Text="{Binding Path=Description}" />
</Grid>
</DataTemplate>
<DataTemplate x:Key="UnlicensedModuleTemplate" DataType="{x:Type modularity:IModule}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Caption}" />
<TextBlock Grid.Column="1" Text="{Binding Path=Description}" />
</Grid>
</DataTemplate>
</Control.Resources>
<saf:AuxiliaryPaneItem.Command>
<saf:AboutDialogCommand ApplicationId="12345678"
CompanyWebsite="www.sartorius.com">
<saf:AboutDialogCommand.Groups>
<saf:ModuleGroupDefinition Caption="Licensed Modules"
DataTemplate="{StaticResource LicensedModuleTemplate}">
<saf:ModuleGroupDefinition.Filters>
<saf:ModuleFilter IsEnabled="True" />
</saf:ModuleGroupDefinition.Filters>
</saf:ModuleGroupDefinition>
<saf:ModuleGroupDefinition Caption="Unlicensed Modules"
DataTemplate="{StaticResource UnlicensedModuleTemplate}">
<saf:ModuleGroupDefinition.Filters>
<saf:ModuleFilter IsEnabled="False" />
</saf:ModuleGroupDefinition.Filters>
</saf:ModuleGroupDefinition>
</saf:AboutDialogCommand.Groups>
</saf:AboutDialogCommand>
</saf:AuxiliaryPaneItem.Command>
<TextBlock TextTrimming="CharacterEllipsis"
LineHeight="16"
TextWrapping="Wrap"
Text="{x:Static resources:Resource.AboutDialogPaneText}" />
</saf:AuxiliaryPaneItem>
The following example shows how to use AboutDialogCommand and configure the about dialog buttons using ButtonDescriptions.
<saf:AuxiliaryPaneItem x:Class="App.AboutDialogAuxiliaryPane"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:saf="http://www.sartorius.com/SAF"
xmlns:resources="clr-namespace:App.Resources"
mc:Ignorable="d"
Header="{x:Static resources:Resource.AboutDialogPaneHeader}"
d:DesignHeight="450" d:DesignWidth="800">
<saf:AuxiliaryPaneItem.Command>
<saf:AboutDialogCommand ApplicationId="12345678"
CompanyWebsite="www.sartorius.com">
<saf:AboutDialogCommand.ButtonDescriptions>
<saf:AboutDialogButtonDescription AutomationId="64989aa6-1f68-4082-8ce7-d2db979b3c62" Caption="System Information" Command="{x:Static saf:AboutDialogRoutedCommands.SystemInfoCommand}" />
<saf:AboutDialogButtonDescription AutomationId="2C539EF5-7AAE-4DD9-B5A4-128626C91194" Caption="Errors" Command="{x:Static saf:AboutDialogRoutedCommands.ShowErrorsCommand}" />
</saf:AboutDialogCommand.ButtonDescriptions>
</saf:AboutDialogCommand>
</saf:AuxiliaryPaneItem.Command>
<TextBlock TextTrimming="CharacterEllipsis"
LineHeight="16"
TextWrapping="Wrap"
Text="{x:Static resources:Resource.AboutDialogPaneText}" />
</saf:AuxiliaryPaneItem>
Constructors
View SourceAboutDialogCommand()
Initializes a new instance of the AboutDialogCommand class
Declaration
public AboutDialogCommand()
Fields
View SourceAdditionalSendInformationProperty
Identifies the AdditionalSendInformation dependency property.
Declaration
public static readonly DependencyProperty AdditionalSendInformationProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ApplicationIdProperty
Identifies the ApplicationId dependency property.
Declaration
public static readonly DependencyProperty ApplicationIdProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ApplicationLogoProperty
Identifies the ApplicationLogo dependency property.
Declaration
public static readonly DependencyProperty ApplicationLogoProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ApplicationVersionProperty
Identifies the ApplicationVersion dependency property.
Declaration
public static readonly DependencyProperty ApplicationVersionProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
CompanyAddressProperty
Identifies the CompanyAddress dependency property.
Declaration
public static readonly DependencyProperty CompanyAddressProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
CompanyWebsiteProperty
Identifies the CompanyWebsite dependency property.
Declaration
public static readonly DependencyProperty CompanyWebsiteProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
CopyrightProperty
Identifies the Copyright dependency property.
Declaration
public static readonly DependencyProperty CopyrightProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
EmailSubjectProperty
Identifies the EmailSubject dependency property.
Declaration
public static readonly DependencyProperty EmailSubjectProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
InstallationDirProperty
Identifies the InstallationDir dependency property.
Declaration
public static readonly DependencyProperty InstallationDirProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
IsModuleListVisibleProperty
Identifies the IsModuleListVisible dependency property.
Declaration
public static readonly DependencyProperty IsModuleListVisibleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
LicensedToProperty
Identifies the LicensedTo dependency property.
Declaration
public static readonly DependencyProperty LicensedToProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
SendEmailToProperty
Identifies the SendEmailTo dependency property.
Declaration
public static readonly DependencyProperty SendEmailToProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ShowHelpProperty
Identifies the ShowHelp dependency property.
Declaration
public static readonly DependencyProperty ShowHelpProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
Properties
View SourceAdditionalInformation
Gets the additional information shown in the about dialog.
Declaration
public AdditionalInformationCollection AdditionalInformation { get; }
Property Value
| Type | Description |
|---|---|
| AdditionalInformationCollection |
AdditionalSendInformation
Gets or sets a (formatted) text that is appended to the email text.
Declaration
public string AdditionalSendInformation { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ApplicationId
Gets or sets the id of the application. This is a unique id per installation.
Declaration
public string ApplicationId { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ApplicationLogo
Gets or sets the logo of the application
Declaration
public object ApplicationLogo { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
Remarks
The value can be either a Wpf Element containing an application Logo or a string containing the name.
ApplicationVersion
Gets or sets the application version
Declaration
public string ApplicationVersion { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Uses the version of the executing assembly as default value.
ButtonDescriptions
Gets the button descriptions.
Declaration
public AboutDialogButtonDescriptionCollection ButtonDescriptions { get; }
Property Value
| Type | Description |
|---|---|
| AboutDialogButtonDescriptionCollection |
Remarks
When setting any button, the default buttons get cleared. You can add the default button functionality by using the routed commands found in AboutDialogRoutedCommands.
Examples
The following example shows how to use AboutDialogCommand and configure the about dialog buttons using ButtonDescriptions.
<saf:AuxiliaryPaneItem x:Class="App.AboutDialogAuxiliaryPane"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:saf="http://www.sartorius.com/SAF"
xmlns:resources="clr-namespace:App.Resources"
mc:Ignorable="d"
Header="{x:Static resources:Resource.AboutDialogPaneHeader}"
d:DesignHeight="450" d:DesignWidth="800">
<saf:AuxiliaryPaneItem.Command>
<saf:AboutDialogCommand ApplicationId="12345678"
CompanyWebsite="www.sartorius.com">
<saf:AboutDialogCommand.ButtonDescriptions>
<saf:AboutDialogButtonDescription AutomationId="64989aa6-1f68-4082-8ce7-d2db979b3c62" Caption="System Information" Command="{x:Static saf:AboutDialogRoutedCommands.SystemInfoCommand}" />
<saf:AboutDialogButtonDescription AutomationId="2C539EF5-7AAE-4DD9-B5A4-128626C91194" Caption="Errors" Command="{x:Static saf:AboutDialogRoutedCommands.ShowErrorsCommand}" />
</saf:AboutDialogCommand.ButtonDescriptions>
</saf:AboutDialogCommand>
</saf:AuxiliaryPaneItem.Command>
<TextBlock TextTrimming="CharacterEllipsis"
LineHeight="16"
TextWrapping="Wrap"
Text="{x:Static resources:Resource.AboutDialogPaneText}" />
</saf:AuxiliaryPaneItem>
See Also
CompanyAddress
Gets or sets the full address of the company.
Declaration
public string CompanyAddress { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Should be formatted either by using a wpf element or regular expression.
CompanyWebsite
Gets or sets the url to the website of the company.
Declaration
public string CompanyWebsite { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Uses "www.sartorius.com" as default value.
Copyright
Gets or sets the copyright.
Declaration
public string Copyright { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
EmailSubject
Gets or sets the subject of the email.
Declaration
public string EmailSubject { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Groups
Gets the configured groups for the modules.
Declaration
public ModuleGroupDefinitionCollection Groups { get; }
Property Value
| Type | Description |
|---|---|
| ModuleGroupDefinitionCollection |
InstallationDir
Gets or sets the installation directory of the application.
Declaration
public string InstallationDir { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Uses the ExecutablePath as default value.
IsModuleListVisible
Indicates whether the module list is visible.
Declaration
public bool IsModuleListVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
LicensedTo
Gets or sets the license owner.
Declaration
public string LicensedTo { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
SendEmailTo
Gets or sets the email where all available information is sent to.
Declaration
public string SendEmailTo { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ShowHelp
Invoked when the user clicks the help icon in the about dialog.
Declaration
public bool ShowHelp { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceCanExecute(object)
Determines whether the command can execute in its current state.
Declaration
public bool CanExecute(object parameter)
Parameters
| Type | Name | Description |
|---|---|---|
| object | parameter | Data used by the command. If the command does not require data to be passed, this object can be set to null. |
Returns
| Type | Description |
|---|---|
| bool |
Execute(object)
Defines the method to be called when the command is invoked.
Declaration
public void Execute(object parameter)
Parameters
| Type | Name | Description |
|---|---|---|
| object | parameter | Data used by the command. If the command does not require data to be passed, this object can be set to null. |
Events
View SourceCanExecuteChanged
Occurs when changes take place that affect whether or not the command should execute.
Declaration
public event EventHandler CanExecuteChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |