-
Notifications
You must be signed in to change notification settings - Fork 1
/
ControlsHeaderCheckBox.xaml.cs
149 lines (133 loc) · 4.98 KB
/
ControlsHeaderCheckBox.xaml.cs
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// Decompiled with JetBrains decompiler
// Type: Wave.Controls.HeaderCheckBox
// Assembly: Wave, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 33553988-2CCE-4180-BC86-D1681DD7B18E
// Assembly location: D:\e\shadow\WaveTrial\Wave.exe
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Shapes;
using Wave.Classes.Cosmetic;
#nullable disable
namespace Wave.Controls
{
public partial class HeaderCheckBox : UserControl, IComponentConnector
{
public static readonly DependencyProperty CanToggleProperty = DependencyProperty.Register(nameof (CanToggle), typeof (bool), typeof (HeaderCheckBox), new PropertyMetadata((object) true));
public static readonly DependencyProperty EnabledProperty = DependencyProperty.Register(nameof (Enabled), typeof (bool), typeof (HeaderCheckBox), new PropertyMetadata((object) false));
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(nameof (Title), typeof (string), typeof (HeaderCheckBox), new PropertyMetadata((object) "Untitled.lua"));
public static readonly DependencyProperty BackgroundSelectedProperty = DependencyProperty.Register(nameof (BackgroundSelected), typeof (Brush), typeof (HeaderCheckBox), new PropertyMetadata((object) new SolidColorBrush(Color.FromRgb((byte) 29, (byte) 29, (byte) 30))));
internal HeaderCheckBox HeaderCheckBoxControl;
internal Grid MainGrid;
internal Rectangle Highlight;
internal Label ContentLabel;
internal Button CloseButton;
private bool _contentLoaded;
public bool CanToggle
{
get => (bool) this.GetValue(HeaderCheckBox.CanToggleProperty);
set => this.SetValue(HeaderCheckBox.CanToggleProperty, (object) value);
}
public bool Enabled
{
get => (bool) this.GetValue(HeaderCheckBox.EnabledProperty);
set
{
if (!this.CanToggle)
return;
this.SetValue(HeaderCheckBox.EnabledProperty, (object) value);
if (value)
this.OnEnabled((object) this, new EventArgs());
else
this.OnDisabled((object) this, new EventArgs());
}
}
public string Title
{
get => (string) this.GetValue(HeaderCheckBox.TitleProperty);
set => this.SetValue(HeaderCheckBox.TitleProperty, (object) value);
}
public Brush BackgroundSelected
{
get => (Brush) this.GetValue(HeaderCheckBox.BackgroundSelectedProperty);
set => this.SetValue(HeaderCheckBox.BackgroundSelectedProperty, (object) value);
}
public event EventHandler OnEnabled;
public event EventHandler OnDisabled;
public event EventHandler OnCloseClick;
public HeaderCheckBox()
{
this.InitializeComponent();
this.OnEnabled += new EventHandler(this.TabButton_OnEnabled);
this.OnDisabled += new EventHandler(this.TabButton_OnDisabled);
}
private void TabButton_OnEnabled(object sender, EventArgs e)
{
Animation.Animate(new AnimationPropertyBase((object) this.Highlight)
{
Property = (object) UIElement.OpacityProperty,
To = (object) 1
});
}
private void TabButton_OnDisabled(object sender, EventArgs e)
{
Animation.Animate(new AnimationPropertyBase((object) this.Highlight)
{
Property = (object) UIElement.OpacityProperty,
To = (object) 0
});
}
private void MainGrid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
this.Enabled = !this.Enabled;
}
private void CloseButton_Click(object sender, RoutedEventArgs e)
{
this.OnCloseClick(sender, (EventArgs) e);
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent()
{
if (this._contentLoaded)
return;
this._contentLoaded = true;
Application.LoadComponent((object) this, new Uri("/Wave;component/controls/headercheckbox.xaml", UriKind.Relative));
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
void IComponentConnector.Connect(int connectionId, object target)
{
switch (connectionId)
{
case 1:
this.HeaderCheckBoxControl = (HeaderCheckBox) target;
break;
case 2:
this.MainGrid = (Grid) target;
this.MainGrid.MouseLeftButtonDown += new MouseButtonEventHandler(this.MainGrid_MouseLeftButtonDown);
break;
case 3:
this.Highlight = (Rectangle) target;
break;
case 4:
this.ContentLabel = (Label) target;
break;
case 5:
this.CloseButton = (Button) target;
this.CloseButton.Click += new RoutedEventHandler(this.CloseButton_Click);
break;
default:
this._contentLoaded = true;
break;
}
}
}
}