-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpiderWindow.xaml.cs
36 lines (27 loc) · 1.04 KB
/
SpiderWindow.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
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;
using IWin32Window = System.Windows.Forms.IWin32Window;
namespace LarchSys.Bot {
public partial class SpiderWindow : Window, IWin32Window {
public Spider Spider { get; set; }
public SpiderWindow(Spider spider)
{
InitializeComponent();
spider.Window = this;
DataContext = Spider = spider;
Title = Spider.Title;
LogoPanel.Children.Add(Spider.Logo);
BtnSearch.Click += async (s, e) => await Spider.Search();
BtnExport.Click += async (s, e) => await Spider.Export();
BtnReset.Click += async (s, e) => await Spider.Reset();
BtnCancel.Click += async (s, e) => await Spider.Cancel();
TxbSearch.KeyDown += async (s, e) => {
if (e.Key == Key.Enter) await Spider.Search();
};
Spider.Clear();
}
public IntPtr Handle => new WindowInteropHelper(this).Owner;
}
}