File

projects/wms-framework/src/lib/models/controls/ButtonBaseModel.ts

Description

Base class for the object of type @type {ButtonModel}

Extends

ContentControlModel

Index

Properties
Methods

Properties

Public Click
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(sender: any, e: any) => void>()

EventHandler for the click

Public ClickMode
Type : ClickMode
Decorators :
@Dependency(ButtonBaseModel.ClickModeProperty)

ClickMode property

Static ClickModeProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'ClickMode', ClickMode.Release, null )

ClickModeProperty dependency property

Public Command
Type : ICommand
Decorators :
@Dependency(ButtonBaseModel.CommandProperty)

Command property

Public CommandParameter
Type : unknown
Decorators :
@Dependency(ButtonBaseModel.CommandParameterProperty)

Command parameter property

Static Readonly CommandParameterProperty
Default value : new DependencyProperty( 'CommandParameter', null, ButtonBaseModel.OnCommandParameterPropertyChangedCallBack )

CommandParameterProperty dependency property

Static CommandProperty
Default value : new DependencyProperty( 'Command', null, ButtonBaseModel.OnCommandPropertyChangedCallBack )

CommandProperty dependency property

Public IsFocused
Type : boolean
Decorators :
@Dependency(ButtonBaseModel.IsFocusedProperty)

Flag to indicate if the button is focused or not.

Static IsFocusedProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'IsFocused', false, null )

IsFocusedProperty dependency property

Public isMouseLeftButtonDown
Type : boolean
Default value : false

Flag which indicates that the mouse left button is down

Static IsMouseOverProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'IsMouseOver', null, null )

IsMouseOverProperty dependency property

Public IsPressed
Type : boolean
Decorators :
@Dependency(ButtonBaseModel.IsPressedProperty)

Flag to indicate if the button is pressed or not.

Static IsPressedProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'IsPressed', false, null )

IsPressedProperty dependency property

Public isSpaceOrEnterKeyDown
Type : boolean
Default value : false

Flag which indicates that the space or enter key was entered on keydown

AngularComponentId
Default value : AngularComponentId.contentControl
Inherited from UIElement
Defined in UIElement:88

Identifies the angular component associated with the model

Static ContentProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Content', null, ContentControlModel.ContentCallback )
Inherited from ContentControlModel

ContentProperty dependency property

Public ContentTemplate
Type : DataTemplate
Decorators :
@Dependency(ContentControlModel.ContentTemplateProperty)
Inherited from ContentControlModel

Gets or sets contentTemplate

Static ContentTemplateProperty
Type : DependencyProperty
Default value : new DependencyProperty('ContentTemplate', null, null)
Inherited from ContentControlModel

ContentTemplateProperty dependency property

avoidTemplateModelResolution
Type : boolean
Inherited from Control
Defined in Control:431

Flag to determine if the default template must used instead of the dynamic template when resolving the component to use to render the current control.

When a control model has a control template associated, the component of the control template is used to render the current model

Public Background
Type : Brush
Decorators :
@Dependency(Control.BackgroundProperty)
Inherited from Control
Defined in Control:255

Gets or sets the background property

Static BackgroundProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Background', null, null )
Inherited from Control
Defined in Control:45

BackgroundProperty dependency property

Public BorderBrush
Type : any
Decorators :
@Dependency(Control.BorderBrushProperty)
Inherited from Control
Defined in Control:264

Gets or sets the border brush

Static BorderBrushProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'BorderBrush', null, null )
Inherited from Control
Defined in Control:59

BorderBrushProperty dependency property

Public BorderThickness
Type : any
Decorators :
@Dependency(Control.BorderThicknessProperty)
Inherited from Control
Defined in Control:273

Gets or sets the border thickness

Static BorderThicknessProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'BorderThickness', null, null )
Inherited from Control
Defined in Control:72

BorderThicknessProperty dependency property

Static CharacterSpacingProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'CharacterSpacing', null, null )
Inherited from Control
Defined in Control:85

CharacterSpacingProperty dependency property

Public DefaultStyleKey
Type : unknown
Inherited from Control
Defined in Control:367
Static DefaultStyleKeyProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'DeafaultStyleKey', null, null )
Inherited from Control
Defined in Control:98

DefaultStyleKeyProperty dependency property

Public FontFamily
Type : any
Decorators :
@Dependency(Control.FontFamilyProperty)
Inherited from Control
Defined in Control:282

Gets or sets the font family

Static FontFamilyProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'FontFamily', null, null )
Inherited from Control
Defined in Control:111

FontFamilyProperty dependency property

Public FontSize
Type : number
Decorators :
@Dependency(Control.FontSizeProperty)
Inherited from Control
Defined in Control:291

Gets or sets the font size

Static FontSizeProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'FontSize', null, null )
Inherited from Control
Defined in Control:124

FontSizeProperty dependency property

Public FontStretch
Type : any
Decorators :
@Dependency(Control.FontStretchProperty)
Inherited from Control
Defined in Control:300

Gets or sets the font stretch

Static FontStretchProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'FontStretch', null, null )
Inherited from Control
Defined in Control:137

FontStretchProperty dependency property

Public FontStyle
Type : any
Decorators :
@Dependency(Control.FontStyleProperty)
Inherited from Control
Defined in Control:309

Gets or sets the font style

Static FontStyleProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'FontStyle', null, null )
Inherited from Control
Defined in Control:150

FontStyleProperty dependency property

Public FontWeight
Type : any
Decorators :
@Dependency(Control.FontWeightProperty)
Inherited from Control
Defined in Control:318

Gets or sets the font weight

Static FontWeightProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'FontWeight', null, null )
Inherited from Control
Defined in Control:163

FontWeightProperty dependency property

Public Foreground
Type : any
Decorators :
@Dependency(Control.ForegroundProperty)
Inherited from Control
Defined in Control:327

Gets or sets the foreground

Static ForegroundProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Foreground', null, null )
Inherited from Control
Defined in Control:176

ForegroundProperty dependency property

Public IsEnabledChanged
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from Control
Defined in Control:374

The IsEnabledChanged event

Public IsTabStop
Type : boolean
Decorators :
@Dependency(Control.IsTabStopProperty)
Inherited from Control
Defined in Control:336

Gets or sets the is tab stop property

Static IsTabStopProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'IsTabStop', true, null )
Inherited from Control
Defined in Control:189

IsTabStopProperty dependency property

Public Padding
Type : any
Decorators :
@Dependency(Control.PaddingProperty)
Inherited from Control
Defined in Control:345

Gets or sets the padding

Static PaddingProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Padding', null, null )
Inherited from Control
Defined in Control:202

PaddingProperty dependency property

Public TabIndex
Type : number
Decorators :
@Dependency(Control.TabIndexProperty)
Inherited from Control
Defined in Control:354

Gets or sets the tab index

Static TabIndexProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'TabIndex', 0, null )
Inherited from Control
Defined in Control:215

TabIndexProperty dependency property

TabNavigation
Type : any
Default value : null
Inherited from Control
Defined in Control:365
Static TabNavigationProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'TabNavigation', null, null )
Inherited from Control
Defined in Control:228

TabNavigationProperty dependency property

Public Template
Type : any
Decorators :
@Dependency(Control.TemplateProperty)
Inherited from Control
Defined in Control:363

Gets or sets the template

templateModel
Type : any
Inherited from Control
Defined in Control:418

Model for the control template

This property has value when a control template is assigned to this model

Static TemplateProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'TemplateProperty', null, Control.TemplateCallback )
Inherited from Control
Defined in Control:241

TemplateProperty dependency property

Public ActualHeight
Type : number
Decorators :
@Dependency(FrameworkElement.ActualHeightProperty)
Inherited from FrameworkElement
Static ActualHeightProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'ActualHeight', 0, null )
Inherited from FrameworkElement

ActualHeightProperty dependency property

Public ActualWidth
Type : number
Decorators :
@Dependency(FrameworkElement.ActualWidthProperty)
Inherited from FrameworkElement
Static ActualWidthProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'ActualWidth', 0, null )
Inherited from FrameworkElement

ActualWidthProperty dependency property

allowDataContextAnchestorSet
Default value : true
Inherited from FrameworkElement
Public Clip
Type : any
Decorators :
@Dependency(FrameworkElement.ClipProperty)
Inherited from FrameworkElement

Gets or sets the clip

Public ctxMenuManager
Type : ContextMenuManager
Inherited from FrameworkElement

Instance related to a XamContextMenuComponent

Public CtxMenuOpened
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from FrameworkElement

Context menu opened event

Private currentStyleChange
Type : string[]
Inherited from FrameworkElement
Public Cursor
Type : Cursor
Decorators :
@Dependency(FrameworkElement.CursorProperty)
Inherited from FrameworkElement

Gets or sets the cursor

Static CursorProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Cursor', null, null )
Inherited from FrameworkElement

CursorProperty dependency property

Static DataContextProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'DataContext', null, FrameworkElement.DataContextCallback )
Inherited from FrameworkElement

DataContextProperty dependency property

Public FlowDirection
Type : any
Decorators :
@Dependency(FrameworkElement.FlowDirectionProperty)
Inherited from FrameworkElement

Gets or sets the flow direction

Static FlowDirectionProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'FlowDirection', null, null )
Inherited from FrameworkElement

FlowDirectionProperty dependency property

Public hasFocus
Default value : false
Inherited from FrameworkElement

Flag to determine if the framework element has the docus

height
Type : number
Inherited from FrameworkElement
Static Readonly HeightProperty
Default value : new DependencyProperty( 'Height', Number.NaN, FrameworkElement.HeightChangeCallback )
Inherited from FrameworkElement

HeightProperty dependency property

Public HorizontalAlignment
Type : HorizontalAlignment
Decorators :
@Dependency(FrameworkElement.HorizontalAlignmentProperty)
Inherited from FrameworkElement

Gets or sets the horizontal alignment

Static HorizontalAlignmentProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'HorizontalAlignment', HorizontalAlignment.Stretch, null )
Inherited from FrameworkElement

HorizontalAlignmentProperty dependency property

Public HorizontalContentAlignment
Type : HorizontalAlignment
Decorators :
@Dependency(FrameworkElement.HorizontalContentAlignmentProperty)
Inherited from FrameworkElement

Gets or sets the horizontal content alignment.

Static Readonly HorizontalContentAlignmentProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'HorizontalContentAlignment', HorizontalAlignment.Center, null )
Inherited from FrameworkElement

HorizontalContentAlignment dependency property.

Protected isDefaultStyleApplied
Type : boolean
Inherited from FrameworkElement

Indicates if the current style is from a default style

Public IsEnabled
Type : boolean
Decorators :
@Dependency(FrameworkElement.IsEnabledProperty)
Inherited from FrameworkElement

Gets value indicating if the control is enabled

/// TODO check property defined in Control instead of framework element

Static Readonly IsEnabledProperty
Default value : new DependencyProperty( 'IsEnabled', true, FrameworkElement.IsEnabledCallback )
Inherited from FrameworkElement

IsEnabledProperty dependency property

Private isFirstTimeLoad
Default value : true
Inherited from FrameworkElement

Flag used to check if it is the first time loading a model or not.

Static LanguageProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Language', null, null )
Inherited from FrameworkElement

LanguageProperty dependency property

Public LayoutUpdated
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from FrameworkElement
Public Loaded
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from FrameworkElement
Public Margin
Type : ThicknessModel
Decorators :
@Dependency(FrameworkElement.MarginProperty)
Inherited from FrameworkElement

Gets or sets the margin

Static MarginProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Margin', null, null )
Inherited from FrameworkElement

MarginProperty dependency property

Public maxHeight
Type : number
Decorators :
@Dependency(FrameworkElement.MaxHeightProperty)
Inherited from FrameworkElement

Gets or sets max height

Static MaxHeightProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'MaxHeight', 0, null )
Inherited from FrameworkElement

MaxHeightProperty dependency property

Public maxWidth
Type : number
Decorators :
@Dependency(FrameworkElement.MaxWidthProperty)
Inherited from FrameworkElement

Gets or sets the max width

Static MaxWidthProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'MaxWidth', 0, null )
Inherited from FrameworkElement

MaxWidthProperty dependency property

Public minHeight
Type : number
Decorators :
@Dependency(FrameworkElement.MinHeightProperty)
Inherited from FrameworkElement

Gets or sets the min height

Static MinHeightProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'MinHeight', 0, null )
Inherited from FrameworkElement

MinHeightProperty dependency property

Public minWidth
Type : number
Decorators :
@Dependency(FrameworkElement.MinWidthProperty)
Inherited from FrameworkElement

Gets or sets the min width

Static MinWidthProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'MinWidth', 0, null )
Inherited from FrameworkElement

MinWidthProperty dependency property

Public name
Type : string
Default value : ''
Inherited from FrameworkElement
Static NameProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Name', null, null )
Inherited from FrameworkElement

NameProperty dependency property

Private parent
Type : FrameworkElement
Default value : null
Inherited from FrameworkElement
parentChangeHandler
Type : function
Inherited from FrameworkElement
Public resources
Type : ResourceDictionary
Default value : new ResourceDictionary()
Inherited from FrameworkElement

Resources property

Public SizeChanged
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from FrameworkElement
Private sizeChangedPendingTimeout
Type : any
Inherited from FrameworkElement
Public Style
Type : RuntimeStyleInfo
Decorators :
@Dependency(FrameworkElement.StyleProperty)
Inherited from FrameworkElement

Gets or sets the style

Static StyleProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Style', null, FrameworkElement.StyleCallback )
Inherited from FrameworkElement

StyleProperty dependency property

Public Tag
Type : any
Decorators :
@Dependency(FrameworkElement.TagProperty)
Inherited from FrameworkElement

Gets or sets the tag

Static TagProperty
Default value : new DependencyProperty('Tag', null, null)
Inherited from FrameworkElement

TagProperty dependency property

Public tooltip
Type : ToolTipModel
Default value : null
Inherited from FrameworkElement

Instance related to a tooltip component for this control

Public ToolTipSet
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from FrameworkElement

ToolTipSet event

Public Unloaded
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from FrameworkElement
Public VerticalAlignment
Type : VerticalAlignment
Decorators :
@Dependency(FrameworkElement.VerticalAlignmentProperty)
Inherited from FrameworkElement

Gets or sets the vertical alignment

Static VerticalAlignmentProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'VerticalAlignment', VerticalAlignment.Stretch, null )
Inherited from FrameworkElement

VerticalAlignmentProperty dependency property

Public VerticalContentAlignment
Type : VerticalAlignment
Decorators :
@Dependency(FrameworkElement.VerticalContentAlignmentProperty)
Inherited from FrameworkElement

Gets or sets the vertical content alignment.

Static VerticalContentAlignmentProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'VerticalContentAlignment', VerticalAlignment.Center, null )
Inherited from FrameworkElement

VerticalContentAlignment dependency property.

Public Width
Type : number
Decorators :
@Dependency(FrameworkElement.WidthProperty)
Inherited from FrameworkElement

Gets or sets the width

Static WidthProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Width', Number.NaN, FrameworkElement.WidthChangeCallback )
Inherited from FrameworkElement

WidthProperty dependency property

Private __internalVisibility
Type : boolean
Default value : true
Inherited from UIElement
Defined in UIElement:289
Public AllowDrop
Type : boolean
Decorators :
@Dependency(UIElement.AllowDropProperty)
Inherited from UIElement
Defined in UIElement:279

Gets or sets the allow drop value

Static AllowDropProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'AllowDrop', false, null )
Inherited from UIElement
Defined in UIElement:52

AllowDropProperty dependency property

Public CacheMode
Type : any
Decorators :
@Dependency(UIElement.CacheModeProperty)
Inherited from UIElement
Defined in UIElement:287

Gets or sets the cache mode value

Static CacheModeProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'CacheMode', null, null )
Inherited from UIElement
Defined in UIElement:65

CacheModeProperty dependency property

capturedMoveHandler
Type : function
Inherited from UIElement
Defined in UIElement:339
capturedUpHandler
Type : function
Inherited from UIElement
Defined in UIElement:338
Static ClipProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Clip', null, null )
Inherited from UIElement
Defined in UIElement:78

ClipProperty dependency property

Private customCSSClasses
Type : string
Default value : ''
Inherited from UIElement
Defined in UIElement:271

Custom property to save CSS classes that need to be applied to the control

Static EffectProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Effect', null, null )
Inherited from UIElement
Defined in UIElement:91

EffectProperty dependency property

Public GotFocus
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: any) => void>()
Inherited from UIElement
Defined in UIElement:229
Private hasAutoColumnGridParent
Type : boolean
Default value : false
Inherited from UIElement
Defined in UIElement:262

Custom property to know if control is inside grid with auto columns

Public IsHitTestVisible
Type : boolean
Default value : false
Decorators :
@Dependency(UIElement.IsHitTestVisibleProperty)
Inherited from UIElement
Defined in UIElement:322

IsHitTestVisible property

Static IsHitTestVisibleProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'IsHitTestVisible', null, null )
Inherited from UIElement
Defined in UIElement:104

IsHitTestVisibleProperty dependency property

Public KeyDown
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: any) => void>()
Inherited from UIElement
Defined in UIElement:225
Public KeyUp
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: any) => void>()
Inherited from UIElement
Defined in UIElement:227
Public LostFocus
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(sender: any, e: any) => void>()
Inherited from UIElement
Defined in UIElement:231
Public MouseEnter
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: any) => MouseEventArgs>()
Inherited from UIElement
Defined in UIElement:213
Public MouseLeave
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: any) => MouseEventArgs>()
Inherited from UIElement
Defined in UIElement:215
Public MouseLeftButtonDown
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: MouseEventArgs) => void>()
Inherited from UIElement
Defined in UIElement:207
Public MouseLeftButtonUp
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: MouseEventArgs) => void>()
Inherited from UIElement
Defined in UIElement:217
Public MouseMove
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: MouseEventArgs) => void>()
Inherited from UIElement
Defined in UIElement:223
Public MouseRightButtonDown
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: MouseEventArgs) => void>()
Inherited from UIElement
Defined in UIElement:210
Public MouseRightButtonUp
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: MouseEventArgs) => void>()
Inherited from UIElement
Defined in UIElement:220
Public Name
Type : string
Default value : ''
Inherited from UIElement
Defined in UIElement:242

Name property

Public OnModelChange
Type : function
Inherited from UIElement
Defined in UIElement:42

On model change handler reference

Public Opacity
Type : number
Decorators :
@Dependency(UIElement.OpacityProperty)
Inherited from UIElement
Defined in UIElement:253

Gets or sets the opacity value

Static OpacityMaskProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'OpacityMask', null, null )
Inherited from UIElement
Defined in UIElement:117

OpacityMaskProperty dependency property

Static OpacityProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Opacity', 1, null )
Inherited from UIElement
Defined in UIElement:130

OpacityProperty dependency property

Static ProjectionProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Projection', null, null )
Inherited from UIElement
Defined in UIElement:143

ProjectionProperty dependency property

Public RenderSize
Type : Size
Decorators :
@Dependency(UIElement.RenderSizeProperty)
Inherited from UIElement
Defined in UIElement:297

Gets the final render size of a UIElement.

Static RenderSizeProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'RenderSize', new Size(0, 0), null )
Inherited from UIElement
Defined in UIElement:156

RenderSizeProperty dependency property

Public RenderTransform
Type : any
Decorators :
@Dependency(UIElement.RenderTransformProperty)
Inherited from UIElement
Defined in UIElement:314

Gets or sets the render transform

Public RenderTransformOrigin
Type : any
Decorators :
@Dependency(UIElement.RenderTransformOriginProperty)
Inherited from UIElement
Defined in UIElement:305

Gets or sets the render transform origin

Static RenderTransformOriginProperty
Type : DependencyProperty
Default value : new DependencyProperty('RenderTransformOrigin', null, null)
Inherited from UIElement
Defined in UIElement:169

RenderTransformOriginProperty dependency property

Static RenderTransformProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'RenderTransform', null, null )
Inherited from UIElement
Defined in UIElement:179

RenderTransformProperty dependency property

Public Spin
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(sender: any, e: any) => void>()
Inherited from UIElement
Defined in UIElement:233
Static UseLayoutRoundingProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'UseLayoutRounding', true, null )
Inherited from UIElement
Defined in UIElement:192

UseLayoutRoundingProperty dependency property

Static VisibilityProperty
Default value : new DependencyProperty('Visibility', true, null)
Inherited from UIElement
Defined in UIElement:205

VisibilityProperty dependency property

Protected bindingExpressions
Default value : new SimpleDictionary< string, BindingExpression >()
Inherited from DependencyObject
Public BindingValidationError
Default value : new SubscriptionEvent< (sender: any, e: BindingValidationErrorEventArgs) => void >()
Inherited from DependencyObject

Event for validation errors

Public change
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from DependencyObject

Infrastructure event for notifying event changes

Public Dispatcher
Type : Dispatcher
Default value : Dispatcher.GetDispatcher()
Inherited from DependencyObject
isEnableSetPropertiesRegistry
Type : boolean
Default value : true
Inherited from DependencyObject

Flag which indicates if the dependency property set mechanism is enable

Public IsInitializingBindings
Type : boolean
Default value : false
Inherited from DependencyObject

Property to determine if bindings are being initialized

previousValidationMessage
Type : string
Default value : ''
Inherited from DependencyObject
Protected properties
Type : object
Default value : {}
Inherited from DependencyObject
Private setPropertiesRegistry
Type : Map<string | boolean>
Default value : new Map()
Inherited from DependencyObject

Registry with dependencies properties which has been set

validationerr
Default value : false
Inherited from DependencyObject
validationMessagesStack
Type : Array<>
Default value : []
Inherited from DependencyObject

Keeps a queue of validation messages registered on the current Dependency Object

Methods

CanExecuteChanged
CanExecuteChanged(sender: any, e: any)

CanExecuteChanged Executes a CanExecute update

Parameters :
Name Type Optional
sender any No
e any No
Returns : void
Private ExecuteCommand
ExecuteCommand()

Executes the associated command to the ButtonBase

Returns : void
Public OnClick
OnClick()

OnClick handler

Returns : void
OnCommandChanged
OnCommandChanged(args: DependencyPropertyChangedEventArgs)

Executed when the CommandProperty changes to remove the old CanExecuteChange handler and to add the new handler.

Parameters :
Name Type Optional
args DependencyPropertyChangedEventArgs No
Returns : void
OnCommandParameterChanged
OnCommandParameterChanged(args: DependencyPropertyChangedEventArgs)

Executes a CanExecute update

Parameters :
Name Type Optional
args DependencyPropertyChangedEventArgs No
Returns : void
Static OnCommandParameterPropertyChangedCallBack
OnCommandParameterPropertyChangedCallBack(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)

OnCommandParameterProperty Callback Executed when the CommandParameterProperty changes

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
Static OnCommandPropertyChangedCallBack
OnCommandPropertyChangedCallBack(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)

CommandProperty Callback Executed when the CommandProperty changes

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
OnGotFocus
OnGotFocus(e: RoutedEventArgs)
Inherited from Control
Defined in Control:303

Overrides OnGotFocus handler

Parameters :
Name Type Optional
e RoutedEventArgs No
Returns : void
OnKeyDown
OnKeyDown(e: KeyEventArgs)
Inherited from Control
Defined in Control:346

Overrides OnKeyDown handler

Parameters :
Name Type Optional
e KeyEventArgs No
Returns : void
OnKeyUp
OnKeyUp(e: KeyEventArgs)
Inherited from Control
Defined in Control:326

Overrides OnKeyUp handler

Parameters :
Name Type Optional
e KeyEventArgs No
Returns : void
OnLostFocus
OnLostFocus(e: RoutedEventArgs)
Inherited from Control
Defined in Control:314

Overrides OnLostFocus handler

Parameters :
Name Type Optional
e RoutedEventArgs No
Returns : void
OnMouseEnter
OnMouseEnter(e: any)
Inherited from Control
Defined in Control:411

Overrides OnMouseEnter handler

Parameters :
Name Type Optional
e any No
Returns : void
OnMouseLeave
OnMouseLeave(e: any)
Inherited from Control
Defined in Control:425

Overrides OnMouseLeave handler

Parameters :
Name Type Optional
e any No
Returns : void
OnMouseLeftButtonDown
OnMouseLeftButtonDown(e: any)
Inherited from Control
Defined in Control:369

Overrides OnMouseLeftButtonDown handler

Parameters :
Name Type Optional
e any No
Returns : void
OnMouseLeftButtonUp
OnMouseLeftButtonUp(e: any)
Inherited from Control
Defined in Control:388

Overrides OnMouseLeftButtonUp handler

Parameters :
Name Type Optional
e any No
Returns : void
OnMouseMove
OnMouseMove(e: any)
Inherited from Control
Defined in Control:438

Overrides OnMouseMove handler

Parameters :
Name Type Optional
e any No
Returns : void
UpdateCanExecute
UpdateCanExecute()

UpdateCanExecute

Returns : void
Static ContentCallback
ContentCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)
Inherited from ContentControlModel

Content dependency property callback

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
Public ContentChangeHandler
ContentChangeHandler(args: DependencyPropertyChangedEventArgs)
Inherited from ContentControlModel

Content change handler

Parameters :
Name Type Optional
args DependencyPropertyChangedEventArgs No
Returns : void
GetChild
GetChild(idx: number)
Inherited from DependencyObject

Returns the child element

Parameters :
Name Type Optional
idx number No
Returns : DependencyObject

{DependencyObject}

GetChildrenCount
GetChildrenCount()
Inherited from DependencyObject

Method o know the amount of children the parent has

Returns : number

{number}

Protected InvalidateMeasure
InvalidateMeasure()
Inherited from ContentControlModel

Invalidates the measure

Returns : any
Public OnContentChange
OnContentChange()
Inherited from ContentControlModel

On content change event

Returns : any
ApplyTemplate
ApplyTemplate()
Inherited from Control
Defined in Control:433
Returns : any
Public Focus
Focus()
Inherited from Control
Defined in Control:403

Focus control

Returns : void
Public GetTemplateChild
GetTemplateChild(name: string)
Inherited from Control
Defined in Control:386

Gets a control model defined inside the control template model (if assigned)

Parameters :
Name Type Optional
name string No
Returns : DependencyObject

{DependencyObject}

Protected loadModels
loadModels()
Inherited from Control
Defined in Control:526

Loads the model for the child elements defined in component.

Returns : void
Public OnTemplateChanged
OnTemplateChanged(sender: any, args: DependencyPropertyChangedEventArgs)
Inherited from Control
Defined in Control:481

Operation to apply when changing control template

Parameters :
Name Type Optional
sender any No
args DependencyPropertyChangedEventArgs No
Returns : void
OnTextChanged
OnTextChanged(sender: any, args?: any)
Inherited from Control
Defined in Control:471

OnTextChanged handler

Parameters :
Name Type Optional
sender any No
args any Yes
Returns : void
Static TemplateCallback
TemplateCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)
Inherited from Control
Defined in Control:510

Callback for the template changed property

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
Protected tryApplyStyleFromParentOrDefault
tryApplyStyleFromParentOrDefault()
Inherited from FrameworkElement

Tries to apply style from parent or from default

Returns : void
Protected tryGetDefaultThemeStyle
tryGetDefaultThemeStyle()
Inherited from Control
Defined in Control:553

Tries to resolve style from default theme

Returns : any
Public AfterContentChecked
AfterContentChecked()
Inherited from FrameworkElement

Angular Lifecycle Hooks

Returns : void
Public AfterContentInit
AfterContentInit()
Inherited from FrameworkElement

Angular Lifecycle Hook

Returns : void
Public AfterViewChecked
AfterViewChecked()
Inherited from FrameworkElement

Angular Lifecycle Hooks

Returns : void
Public AfterViewInit
AfterViewInit()
Inherited from FrameworkElement

Angular Lifecycle Hook. According to SL Documentation LayoutUpdated is the last object lifetime event to occur in the sequence before a control is ready for interaction. A setTimeout is set to ensure that it is triggered after everything is resolved.

Returns : void
Public CleanupBindingSubscriptions
CleanupBindingSubscriptions()
Inherited from FrameworkElement

Clean up any subscription created for user bindings

Returns : void
Static DataContextCallback
DataContextCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

DataContext Callback Executed when the Width changes

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
Public DoCheck
DoCheck()
Inherited from FrameworkElement

Angular Lifecycle Hooks

Returns : void
Public FindName
FindName(name: string)
Inherited from FrameworkElement

Find an object by its Name.

Parameters :
Name Type Optional
name string No
Returns : unknown

{unknown}

Public fireLoaded
fireLoaded()
Inherited from FrameworkElement

Fire Loaded event. The event is fired only once, even if fireLoaded() is called multiple times.

Returns : void
Public getApplicationResource
getApplicationResource(key: string, ...properties: string[])
Inherited from FrameworkElement

Retrieves a resource with the given key or with the given property path

Paths are just a collection of properties to be identified. Also static fields could be accessed using object instances.

@example let obj = tmp.getApplicationResource('reskey', 'P1', 'P2')

Parameters :
Name Type Optional Description
key string No

the key of the resource

properties string[] No

a collection of property paths

Example :
let obj = tmp.getApplicationResource(&#39;reskey&#39;, &#39;P1&#39;, &#39;P2&#39;)
Returns : any

{any} the resulting data element

GetBindingExpression
GetBindingExpression(dependencyProperty: DependencyProperty)
Inherited from FrameworkElement
Parameters :
Name Type Optional
dependencyProperty DependencyProperty No
Returns : any
Public getResourceByKey
getResourceByKey(key: string)
Inherited from FrameworkElement

Gets the specific resource by the given key

Parameters :
Name Type Optional
key string No
Returns : unknown

{unknown}

Static HeightChangeCallback
HeightChangeCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

HeightChange Callback Executed when the Height changes

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
Protected initProperties
initProperties()
Inherited from FrameworkElement

Initialize the child elements properties of the component in code behind.

Returns : void
Private innerGetChild
innerGetChild(idx: number)
Inherited from FrameworkElement

Gets the child number idx from this FrameworkElement.

Parameters :
Name Type Optional
idx number No
Returns : DependencyObject

{DependencyObject}

Private innerGetChildrenCount
innerGetChildrenCount()
Inherited from FrameworkElement

Gets the number of children on this FrameworkElement.

Returns : number

{number}

Private innerGetChildrenParent
innerGetChildrenParent(prop: string)
Inherited from FrameworkElement

Gets the parent from which children should be taken from.

Parameters :
Name Type Optional
prop string No
Returns : FrameworkElement

{FrameworkElement}

Static IsEnabledCallback
IsEnabledCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

IsEnabled dependency property callback

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
MeasureOverride
MeasureOverride(availableSize: Size)
Inherited from FrameworkElement

Measure override method NOTE: We are not supporting this functionality in angular, this implementation is meant only to avoid runtime exceptions, but any code that relies on MeasureOverride should be review and analyze for manual changes

Parameters :
Name Type Optional
availableSize Size No
Returns : Size

{Size}

Public OnApplyTemplate
OnApplyTemplate()
Inherited from FrameworkElement

This method is involved in a setTimeout call when a control template is assigned to the current model

Returns : void
Public OnChanges
OnChanges()
Inherited from FrameworkElement

Angular Lifecycle Hooks

Returns : void
Protected OnDataContextCallback
OnDataContextCallback(args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

Callback action for DataContext property changes

Parameters :
Name Type Optional
args DependencyPropertyChangedEventArgs No
Returns : void
Public OnDestroy
OnDestroy()
Inherited from FrameworkElement
Returns : void
Public OnInit
OnInit()
Inherited from FrameworkElement

Angular Lifecycle Hook

Returns : void
Public OnIsEnabledChanged
OnIsEnabledChanged(args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

On IsEnabled changed handler

Parameters :
Name Type Optional
args DependencyPropertyChangedEventArgs No
Returns : void
OpenCtxMenu
OpenCtxMenu(menu: ContextMenuManager)
Inherited from FrameworkElement

Opens an instance of the XamContextMenu This is declared here because it can be set as an attached property and the component should know when it has a XamContextMenu setted to be displayed.

Parameters :
Name Type Optional
menu ContextMenuManager No
Returns : void
Public RaiseSizeChangedEvent
RaiseSizeChangedEvent()
Inherited from FrameworkElement

Raise the SizeChanged event

Returns : void
Public RecreateInvalidBindings
RecreateInvalidBindings()
Inherited from FrameworkElement

Calling CleanupBindingSubscriptions will set bindingExpression into an invalid state, the expressions and bindings still might persist (if the model is not destroyed), yet the subscriptions were cleaned, if this model is re-bind to a new angular component previous bindings and bindingExpressions will required to be recreated to work properly.

This happens when the angular component is destroyed but the model still persists, like when an *ngIf is used to hide an item in the DOM, yet the model instance still persist until it gets visible again, the binding and bindingExpression will be the same but their subscriptions are gone.

Returns : void
Public refreshBindings
refreshBindings()
Inherited from FrameworkElement

Refresh element binding values

Returns : void
Private scheduleFiringSizeChanged
scheduleFiringSizeChanged()
Inherited from FrameworkElement

Schedules executing the SizeChanged event

Returns : void
Private setDataContextFromAnchestor
setDataContextFromAnchestor(parent: any)
Inherited from FrameworkElement

Sets the datacontext from anchestor when was not directly set to property

Parameters :
Name Type Optional
parent any No
Returns : void
SetTooltipToModel
SetTooltipToModel(tooltip: ToolTipModel)
Inherited from FrameworkElement

Set tooltip component

Parameters :
Name Type Optional
tooltip ToolTipModel No
Returns : void
Static StyleCallback
StyleCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

StyleCallback

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
UpdateLayout
UpdateLayout()
Inherited from UIElement
Defined in UIElement:541

Updates the layout

Returns : void
Static WidthChangeCallback
WidthChangeCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

WidthChange Callback Executed when the Width changes

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
Public Arrange
Arrange(obj: any)
Inherited from UIElement
Defined in UIElement:393

Arrange method

Parameters :
Name Type Optional
obj any No
Returns : void
Public captureMouse
captureMouse()
Inherited from UIElement
Defined in UIElement:368

Captures the mouse events

Returns : boolean
Public Measure
Measure(obj: any)
Inherited from UIElement
Defined in UIElement:404

Measure method

Parameters :
Name Type Optional
obj any No
Returns : any
Public releaseMouseCapture
releaseMouseCapture()
Inherited from UIElement
Defined in UIElement:379
Returns : void
Protected SyncModelWithComponent
SyncModelWithComponent(params: any)
Inherited from UIElement
Defined in UIElement:409
Parameters :
Name Type Optional Default value
params any No null
Returns : void
Public TransformToVisual
TransformToVisual(obj: UIElement)
Inherited from UIElement
Defined in UIElement:354

Transforms to visual

Parameters :
Name Type Optional
obj UIElement No
Returns : any
Public withName
withName(name: string)
Inherited from UIElement
Defined in UIElement:341
Parameters :
Name Type Optional
name string No
Returns : UIElement
Private addRelatedSubscriptionIfRequired
addRelatedSubscriptionIfRequired(event: SubscriptionEvent<any>, theHandler: any, bindingExpression: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
event SubscriptionEvent<any> No
theHandler any No
bindingExpression BindingExpression No
Returns : void
Private addSubscriptionForTwoWayBindings
addSubscriptionForTwoWayBindings(dependencyProperty: DependencyProperty, binding: Binding, bindingExpression: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
dependencyProperty DependencyProperty No
binding Binding No
bindingExpression BindingExpression No
Returns : void
addsValidationMessage
addsValidationMessage(propKey: Binding | string, message: string)
Inherited from DependencyObject

Adds a new validation message associated to a binding or a property name

Parameters :
Name Type Optional
propKey Binding | string No
message string No
Returns : void
Private beginSubscribeToMultiPropertyPathChanges
beginSubscribeToMultiPropertyPathChanges(context: any, binding: Binding, dependencyProperty: DependencyProperty, bindingExpression: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
context any No
binding Binding No
dependencyProperty DependencyProperty No
bindingExpression BindingExpression No
Returns : void
Private checkForSubscriptoinToDataErrorInfo
checkForSubscriptoinToDataErrorInfo(currentContext: any, binding: Binding, propertyToSubscribe: string, bindingExpression: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
currentContext any No
binding Binding No
propertyToSubscribe string No
bindingExpression BindingExpression No
Returns : void
Public clearValue
clearValue(property: DependencyProperty)
Inherited from DependencyObject

Clears the dependency property value

Parameters :
Name Type Optional
property DependencyProperty No
Returns : void
Equals
Equals(obj: any)
Inherited from DependencyObject

Compares this dependency object agains another object.

Parameters :
Name Type Optional
obj any No
Returns : boolean

{boolean}

GetHashCode
GetHashCode()
Inherited from DependencyObject

Gets a hash code for this dependency object.

Returns : number

{number}

Public getValue
getValue(property: DependencyProperty)
Inherited from DependencyObject

Gets the value of a dependency property

Parameters :
Name Type Optional
property DependencyProperty No
Returns : any
Private handleErrorsOnContext
handleErrorsOnContext(errorCtxt: INotifyDataErrorInfo, args: DataErrorsChangedEventArgs)
Inherited from DependencyObject

Check and register possible errors in an error context

Parameters :
Name Type Optional
errorCtxt INotifyDataErrorInfo No
args DataErrorsChangedEventArgs No
Returns : void
Public IsPropertySet
IsPropertySet(propertyName: string)
Inherited from DependencyObject

Indicates if the property has been already set.

Parameters :
Name Type Optional
propertyName string No
Returns : any
Private performDataErrorValidationIfRequired
performDataErrorValidationIfRequired(binding: Binding, theBindingContext: any)
Inherited from DependencyObject

Performs validation on model if the model implementes IDataErrorINfo

Parameters :
Name Type Optional
binding Binding No
theBindingContext any No
Returns : void
Private performRemoveValidationIfInValidationError
performRemoveValidationIfInValidationError(binding: Binding)
Inherited from DependencyObject

Performs the remove validation if the InValidationError is true

Parameters :
Name Type Optional
binding Binding No
Returns : void
Public performTargetObjectBindingUpdate
performTargetObjectBindingUpdate(dependencyProperty: DependencyProperty, binding: Binding)
Inherited from DependencyObject

Updates the target object value associated to the binding.

Parameters :
Name Type Optional
dependencyProperty DependencyProperty No
binding Binding No
Returns : void
Private preprocessValue
preprocessValue(property: DependencyProperty, value: any)
Inherited from DependencyObject

Preprocess value to be set to dependency property

Parameters :
Name Type Optional
property DependencyProperty No
value any No
Returns : any
Private recreateSubscriptionsForMultiPropertyBindingPath
recreateSubscriptionsForMultiPropertyBindingPath(currentContext: any, outerContext: any, properties: string[], propertyIndex: number, dependencyProperty: DependencyProperty, bindingExpression: BindingExpression, subscriptionsForCurrentBindingPath: Array<>)
Inherited from DependencyObject
Parameters :
Name Type Optional
currentContext any No
outerContext any No
properties string[] No
propertyIndex number No
dependencyProperty DependencyProperty No
bindingExpression BindingExpression No
subscriptionsForCurrentBindingPath Array<> No
Returns : void
Private registerSetPropertyIfRequired
registerSetPropertyIfRequired(name: string)
Inherited from DependencyObject

Register set property if required

Parameters :
Name Type Optional
name string No
Returns : void
Private removeSubscriptionsForMultiPropertyBindingPath
removeSubscriptionsForMultiPropertyBindingPath(subscriptionsForCurrentBindingPath: [], propertyIndex: number)
Inherited from DependencyObject
Parameters :
Name Type Optional
subscriptionsForCurrentBindingPath [] No
propertyIndex number No
Returns : void
removeValidationMessage
removeValidationMessage(propKey: Binding | string)
Inherited from DependencyObject

Removes a validation message associated to a binding or a property name

Parameters :
Name Type Optional
propKey Binding | string No
Returns : void
SetBinding
SetBinding(dependencyProperty: DependencyProperty, binding: Binding)
Inherited from DependencyObject

Sets a binding to the specified property at runtime

Parameters :
Name Type Optional Description
dependencyProperty DependencyProperty No

property to bind

binding Binding No

binding object

Returns : void
Public setValue
setValue(property: DependencyProperty, value: any)
Inherited from DependencyObject

Sets the value for a dependency property

Parameters :
Name Type Optional
property DependencyProperty No
value any No
Returns : void
Public setValueForScopedRegion
setValueForScopedRegion(property: DependencyProperty, value: any, scopedRegionManager: IRegionManager)
Inherited from DependencyObject

Sets the value for a dependency property. This is a workaround to support Scoped Region Managers. A research is required to find out the way to get the application region Manager when scoped region managers are used (when creating the DelayedRegionBehavior, the correct scoped region manager must be passed as an argument).

Parameters :
Name Type Optional
property DependencyProperty No
value any No
scopedRegionManager IRegionManager No
Returns : void
Protected shouldPreventDefaultSourceUpdate
shouldPreventDefaultSourceUpdate(dependencyProperty: DependencyProperty, binding: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
dependencyProperty DependencyProperty No
binding BindingExpression No
Returns : boolean
Private subscribeToBindingPathChanges
subscribeToBindingPathChanges(context: any, binding: Binding, dependencyProperty: DependencyProperty, bindingExpression: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
context any No
binding Binding No
dependencyProperty DependencyProperty No
bindingExpression BindingExpression No
Returns : void
Private subscribeToErrorsChangedInModel
subscribeToErrorsChangedInModel(errorCtxt: INotifyDataErrorInfo, propertyToSubscribe: string, bindingExpression: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
errorCtxt INotifyDataErrorInfo No
propertyToSubscribe string No
bindingExpression BindingExpression No
Returns : void
Private subscribeToPropertyChanges
subscribeToPropertyChanges(currentContext: any, outerContext: any, properties: string[], propertyIndex: number, dependencyProperty: DependencyProperty, bindingExpression: BindingExpression, subscriptionsForCurrentBindingPath: Array<>)
Inherited from DependencyObject
Parameters :
Name Type Optional
currentContext any No
outerContext any No
properties string[] No
propertyIndex number No
dependencyProperty DependencyProperty No
bindingExpression BindingExpression No
subscriptionsForCurrentBindingPath Array<> No
Returns : void
Private updateSourceOfBinding
updateSourceOfBinding(binding: Binding, outerContext: any, dependencyProperty: DependencyProperty)
Inherited from DependencyObject

Updates the source of a binding

Parameters :
Name Type Optional
binding Binding No
outerContext any No
dependencyProperty DependencyProperty No
Returns : void
import { ICommand } from '../../baseframework/ICommand';
import { SubscriptionEvent } from '../../utils/SubscriptionEvent';
import { ContentControlModel } from './ContentControlModel';
import { DependencyProperty } from '../../basecomponentmodel/DependencyProperty';
import { Dependency } from '../../basecomponentmodel/Dependency';
import { DependencyObject } from '../../basecomponentmodel/DependencyObject';
import { DependencyPropertyChangedEventArgs } from '../../basecomponentmodel/DependencyPropertyChangedEventArgs';
import { ClickMode } from '../enums/ClickMode';
import { RoutedEventArgs } from '../events/RoutedEventArgs';
import { KeyEventArgs } from '../events/KeyEventArgs';
import { Key } from '../enums/Key';

/**
 * Base class for the object of type @type {ButtonModel}
 *
 * @export
 * @class ButtonBaseModel
 * @extends {ContentControlModel}
 * @wType System.Windows.Controls.Primitives.ButtonBase
 */
export class ButtonBaseModel extends ContentControlModel {
  /**
   * ClickModeProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof ButtonBaseModel
   */
  static ClickModeProperty: DependencyProperty = new DependencyProperty(
    'ClickMode',
    ClickMode.Release,
    null
  );

  /**
   * CommandParameterProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof ButtonBaseModel
   */
  static readonly CommandParameterProperty = new DependencyProperty(
    'CommandParameter',
    null,
    ButtonBaseModel.OnCommandParameterPropertyChangedCallBack
  );

  /**
   * CommandProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof ButtonBaseModel
   */
  static CommandProperty = new DependencyProperty(
    'Command',
    null,
    ButtonBaseModel.OnCommandPropertyChangedCallBack
  );

  /**
   * IsFocusedProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof ButtonBaseModel
   */
  static IsFocusedProperty: DependencyProperty = new DependencyProperty(
    'IsFocused',
    false,
    null
  );

  /**
   * IsMouseOverProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof ButtonBaseModel
   */
  static IsMouseOverProperty: DependencyProperty = new DependencyProperty(
    'IsMouseOver',
    null,
    null
  );

  /**
   * IsPressedProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof ButtonBaseModel
   */
  static IsPressedProperty: DependencyProperty = new DependencyProperty(
    'IsPressed',
    false,
    null
  );

  /**
   * EventHandler for the click
   *
   * @memberof ButtonBaseModel
   */
  public Click: SubscriptionEvent<(sender: any, e: any) => void> =
    new SubscriptionEvent<(sender: any, e: any) => void>();

  /**
   * ClickMode property
   *
   * @type {ClickMode}
   * @memberof ButtonBaseModel
   */
  @Dependency(ButtonBaseModel.ClickModeProperty)
  public ClickMode: ClickMode;

  /**
   * Command property
   *
   * @type {ICommand}
   * @memberof ButtonBaseModel
   */
  @Dependency(ButtonBaseModel.CommandProperty)
  public Command: ICommand;

  /**
   * Command parameter property
   *
   * @type {unknown}
   * @memberof ButtonBaseModel
   */
  @Dependency(ButtonBaseModel.CommandParameterProperty)
  public CommandParameter: unknown;

  /**
   * Flag to indicate if the button is focused or not.
   *
   * @type {boolean}
   * @memberof ButtonBaseModel
   */
  @Dependency(ButtonBaseModel.IsFocusedProperty)
  public IsFocused: boolean;

  /**
   * Flag to indicate if the button is pressed or not.
   *
   * @type {boolean}
   * @memberof ButtonBaseModel
   */
  @Dependency(ButtonBaseModel.IsPressedProperty)
  public IsPressed: boolean;

  /**
   * Flag which indicates that the mouse left button is down
   *
   * @private
   * @type {boolean}
   * @memberof ButtonComponent
   */
  public isMouseLeftButtonDown: boolean = false;

  /**
   * Flag which indicates that the space or enter key was entered on keydown
   *
   * @private
   * @type {boolean}
   * @memberof ButtonComponent
   */
  public isSpaceOrEnterKeyDown: boolean = false;

  /**
   * CommandProperty Callback
   * Executed when the CommandProperty changes
   *
   * @static
   * @param {DependencyObject} sender
   * @param {DependencyPropertyChangedEventArgs} args
   * @memberof ButtonBaseModel
   * @wIgnore
   */
  public static OnCommandPropertyChangedCallBack(
    sender: DependencyObject,
    args: DependencyPropertyChangedEventArgs
  ) {
    const buttonBase = sender as ButtonBaseModel;
    buttonBase.OnCommandChanged(args);
  }

  /**
   * OnCommandParameterProperty Callback
   * Executed when the CommandParameterProperty changes
   *
   * @static
   * @param {DependencyObject} sender
   * @param {DependencyPropertyChangedEventArgs} args
   * @memberof ButtonBaseModel
   * @wIgnore
   */
  public static OnCommandParameterPropertyChangedCallBack(
    sender: DependencyObject,
    args: DependencyPropertyChangedEventArgs
  ) {
    const buttonBase = sender as ButtonBaseModel;
    buttonBase.OnCommandParameterChanged(args);
  }

  /**
   * Executed when the CommandProperty changes to remove the
   * old CanExecuteChange handler and to add the new handler.
   *
   * @param {DependencyPropertyChangedEventArgs} args
   * @memberof ButtonBaseModel
   * @wIgnore
   */
  OnCommandChanged(args: DependencyPropertyChangedEventArgs) {
    const newValue = args.NewValue as ICommand;
    const oldValue = args.OldValue as ICommand;
    if (oldValue) {
      oldValue.CanExecuteChanged?.removeHandler(this.CanExecuteChanged, this);
    }
    if (newValue) {
      newValue.CanExecuteChanged?.addHandler(this.CanExecuteChanged, this);
    }
    this.UpdateCanExecute();
  }

  /**
   * Executes a CanExecute update
   *
   * @param {DependencyPropertyChangedEventArgs} args
   * @memberof ButtonBaseModel
   * @wIgnore
   */
  OnCommandParameterChanged(args: DependencyPropertyChangedEventArgs) {
    this.UpdateCanExecute();
  }

  /**
   * CanExecuteChanged
   * Executes a CanExecute update
   *
   * @param {DependencyPropertyChangedEventArgs} args
   * @memberof ButtonBaseModel
   * @wIgnore
   */
  CanExecuteChanged(sender: any, e: any) {
    this.UpdateCanExecute();
  }

  /**
   * UpdateCanExecute
   *
   * @param {DependencyPropertyChangedEventArgs} args
   * @memberof ButtonBaseModel
   * @wIgnore
   */
  UpdateCanExecute() {
    const command = this.Command;
    const commandParameter = this.CommandParameter;
    let flag = this.bindingExpressions.containsKey('IsEnabled')
      ? this.IsEnabled
      : true;
    if (command && !command.CanExecute(commandParameter)) {
      flag = false;
    }
    this.IsEnabled = flag;
  }

  /**
   * OnClick handler
   *
   * @memberof ButtonBaseModel
   */
  public OnClick(): void {
    const args = new RoutedEventArgs();
    args.OriginalSource = this;
    this.Click.fire([this, args]);
    this.ExecuteCommand();
  }

  /**
   * Overrides OnGotFocus handler
   *
   * @param {RoutedEventArgs} e
   * @memberof ButtonBaseModel
   */
  OnGotFocus(e: RoutedEventArgs): void {
    super.OnGotFocus(e);
    this.IsFocused = true;
  }

  /**
   * Overrides OnLostFocus handler
   *
   * @param {RoutedEventArgs} e
   * @memberof ButtonBaseModel
   */
  OnLostFocus(e: RoutedEventArgs): void {
    super.OnLostFocus(e);
    this.IsFocused = false;
    this.IsPressed = false;
  }

  /**
   * Overrides OnKeyUp handler
   *
   * @param {KeyEventArgs} e
   * @memberof ButtonBaseModel
   */
  OnKeyUp(e: KeyEventArgs) {
    if (this.IsEnabled && this.ClickMode !== ClickMode.Hover) {
      switch (e.Key) {
        case Key.Enter:
        case Key.Space:
          this.isSpaceOrEnterKeyDown = false;
          if (this.IsPressed && this.ClickMode === ClickMode.Release) {
            this.OnClick();
          }
          this.IsPressed = false;
      }
    }
  }

  /**
   * Overrides OnKeyDown handler
   *
   * @param {KeyEventArgs} e
   * @memberof ButtonBaseModel
   */
  OnKeyDown(e: KeyEventArgs) {
    if (this.IsEnabled && this.ClickMode !== ClickMode.Hover) {
      switch (e.Key) {
        case Key.Enter:
        case Key.Space:
          if (!this.isSpaceOrEnterKeyDown) {
            this.isSpaceOrEnterKeyDown = true;
            this.IsPressed = true;
            if (this.ClickMode === ClickMode.Press) {
              this.OnClick();
            }
          }
      }
    }
  }

  /**
   * Overrides OnMouseLeftButtonDown handler
   *
   * @param {*} e
   * @returns {void}
   * @memberof ButtonBaseModel
   */
  OnMouseLeftButtonDown(e: any): void {
    super.OnMouseLeftButtonDown(e);
    if (e.Handled) return;
    this.isMouseLeftButtonDown = true;
    if (!this.IsEnabled || this.ClickMode == ClickMode.Hover) return;
    e.Handled = true;
    this.Focus();
    this.IsPressed = true;
    if (this.ClickMode != ClickMode.Press) return;
    this.OnClick();
  }

  /**
   * Overrides OnMouseLeftButtonUp handler
   *
   * @param {*} e
   * @returns {void}
   * @memberof ButtonBaseModel
   */
  OnMouseLeftButtonUp(e: any) {
    super.OnMouseLeftButtonUp(e);
    if (e.Handled) return;
    this.isMouseLeftButtonDown = false;
    if (!this.IsEnabled || this.ClickMode == ClickMode.Hover) return;
    e.Handled = true;
    if (
      !this.isSpaceOrEnterKeyDown &&
      this.IsPressed &&
      this.ClickMode == ClickMode.Release
    )
      this.OnClick();
    if (this.isSpaceOrEnterKeyDown) return;
    this.IsPressed = false;
  }

  /**
   * Overrides OnMouseEnter handler
   *
   * @param {*} e
   * @returns {void}
   * @memberof ButtonBaseModel
   */
  OnMouseEnter(e: any) {
    super.OnMouseEnter(e);
    if (this.ClickMode != ClickMode.Hover || !this.IsEnabled) return;
    this.IsPressed = true;
    this.OnClick();
  }

  /**
   * Overrides OnMouseLeave handler
   *
   * @param {*} e
   * @returns {void}
   * @memberof ButtonBaseModel
   */
  OnMouseLeave(e: any) {
    super.OnMouseLeave(e);
    if (!this.IsEnabled) return;
    this.IsPressed = false;
  }

  /**
   * Overrides OnMouseMove handler
   *
   * @param {*} e
   * @returns {void}
   * @memberof ButtonBaseModel
   */
  OnMouseMove(e: any) {
    super.OnMouseMove(e);
    if (
      !this.isMouseLeftButtonDown ||
      !this.IsEnabled ||
      this.ClickMode == ClickMode.Hover ||
      this.isSpaceOrEnterKeyDown
    ) {
      return;
    }
    this.IsPressed = true;
  }

  /**
   * Executes the associated command to the ButtonBase
   *
   * @private
   * @returns {void}
   * @memberof ButtonBaseModel
   */
  private ExecuteCommand(): void {
    if (
      this.Command == null ||
      !this.Command.CanExecute(this.CommandParameter)
    ) {
      return;
    }
    this.Command.Execute(this.CommandParameter);
  }
}

result-matching ""

    No results matching ""