Добавлен example
This commit is contained in:
27
Lattice.Example.DragDrop/PriorityToTextConverter.cs
Normal file
27
Lattice.Example.DragDrop/PriorityToTextConverter.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using System;
|
||||
|
||||
namespace Lattice.Example.DragDrop;
|
||||
|
||||
public class PriorityToTextConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
if (value is int priority)
|
||||
{
|
||||
return priority switch
|
||||
{
|
||||
1 => "🔥 High",
|
||||
2 => "⚠️ Medium",
|
||||
3 => "📋 Low",
|
||||
_ => $"Priority {priority}"
|
||||
};
|
||||
}
|
||||
return "Normal";
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user