TeamsNetphoneLink/TeamsNetphoneLinkWPF/WPF/MVVM/FinishPanelViewModel.cs
2025-03-25 22:43:13 +01:00

94 lines
2.8 KiB
C#

using Emoji.Wpf;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Media;
using System.Windows.Media.Effects;
using System.Windows.Threading;
namespace TeamsNetphoneLink.WPF.MVVM
{
public class FinishPanelViewModel : INotifyPropertyChanged
{
// Parameterloser Konstruktor
public FinishPanelViewModel()
{
// Initialisieren Sie hier Standardwerte, falls erforderlich
FinishPanelEnabled = false;
FinishPanelFinishTextColor = new SolidColorBrush(Colors.DarkOrange);
FinishPanelFinishTextText = "Authentifizierung ausstehend...";
FinishPanelEffect = new TintEffect { Tint = Colors.DarkGray };
}
private bool _finishPanelEnabled;
private Brush _finishPanelFinishTextColor;
private string _finishPanelFinishTextText;
private Effect _finishPanelEffect;
public bool FinishPanelEnabled
{
get => _finishPanelEnabled;
set
{
System.Windows.Application.Current.Dispatcher.Invoke(delegate
{
_finishPanelEnabled = value;
OnPropertyChanged();
});
}
}
public Brush FinishPanelFinishTextColor
{
get => _finishPanelFinishTextColor;
set
{
System.Windows.Application.Current.Dispatcher.Invoke(delegate
{
_finishPanelFinishTextColor = value;
OnPropertyChanged();
});
}
}
public string FinishPanelFinishTextText
{
get => _finishPanelFinishTextText;
set
{
System.Windows.Application.Current.Dispatcher.Invoke(delegate
{
_finishPanelFinishTextText = value;
OnPropertyChanged();
});
}
}
public Effect FinishPanelEffect
{
get => _finishPanelEffect;
set
{
System.Windows.Application.Current.Dispatcher.Invoke(delegate
{
_finishPanelEffect = value;
OnPropertyChanged();
});
}
}
public void SetFinishPanelFinishTextColor(Color color)
{
System.Windows.Application.Current.Dispatcher.Invoke(delegate
{
FinishPanelFinishTextColor = new SolidColorBrush((Color)color);
});
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}