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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
|
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Shapes;
using System.Windows.Shell;
using System.Windows.Threading;
using Gestor.Application.Helpers;
using Gestor.Application.ViewModels.Financeiro;
using Gestor.Common.Validation;
using MaterialDesignThemes.Wpf;
namespace Gestor.Application.Views.Financeiro;
public class ExtratoWindow : Window, IComponentConnector
{
private enum MonitorOptions : uint
{
MonitorDefaulttoprimary = 1u,
MonitorDefaulttonearest
}
public struct Point
{
public int X;
public int Y;
public Point(int x, int y)
{
X = x;
Y = y;
}
}
private struct Minmaxinfo
{
private readonly MainWindow.Point ptReserved;
public Point ptMaxSize;
public Point ptMaxPosition;
private readonly MainWindow.Point ptMinTrackSize;
private readonly MainWindow.Point ptMaxTrackSize;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
private class Monitorinfo
{
private readonly int cbSize = Marshal.SizeOf(typeof(Monitorinfo));
public readonly Rect rcMonitor;
public readonly Rect rcWork;
private readonly int dwFlags;
}
public struct Rect
{
public int Left;
public int Top;
public int Right;
public int Bottom;
}
private bool _buttonClickable;
public ExtratoContaViewModel ViewModel;
internal WindowChrome WindowChrome;
internal Grid MinimizeButton;
internal Grid MaximizeButton;
internal Grid CloseButton;
internal ProgressBar ProgressRing;
internal ComboBox ContaBox;
internal DatePicker InicioBox;
internal DatePicker FimBox;
internal DataGrid LancamentoGrid;
internal TextBlock NaoHaDados;
internal Snackbar Snackbar;
private bool _contentLoaded;
private IntPtr WindowProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if (msg == 36)
{
WmGetMinMaxInfo(lParam);
}
return IntPtr.Zero;
}
private void WmGetMinMaxInfo(IntPtr lParam)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
((FrameworkElement)this).MaxHeight = Screen.FromHandle(new WindowInteropHelper((Window)(object)this).Handle).WorkingArea.Height;
GetCursorPos(out var lpPoint);
IntPtr hMonitor = MonitorFromPoint(new MainWindow.Point(0, 0), MonitorOptions.MonitorDefaulttoprimary);
Monitorinfo monitorinfo = new Monitorinfo();
if (GetMonitorInfo(hMonitor, monitorinfo))
{
IntPtr intPtr = MonitorFromPoint(lpPoint, MonitorOptions.MonitorDefaulttonearest);
Minmaxinfo structure = (Minmaxinfo)Marshal.PtrToStructure(lParam, typeof(Minmaxinfo));
if (hMonitor.Equals((object?)(nint)intPtr))
{
structure.ptMaxPosition.X = monitorinfo.rcWork.Left;
structure.ptMaxPosition.Y = monitorinfo.rcWork.Top;
structure.ptMaxSize.X = monitorinfo.rcWork.Right - monitorinfo.rcWork.Left;
structure.ptMaxSize.Y = monitorinfo.rcWork.Bottom - monitorinfo.rcWork.Top;
}
else
{
structure.ptMaxPosition.X = monitorinfo.rcMonitor.Left;
structure.ptMaxPosition.Y = monitorinfo.rcMonitor.Top;
structure.ptMaxSize.X = monitorinfo.rcMonitor.Right - monitorinfo.rcMonitor.Left;
structure.ptMaxSize.Y = monitorinfo.rcMonitor.Bottom - monitorinfo.rcMonitor.Top;
}
Marshal.StructureToPtr(structure, lParam, fDeleteOld: true);
}
}
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool GetCursorPos(out MainWindow.Point lpPoint);
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr MonitorFromPoint(MainWindow.Point pt, MonitorOptions dwFlags);
[DllImport("user32.dll")]
private static extern bool GetMonitorInfo(IntPtr hMonitor, Monitorinfo lpmi);
private void TopControls_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Expected O, but got Unknown
_buttonClickable = true;
((Panel)(Grid)sender).Background = (Brush)((((FrameworkElement)(Grid)sender).Name == "CloseButton") ? new SolidColorBrush(Colors.Red) : new SolidColorBrush(Colors.DimGray));
}
private void TopControls_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
if (_buttonClickable)
{
((object)this).GetType().GetMethod(((FrameworkElement)(Grid)sender).Name + "_Click")?.Invoke(this, null);
}
}
private static void TopControls_OnMouseEnter(object sender, MouseEventArgs e)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Expected O, but got Unknown
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Expected O, but got Unknown
((Panel)(Grid)sender).Background = (Brush)((((FrameworkElement)(Grid)sender).Name == "CloseButton") ? new SolidColorBrush(Colors.IndianRed) : new SolidColorBrush(Colors.Gray));
DependencyObject child = VisualTreeHelper.GetChild((DependencyObject)(Grid)sender, 0);
Path val = (Path)(object)((child is Path) ? child : null);
if (val != null)
{
((Shape)val).Stroke = (Brush)new SolidColorBrush(Colors.White);
}
}
private void TopControls_OnMouseLeave(object sender, MouseEventArgs e)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Expected O, but got Unknown
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Expected O, but got Unknown
_buttonClickable = false;
((Panel)(Grid)sender).Background = (Brush)new SolidColorBrush(Colors.Transparent);
DependencyObject child = VisualTreeHelper.GetChild((DependencyObject)(Grid)sender, 0);
Path val = (Path)(object)((child is Path) ? child : null);
if (val != null)
{
((Shape)val).Stroke = (Brush)new SolidColorBrush(Colors.White);
}
}
public void MinimizeButton_Click()
{
((Window)this).WindowState = (WindowState)1;
}
public void MaximizeButton_Click()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
((Window)this).WindowState = (WindowState)(((int)((Window)this).WindowState == 0) ? 2 : 0);
}
public void CloseButton_Click()
{
((Window)this).Close();
}
protected sealed override void OnStateChanged(EventArgs e)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Invalid comparison between Unknown and I4
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Invalid comparison between Unknown and I4
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Invalid comparison between Unknown and I4
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Invalid comparison between Unknown and I4
((Control)this).BorderThickness = new Thickness((double)(((int)((Window)this).WindowState != 2) ? 1 : 0));
WindowChrome.ResizeBorderThickness = new Thickness((double)(((int)((Window)this).WindowState != 2) ? 4 : 0));
WindowChrome.CaptionHeight = (((int)((Window)this).WindowState == 2) ? 33 : 30);
ViewModel.MaximizeRestore = (((int)((Window)this).WindowState == 2) ? Geometry.Parse((string)Application.Current.Resources[(object)"Restore"]) : Geometry.Parse((string)Application.Current.Resources[(object)"Maximize"]));
((Window)this).OnStateChanged(e);
}
public ExtratoWindow(long id = 0L)
{
ViewModel = new ExtratoContaViewModel(id);
((FrameworkElement)this).DataContext = ViewModel;
InitializeComponent();
Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
if (dispatcher != null)
{
dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
}
string text = ApplicationHelper.Versao.ToString();
ViewModel.Head = Recursos.Usuario.Nome + " - " + Recursos.Empresa.Nome + ", VOCÊ ESTÁ EM RELATÓRIOS DE CONTA CORRENTE | VERSÃO GESTOR " + text;
}
private void ContentLoad()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Expected O, but got Unknown
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Expected O, but got Unknown
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Expected O, but got Unknown
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Expected O, but got Unknown
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Expected O, but got Unknown
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Expected O, but got Unknown
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Expected O, but got Unknown
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Expected O, but got Unknown
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Expected O, but got Unknown
((UIElement)MinimizeButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter);
((UIElement)MinimizeButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave);
((UIElement)MaximizeButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter);
((UIElement)MaximizeButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave);
((UIElement)CloseButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter);
((UIElement)CloseButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave);
((UIElement)InicioBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(DatePicker_OnLostKeyboardFocus);
((UIElement)InicioBox).PreviewKeyDown += new KeyEventHandler(DatePicker_PreviewKeyDown);
InicioBox.SelectedDateChanged += Periodo_OnSelectedDateChanged;
((UIElement)FimBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(DatePicker_OnLostKeyboardFocus);
((UIElement)FimBox).PreviewKeyDown += new KeyEventHandler(DatePicker_PreviewKeyDown);
FimBox.SelectedDateChanged += Periodo_OnSelectedDateChanged;
}
private void Periodo_OnSelectedDateChanged(object sender, SelectionChangedEventArgs e)
{
ViewModel.LimparRelatorio();
}
private void Window_OnInitialized(object sender, EventArgs e)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Expected O, but got Unknown
WindowInteropHelper val = new WindowInteropHelper((Window)(object)this);
val.EnsureHandle();
HwndSource obj = HwndSource.FromHwnd(val.Handle);
if (obj != null)
{
obj.AddHook(new HwndSourceHook(WindowProc));
}
}
private void SnackbarMessage_ActionClick(object sender, RoutedEventArgs e)
{
Snackbar.IsActive = false;
}
public void ToggleSnackBar(string message, bool active = true)
{
((ContentControl)Snackbar.Message).Content = message;
Snackbar.IsActive = active;
if (active)
{
Task.Factory.StartNew(CloseSlackBar);
}
}
private void CloseSlackBar()
{
Thread.Sleep(3000);
Dispatcher dispatcher = ((DispatcherObject)App.ProgressRing).Dispatcher;
if (dispatcher != null)
{
dispatcher.BeginInvoke((DispatcherPriority)4, (Delegate)(Action)delegate
{
ToggleSnackBar("", active: false);
});
}
}
private void DatePicker_PreviewKeyDown(object sender, KeyEventArgs e)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Invalid comparison between Unknown and I4
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
if ((int)e.Key == 6)
{
((DatePicker)sender).Text = Funcoes.GetNetworkTime().Date.ToString("dd/MM/yyyy");
}
}
private void DatePicker_OnLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
DatePicker val = (DatePicker)sender;
val.Text = ValidationHelper.FormatDate(val.Text);
}
private async void GerarResultados_OnClick(object sender, RoutedEventArgs e)
{
if (ValidationHelper.ValidateDate(ValidationHelper.FormatDate(InicioBox.Text)))
{
InicioBox.SelectedDate = DateTime.Parse(ValidationHelper.FormatDate(InicioBox.Text));
}
if (ValidationHelper.ValidateDate(ValidationHelper.FormatDate(FimBox.Text)))
{
FimBox.SelectedDate = DateTime.Parse(ValidationHelper.FormatDate(FimBox.Text));
}
if (!InicioBox.SelectedDate.HasValue || !FimBox.SelectedDate.HasValue)
{
await ViewModel.ShowMessage("NECESSÁRIO PREENCHER O PERIODO INICIAL E FINAL PARA O FILTRO.");
return;
}
if (InicioBox.SelectedDate > FimBox.SelectedDate)
{
await ViewModel.ShowMessage("A DATA FINAL NÃO PODE SER MENOR QUE A DATA INICIAL DO FILTRO.");
return;
}
((UIElement)ProgressRing).Visibility = (Visibility)0;
ViewModel.IsEnabled = false;
await ViewModel.GerarRelatorio();
ViewModel.IsEnabled = true;
((UIElement)ProgressRing).Visibility = (Visibility)2;
}
private async void Imprimir_OnClick(object sender, RoutedEventArgs e)
{
await ViewModel.Print();
}
private async void ExportarExcel_OnClick(object sender, RoutedEventArgs e)
{
await ViewModel.GerarExcel();
}
private void DataAtual_OnDoubleClick(object sender, RoutedEventArgs e)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
((DatePicker)sender).SelectedDate = Funcoes.GetNetworkTime().Date;
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent()
{
if (!_contentLoaded)
{
_contentLoaded = true;
Uri uri = new Uri("/Gestor.Application;component/views/financeiro/extratowindow.xaml", UriKind.Relative);
Application.LoadComponent((object)this, uri);
}
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
internal Delegate _CreateDelegate(Type delegateType, string handler)
{
return Delegate.CreateDelegate(delegateType, this, handler);
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
void IComponentConnector.Connect(int connectionId, object target)
{
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Expected O, but got Unknown
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Expected O, but got Unknown
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Expected O, but got Unknown
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Expected O, but got Unknown
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Expected O, but got Unknown
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Expected O, but got Unknown
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Expected O, but got Unknown
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Expected O, but got Unknown
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Expected O, but got Unknown
//IL_0118: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Expected O, but got Unknown
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Expected O, but got Unknown
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_013c: Expected O, but got Unknown
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Expected O, but got Unknown
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_0160: Expected O, but got Unknown
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Expected O, but got Unknown
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Expected O, but got Unknown
//IL_0191: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Expected O, but got Unknown
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01b2: Expected O, but got Unknown
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: Expected O, but got Unknown
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Expected O, but got Unknown
//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_01fa: Expected O, but got Unknown
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Expected O, but got Unknown
//IL_020a: Unknown result type (might be due to invalid IL or missing references)
//IL_0214: Expected O, but got Unknown
//IL_0217: Unknown result type (might be due to invalid IL or missing references)
//IL_0221: Expected O, but got Unknown
//IL_0223: Unknown result type (might be due to invalid IL or missing references)
//IL_022f: Unknown result type (might be due to invalid IL or missing references)
//IL_0239: Expected O, but got Unknown
switch (connectionId)
{
case 1:
((FrameworkElement)(ExtratoWindow)target).Initialized += Window_OnInitialized;
break;
case 2:
WindowChrome = (WindowChrome)target;
break;
case 3:
MinimizeButton = (Grid)target;
((UIElement)MinimizeButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown);
((UIElement)MinimizeButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp);
break;
case 4:
MaximizeButton = (Grid)target;
((UIElement)MaximizeButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown);
((UIElement)MaximizeButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp);
break;
case 5:
CloseButton = (Grid)target;
((UIElement)CloseButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown);
((UIElement)CloseButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp);
break;
case 6:
ProgressRing = (ProgressBar)target;
break;
case 7:
ContaBox = (ComboBox)target;
break;
case 8:
InicioBox = (DatePicker)target;
((UIElement)InicioBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(DatePicker_OnLostKeyboardFocus);
((Control)InicioBox).MouseDoubleClick += new MouseButtonEventHandler(DataAtual_OnDoubleClick);
break;
case 9:
FimBox = (DatePicker)target;
((UIElement)FimBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(DatePicker_OnLostKeyboardFocus);
((Control)FimBox).MouseDoubleClick += new MouseButtonEventHandler(DataAtual_OnDoubleClick);
break;
case 10:
((MenuItem)target).Click += new RoutedEventHandler(GerarResultados_OnClick);
break;
case 11:
((MenuItem)target).Click += new RoutedEventHandler(Imprimir_OnClick);
break;
case 12:
((MenuItem)target).Click += new RoutedEventHandler(ExportarExcel_OnClick);
break;
case 13:
LancamentoGrid = (DataGrid)target;
break;
case 14:
NaoHaDados = (TextBlock)target;
break;
case 15:
Snackbar = (Snackbar)target;
break;
case 16:
((SnackbarMessage)target).ActionClick += new RoutedEventHandler(SnackbarMessage_ActionClick);
break;
default:
_contentLoaded = true;
break;
}
}
}
|