mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-12-26 20:26:00 +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;
|
|
}
|
|
}
|