EPG-Grid: Tooltip mit TextWrapping und 30s ShowDuration
This commit is contained in:
parent
362050820b
commit
c1e832e08d
1 changed files with 8 additions and 2 deletions
|
|
@ -993,11 +993,17 @@ public partial class MainWindow : Window
|
||||||
BorderBrush = new System.Windows.Media.SolidColorBrush(borderColor),
|
BorderBrush = new System.Windows.Media.SolidColorBrush(borderColor),
|
||||||
BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3),
|
BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3),
|
||||||
Cursor = Cursors.Hand,
|
Cursor = Cursors.Hand,
|
||||||
ToolTip = $"{ev.StartTime:HH:mm}–{ev.EndTime:HH:mm}\n{ev.Title}" +
|
|
||||||
(string.IsNullOrWhiteSpace(ev.Description) ? "" : $"\n\n{ev.Description}"),
|
|
||||||
Tag = ch, Child = content
|
Tag = ch, Child = content
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Tooltip mit Zeilenumbruch und Beschreibung
|
||||||
|
var ttText = $"{ev.StartTime:HH:mm}\u2013{ev.EndTime:HH:mm} {ev.Title}";
|
||||||
|
if (!string.IsNullOrWhiteSpace(ev.Description))
|
||||||
|
ttText += $"\n\n{ev.Description}";
|
||||||
|
var tt = new ToolTip { MaxWidth = 420, Content = new TextBlock { Text = ttText, TextWrapping = TextWrapping.Wrap, FontSize = 12 } };
|
||||||
|
ToolTipService.SetShowDuration(box, 30000);
|
||||||
|
box.ToolTip = tt;
|
||||||
|
|
||||||
box.MouseEnter += (_, _) => box.Background = new System.Windows.Media.SolidColorBrush(
|
box.MouseEnter += (_, _) => box.Background = new System.Windows.Media.SolidColorBrush(
|
||||||
isCurrent ? System.Windows.Media.Color.FromRgb(0xB8, 0x21, 0x3A)
|
isCurrent ? System.Windows.Media.Color.FromRgb(0xB8, 0x21, 0x3A)
|
||||||
: System.Windows.Media.Color.FromRgb(0x36, 0x36, 0x36));
|
: System.Windows.Media.Color.FromRgb(0x36, 0x36, 0x36));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue