mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-16 03:32:20 +08:00
15 lines
433 B
C#
15 lines
433 B
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
#nullable enable
|
|
namespace BililiveRecorder.WPF.Converters
|
|
{
|
|
internal class NullValueTemplateSelector : DataTemplateSelector
|
|
{
|
|
public DataTemplate? Normal { get; set; }
|
|
public DataTemplate? Null { get; set; }
|
|
|
|
public override DataTemplate? SelectTemplate(object item, DependencyObject container) => item is null ? this.Null : this.Normal;
|
|
}
|
|
}
|