forked from mitch030504/ModAssistant-DRMFREE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOneClickStatus.xaml.cs
More file actions
71 lines (65 loc) · 1.94 KB
/
Copy pathOneClickStatus.xaml.cs
File metadata and controls
71 lines (65 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Windows;
using System.Windows.Data;
namespace ModAssistant
{
/// <summary>
/// Interaction logic for OneClickStatus.xaml
/// </summary>
public partial class OneClickStatus : Window
{
public static OneClickStatus Instance;
public string HistoryText
{
get
{
return HistoryTextBlock.Text;
}
set
{
Dispatcher.Invoke(new Action(() => { Instance.HistoryTextBlock.Text = value; }));
}
}
public string MainText
{
get
{
return MainTextBlock.Text;
}
set
{
Dispatcher.Invoke(new Action(() =>
{
Instance.MainTextBlock.Text = value;
Instance.HistoryTextBlock.Text = string.IsNullOrEmpty(MainText) ? $"{value}" : $"{value}\n{HistoryText}";
}));
}
}
public OneClickStatus()
{
InitializeComponent();
Instance = (App.OCIWindow == "No" && App.OCIWindow == "Notify") ? null : this;
}
public void StopRotation()
{
Ring.Style = null;
}
}
[ValueConversion(typeof(double), typeof(double))]
public class DivideDoubleByTwoConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (targetType != typeof(double))
{
throw new InvalidOperationException("The target must be a double");
}
double d = (double)value;
return ((double)d) / 2;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotSupportedException();
}
}
}