ownChat: Neues TimeStamp-Objekt wird unterstützt und der Chat funktioniert wieder.
78 lines
2.5 KiB
C#
78 lines
2.5 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Windows;
|
|
using BeWo.Annotations;
|
|
using BS.Shared.Extensions;
|
|
|
|
namespace BeWo.Scheduling.View
|
|
{
|
|
public partial class OccurrenceParticipationConfirmationView : INotifyPropertyChanged
|
|
{
|
|
public bool? ShouldChangeSeries { get; private set; }
|
|
|
|
private readonly string _Subject;
|
|
|
|
private readonly string _ParticipationAnswerString;
|
|
|
|
public Visibility CheckBoxVisibility { get; }
|
|
|
|
public string OkButtonText => $"Ganzer Serie {_ParticipationAnswerString}";
|
|
public string NoButtonText => $"Nur diesem Termin {_ParticipationAnswerString}";
|
|
|
|
public string DateText { get; }
|
|
public string InfoText => $"Der Termin '{_Subject}' am {DateText} ist Teil einer Serie. Möchten Sie der ganzen Serie {_ParticipationAnswerString} oder nur dem ausgewählten Termin?";
|
|
|
|
private bool _ApplyForAllOccurrences;
|
|
public bool ApplyForAllOccurrences
|
|
{
|
|
get => _ApplyForAllOccurrences;
|
|
set
|
|
{
|
|
if(_ApplyForAllOccurrences != value)
|
|
{
|
|
_ApplyForAllOccurrences = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
}
|
|
|
|
// ToDo: Datum und evtl. Uhrzeit einbauen?
|
|
public OccurrenceParticipationConfirmationView(string subject, string participationAnswerString, bool isCheckBoxVisible, DateTime start, DateTime end)
|
|
{
|
|
InitializeComponent();
|
|
|
|
DateText = start.GetDateString(end);
|
|
_Subject = subject;
|
|
_ParticipationAnswerString = participationAnswerString;
|
|
|
|
CheckBoxVisibility = isCheckBoxVisible ? Visibility.Visible : Visibility.Collapsed;
|
|
|
|
DataContext = this;
|
|
}
|
|
|
|
private void YesButton_OnClick(object sender, RoutedEventArgs e)
|
|
{
|
|
ShouldChangeSeries = false;
|
|
}
|
|
|
|
private void NoButton_OnClick(object sender, RoutedEventArgs e)
|
|
{
|
|
ShouldChangeSeries = true;
|
|
}
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
[NotifyPropertyChangedInvocator]
|
|
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
|
|
private void OccurrenceParticipationConfirmationView_OnLoaded(object sender, RoutedEventArgs e)
|
|
{
|
|
ShouldChangeSeries = null;
|
|
}
|
|
}
|
|
}
|