Vereinsmeisterschaften  22aa7800eae54b428d40e835886cefe1fdefdfdf
This is a software that can be used to manage the internal competition of the swimming club Illertissen called "Vereinsmeisterschaften".
Loading...
Searching...
No Matches
DoubleProgressDialog.xaml.cs
2using CommunityToolkit.Mvvm.Input;
3using MahApps.Metro.Controls;
4using MahApps.Metro.Controls.Dialogs;
5
7{
11 public partial class DoubleProgressDialog : CustomDialog
12 {
13 public DoubleProgressDialog()
14 {
15 InitializeComponent();
16 }
17
18 public DoubleProgressDialog(MetroWindow parentWindow) : base(parentWindow)
19 {
20 InitializeComponent();
21 }
22
26 public string Message
27 {
28 get { return (string)GetValue(MessageProperty); }
29 set { SetValue(MessageProperty, value); }
30 }
31 public static readonly DependencyProperty MessageProperty = DependencyProperty.Register(nameof(Message), typeof(string), typeof(DoubleProgressDialog), new PropertyMetadata(""));
32
36 public double Progress1
37 {
38 get { return (double)GetValue(Progress1Property); }
39 set { SetValue(Progress1Property, value); }
40 }
41 public static readonly DependencyProperty Progress1Property = DependencyProperty.Register(nameof(Progress1), typeof(double), typeof(DoubleProgressDialog), new PropertyMetadata(0.0));
42
47 {
48 get { return (string)GetValue(ProgressDescription1Property); }
49 set { SetValue(ProgressDescription1Property, value); }
50 }
51 public static readonly DependencyProperty ProgressDescription1Property = DependencyProperty.Register(nameof(ProgressDescription1), typeof(string), typeof(DoubleProgressDialog), new PropertyMetadata(""));
52
56 public double Progress2
57 {
58 get { return (double)GetValue(Progress2Property); }
59 set { SetValue(Progress2Property, value); }
60 }
61 public static readonly DependencyProperty Progress2Property = DependencyProperty.Register(nameof(Progress2), typeof(double), typeof(DoubleProgressDialog), new PropertyMetadata(0.0));
62
67 {
68 get { return (string)GetValue(ProgressDescription2Property); }
69 set { SetValue(ProgressDescription2Property, value); }
70 }
71 public static readonly DependencyProperty ProgressDescription2Property = DependencyProperty.Register(nameof(ProgressDescription2), typeof(string), typeof(DoubleProgressDialog), new PropertyMetadata(""));
72
77 {
78 get { return (int)GetValue(ProgressNumberDecimalsProperty); }
79 set { SetValue(ProgressNumberDecimalsProperty, value); }
80 }
81 public static readonly DependencyProperty ProgressNumberDecimalsProperty = DependencyProperty.Register(nameof(ProgressNumberDecimals), typeof(int), typeof(DoubleProgressDialog), new PropertyMetadata(1, OnProgressNumberDecimalsChanged));
82
83 private static void OnProgressNumberDecimalsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
84 {
86 if (dialog != null)
87 {
88 dialog.ProgressFormatString = $"{{0:F{dialog.ProgressNumberDecimals}}}%";
89 }
90 }
91
96 {
97 get { return (string)GetValue(ProgressFormatStringProperty); }
98 set { SetValue(ProgressFormatStringProperty, value); }
99 }
100 public static readonly DependencyProperty ProgressFormatStringProperty = DependencyProperty.Register(nameof(ProgressFormatString), typeof(string), typeof(DoubleProgressDialog), new PropertyMetadata("{0:F1}%"));
101
102
106 [ICommand]
107 public void Cancel()
108 {
109 OnCanceled?.Invoke(this, null);
110 }
111
115 public event EventHandler OnCanceled;
116
117 }
118}
Interaktionslogik für DoubleProgressDialog.xaml.
double Progress2
Progress in % (0..100) for the progress bar 2.
EventHandler OnCanceled
Event that is raised, when the user clicks the Cancel button.
double Progress1
Progress in % (0..100) for the progress bar 1.
int ProgressNumberDecimals
Number of decimal places used to display the progress.
string ProgressDescription2
Text describing the progress bar 2.
string ProgressFormatString
Format string used to display the progress.
void Cancel()
Command to raise the OnCanceled event via the Cancel button.
string ProgressDescription1
Text describing the progress bar 1.