21 lines
818 B
C#
21 lines
818 B
C#
using System.Globalization;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
|
|
namespace ytLive.Helpers;
|
|
|
|
/// <summary>
|
|
/// Maps bool → Visibility, collapsing nothing: true becomes <c>Hidden</c> (keeps
|
|
/// its layout slot) rather than <c>Collapsed</c> (releases it). Used where a row
|
|
/// must keep its column grid aligned — e.g. the Backdrop source's missing
|
|
/// trashcan must not shift the edit/eye icons one slot to the right.
|
|
/// </summary>
|
|
public class HiddenBoolToVisibilityConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
=> value is true ? Visibility.Hidden : Visibility.Visible;
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
=> value is Visibility.Visible;
|
|
}
|