Skip to content

Commit

Permalink
move tooltip parsing to a converter
Browse files Browse the repository at this point in the history
  • Loading branch information
foglio1024 committed May 20, 2024
1 parent 3bad2ab commit 81fe4e1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions TCC.Core/UI/Converters/TooltipTextConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;
using TCC.UI.Controls.Abnormalities;

namespace TCC.UI.Converters;

public class TooltipTextConverter : MarkupExtension, IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is string tt) return new TooltipParser(tt).Parse();
return null;
}

public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
return null;
}

public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}

0 comments on commit 81fe4e1

Please sign in to comment.