Model the AlertBox and standalone ticker with shared settings; scene tickers render the in-memory active and queued events without saving history. Keep AlertBox content active-event-only. Ref: https://obsproject.com/kb/obs-studio-overview
32 lines
859 B
C#
32 lines
859 B
C#
using System.ComponentModel;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace ytLive.Models;
|
|
|
|
public sealed class Ticker : INotifyPropertyChanged
|
|
{
|
|
private bool _isEnabled = true;
|
|
private AlertDisplayMethod _displayMethod = AlertDisplayMethod.TickerScroll;
|
|
|
|
public bool IsEnabled
|
|
{
|
|
get => _isEnabled;
|
|
set => Set(ref _isEnabled, value);
|
|
}
|
|
|
|
public AlertDisplayMethod DisplayMethod
|
|
{
|
|
get => _displayMethod;
|
|
set => Set(ref _displayMethod, value);
|
|
}
|
|
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
private void Set<T>(ref T field, T value, [CallerMemberName] string? propertyName = null)
|
|
{
|
|
if (EqualityComparer<T>.Default.Equals(field, value)) return;
|
|
field = value;
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
}
|