BililiveRecorder/BililiveRecorder.WPF/Converters/NullValueTemplateSelector.cs

14 lines
413 B
C#
Raw Normal View History

2020-11-27 18:51:02 +08:00
using System.Windows;
using System.Windows.Controls;
namespace BililiveRecorder.WPF.Converters
{
internal class NullValueTemplateSelector : DataTemplateSelector
{
public DataTemplate Normal { get; set; }
public DataTemplate Null { get; set; }
2021-01-01 14:46:27 +08:00
public override DataTemplate SelectTemplate(object item, DependencyObject container) => item is null ? this.Null : this.Normal;
2020-11-27 18:51:02 +08:00
}
}