ViewModels: Use partial properties
This commit is contained in:
@@ -9,87 +9,87 @@ namespace Elwig.ViewModels {
|
||||
public partial class PaymentVariantsViewModel : ObservableObject {
|
||||
|
||||
[ObservableProperty]
|
||||
private PaymentVar? _selectedPaymentVariant;
|
||||
public partial PaymentVar? SelectedPaymentVariant { get; set; }
|
||||
[ObservableProperty]
|
||||
private IEnumerable<PaymentVar> _paymentVariants = [];
|
||||
public partial IEnumerable<PaymentVar> PaymentVariants { get; set; } = [];
|
||||
|
||||
public BillingData? BillingData;
|
||||
public bool SeasonLocked = false; // never locked
|
||||
public bool WeightModifierChanged;
|
||||
public BillingData? BillingData { get; set; }
|
||||
public bool SeasonLocked { get; set; } = false; // never locked
|
||||
public bool WeightModifierChanged { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string _name = "";
|
||||
public partial string Name { get; set; } = "";
|
||||
[ObservableProperty]
|
||||
private string _comment = "";
|
||||
public partial string Comment { get; set; } = "";
|
||||
[ObservableProperty]
|
||||
private string _dateString = "";
|
||||
public partial string DateString { get; set; } = "";
|
||||
public DateOnly? Date {
|
||||
get => DateOnly.TryParseExact(DateString, "dd.MM.yyyy", out var d) ? d : null;
|
||||
set => DateString = $"{value:dd.MM.yyyy}";
|
||||
}
|
||||
[ObservableProperty]
|
||||
private string _transferDateString = "";
|
||||
public partial string TransferDateString { get; set; } = "";
|
||||
public DateOnly? TransferDate {
|
||||
get => DateOnly.TryParseExact(TransferDateString, "dd.MM.yyyy", out var d) ? d : null;
|
||||
set => TransferDateString = $"{value:dd.MM.yyyy}";
|
||||
}
|
||||
[ObservableProperty]
|
||||
private string _weightModifierString = "";
|
||||
public partial string WeightModifierString { get; set; } = "";
|
||||
public double? WeightModifier {
|
||||
get => double.TryParse(WeightModifierString, out var d) ? d : null;
|
||||
set => WeightModifierString = $"{value}";
|
||||
}
|
||||
[ObservableProperty]
|
||||
private string _data = "";
|
||||
public partial string Data { get; set; } = "";
|
||||
[ObservableProperty]
|
||||
private bool _considerModifiers;
|
||||
public partial bool ConsiderModifiers { get; set; }
|
||||
[ObservableProperty]
|
||||
private bool _considerPenalties;
|
||||
public partial bool ConsiderPenalties { get; set; }
|
||||
[ObservableProperty]
|
||||
private bool _considerPenalty;
|
||||
public partial bool ConsiderPenalty { get; set; }
|
||||
[ObservableProperty]
|
||||
private bool _considerAuto;
|
||||
public partial bool ConsiderAuto { get; set; }
|
||||
[ObservableProperty]
|
||||
private bool _considerCustom;
|
||||
public partial bool ConsiderCustom { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _isPaymentVariantSelected;
|
||||
public partial bool IsPaymentVariantSelected { get; set; }
|
||||
[ObservableProperty]
|
||||
private bool _isReadOnly = true;
|
||||
public partial bool IsReadOnly { get; set; } = true;
|
||||
[ObservableProperty]
|
||||
private bool _dataIsReadOnly = true;
|
||||
public partial bool DataIsReadOnly { get; set; } = true;
|
||||
[ObservableProperty]
|
||||
private bool _isEnabled = false;
|
||||
public partial bool IsEnabled { get; set; } = false;
|
||||
[ObservableProperty]
|
||||
private bool _saveIsEnabled = false;
|
||||
public partial bool SaveIsEnabled { get; set; } = false;
|
||||
[ObservableProperty]
|
||||
private bool _deleteIsEnabled = false;
|
||||
public partial bool DeleteIsEnabled { get; set; } = false;
|
||||
[ObservableProperty]
|
||||
private bool _calculateIsEnabled = false;
|
||||
public partial bool CalculateIsEnabled { get; set; } = false;
|
||||
[ObservableProperty]
|
||||
private bool _exportIsEnabled = false;
|
||||
public partial bool ExportIsEnabled { get; set; } = false;
|
||||
[ObservableProperty]
|
||||
private bool _commitIsEnabled = false;
|
||||
public partial bool CommitIsEnabled { get; set; } = false;
|
||||
[ObservableProperty]
|
||||
private Visibility _commitVisibility = Visibility.Visible;
|
||||
public partial Visibility CommitVisibility { get; set; } = Visibility.Visible;
|
||||
[ObservableProperty]
|
||||
private bool _revertIsEnabled = false;
|
||||
public partial bool RevertIsEnabled { get; set; } = false;
|
||||
[ObservableProperty]
|
||||
private Visibility _revertVisibility = Visibility.Hidden;
|
||||
public partial Visibility RevertVisibility { get; set; } = Visibility.Hidden;
|
||||
[ObservableProperty]
|
||||
private string _arrow = "\xF0AF";
|
||||
public partial string Arrow { get; set; } = "\xF0AF";
|
||||
[ObservableProperty]
|
||||
private string _editText = "Bearbeiten";
|
||||
public partial string EditText { get; set; } = "Bearbeiten";
|
||||
|
||||
[ObservableProperty]
|
||||
private string _statusModifierSum = "-";
|
||||
public partial string StatusModifierSum { get; set; } = "-";
|
||||
[ObservableProperty]
|
||||
private string _statusTotalSum = "-";
|
||||
public partial string StatusTotalSum { get; set; } = "-";
|
||||
[ObservableProperty]
|
||||
private string _statusVatSum = "-";
|
||||
public partial string StatusVatSum { get; set; } = "-";
|
||||
[ObservableProperty]
|
||||
private string _statusDeductionSum = "-";
|
||||
public partial string StatusDeductionSum { get; set; } = "-";
|
||||
[ObservableProperty]
|
||||
private string _statusPaymentSum = "-";
|
||||
public partial string StatusPaymentSum { get; set; } = "-";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user