C# Class withSIX.Core.Presentation.Wpf.Extensions.TextBlockTrimmedTooltip

Attached property provider which adds the read-only attached property TextBlockService.IsTextTrimmed to the framework's TextBlock control.
Datei anzeigen Open project: SIXNetworks/withSIX.Desktop

Public Properties

Property Type Description
AutomaticToolTipEnabledProperty System.Windows.DependencyProperty
IsTextTrimmedKey System.Windows.DependencyPropertyKey
IsTextTrimmedProperty System.Windows.DependencyProperty

Public Methods

Method Description
OnTextBlockSizeChanged ( object sender, System.Windows.SizeChangedEventArgs e ) : void

Event handler for TextBlock's SizeChanged routed event. Triggers evaluation of the IsTextTrimmed attached property.

SetAutomaticToolTipEnabled ( DependencyObject element, bool value ) : void

Sets the current effective value of the AutomaticToolTipEnabled attached property.

Private Methods

Method Description
CalculateIsTextTrimmed ( System.Windows.Controls.TextBlock textBlock ) : bool

Determines whether or not the text in textBlock is currently being trimmed due to width or height constraints.

Does not work properly when TextWrapping is set to WrapWithOverflow.

GetAutomaticToolTipEnabled ( DependencyObject element ) : bool
GetIsTextTrimmed ( System.Windows.Controls.TextBlock target ) : bool
SetIsTextTrimmed ( System.Windows.Controls.TextBlock target, bool value ) : void

Sets the instance value of read-only dependency property IsTextTrimmed.

TextBlockTrimmedTooltip ( ) : System

Method Details

OnTextBlockSizeChanged() public static method

Event handler for TextBlock's SizeChanged routed event. Triggers evaluation of the IsTextTrimmed attached property.
public static OnTextBlockSizeChanged ( object sender, System.Windows.SizeChangedEventArgs e ) : void
sender object Object where the event handler is attached
e System.Windows.SizeChangedEventArgs Event data
return void

SetAutomaticToolTipEnabled() public static method

Sets the current effective value of the AutomaticToolTipEnabled attached property.
public static SetAutomaticToolTipEnabled ( DependencyObject element, bool value ) : void
element System.Windows.DependencyObject
value bool true to enable the automatic ToolTip; otherwise false
return void

Property Details

AutomaticToolTipEnabledProperty public_oe static_oe property

Identifier associated with the attached property AutomaticToolTipEnabled.
public static DependencyProperty,System.Windows AutomaticToolTipEnabledProperty
return System.Windows.DependencyProperty

IsTextTrimmedKey public_oe static_oe property

Key returned upon registering the read-only attached property IsTextTrimmed.
public static DependencyPropertyKey,System.Windows IsTextTrimmedKey
return System.Windows.DependencyPropertyKey

IsTextTrimmedProperty public_oe static_oe property

Identifier associated with the read-only attached property IsTextTrimmed.
public static DependencyProperty,System.Windows IsTextTrimmedProperty
return System.Windows.DependencyProperty