Add marquee for truncated ticket overview headings
This commit is contained in:
@@ -10,6 +10,7 @@ using System.Windows.Threading;
|
||||
|
||||
using C4IT.FASD.Cockpit.Communication;
|
||||
using C4IT.Logging;
|
||||
using FasdDesktopUi.Basics;
|
||||
using FasdDesktopUi.Basics.Models;
|
||||
using FasdDesktopUi.Basics.Services;
|
||||
using FasdDesktopUi.Basics.Services.Models;
|
||||
@@ -187,6 +188,41 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Row Heading Ticker
|
||||
|
||||
private void RowHeading_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (!TryGetRowHeadingTickerParts(sender, out var textBlock, out var container))
|
||||
return;
|
||||
|
||||
cUtility.SetTickerTextAnimation(textBlock, container);
|
||||
}
|
||||
|
||||
private void RowHeading_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (!TryGetRowHeadingTickerParts(sender, out var textBlock, out var container))
|
||||
return;
|
||||
|
||||
textBlock.TextTrimming = TextTrimming.CharacterEllipsis;
|
||||
textBlock.BeginAnimation(MarginProperty, null);
|
||||
container.ClearValue(WidthProperty);
|
||||
}
|
||||
|
||||
private static bool TryGetRowHeadingTickerParts(object sender, out TextBlock textBlock, out Border container)
|
||||
{
|
||||
textBlock = null;
|
||||
container = null;
|
||||
|
||||
if (!(sender is Label label) || label.Template == null)
|
||||
return false;
|
||||
|
||||
textBlock = label.Template.FindName("PART_TickerText", label) as TextBlock;
|
||||
container = label.Template.FindName("PART_TickerContainer", label) as Border;
|
||||
return textBlock != null && container != null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
private async void TicketOverview_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user