16f905c8d7
- New SourceType.Countdown (Starting/BRB only, timer 1-60 min) and SourceType.WebSource (all scenes, URI) - Elements panel beneath Sources: per-element config with live preview, ✕ revert / ✓ applied indicator - Webcam border: hex color input + swatch picker, thickness 0-10 slider - Countdown: timer minutes slider (1-60, default 15), Web: URI text input - SourceTypeToVisibilityConverter for conditional panel visibility - Snapshot/revert mechanism in code-behind for live-preview cancel
22 lines
737 B
C#
22 lines
737 B
C#
using System.Globalization;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
using ytLive.Models;
|
|
|
|
namespace ytLive.Helpers;
|
|
|
|
public class SourceTypeToVisibilityConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value is not SourceType current || parameter is not string targetName)
|
|
return Visibility.Collapsed;
|
|
return Enum.TryParse<SourceType>(targetName, true, out var target) && current == target
|
|
? Visibility.Visible
|
|
: Visibility.Collapsed;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
=> throw new NotSupportedException();
|
|
}
|