using System.Globalization; using System.Windows; using System.Windows.Data; namespace EngineeringSync.Setup.Converters; public class BoolToVisibilityConverter : IValueConverter { public object Convert(object v, Type t, object p, CultureInfo c) => v is true ? Visibility.Visible : Visibility.Collapsed; public object ConvertBack(object v, Type t, object p, CultureInfo c) => throw new NotSupportedException(); } public class BoolToInverseVisibilityConverter : IValueConverter { public object Convert(object v, Type t, object p, CultureInfo c) => v is true ? Visibility.Collapsed : Visibility.Visible; public object ConvertBack(object v, Type t, object p, CultureInfo c) => throw new NotSupportedException(); } /// /// Gibt "Jetzt installieren" wenn true (letzter normaler Schritt), sonst "Weiter". /// public class LastStepLabelConverter : IValueConverter { public object Convert(object v, Type t, object p, CultureInfo c) => v is true ? "Jetzt installieren" : "Weiter"; public object ConvertBack(object v, Type t, object p, CultureInfo c) => throw new NotSupportedException(); } public class StringToVisibilityConverter : IValueConverter { public object Convert(object v, Type t, object p, CultureInfo c) => string.IsNullOrEmpty(v as string) ? Visibility.Collapsed : Visibility.Visible; public object ConvertBack(object v, Type t, object p, CultureInfo c) => throw new NotSupportedException(); }