-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml.cs
73 lines (65 loc) · 2.34 KB
/
MainWindow.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
using ReinstallSys.Data.Model;
using ReinstallSys.Service.Data;
using ReinstallSys.Tools;
using ReinstallSys.UserController;
using ReinstallSys.ViewModel.Main;
using System.Net;
using System.Windows;
using System.Windows.Controls;
namespace ReinstallSys
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window
{
private MainWindowViewModel vm;
public MainWindow()
{
InitializeComponent();
vm = new MainWindowViewModel();
DataContext = vm;
myStepBar.StepBar.StepChanged += StepBar_StepChanged;
}
private void StepBar_StepChanged(object sender, HandyControl.Data.FunctionEventArgs<int> e)
{
mainContent.Children.Clear();
foreach (StepBarModel item in myStepBar.StepBar.Items)
{
if (item.Header == (myStepBar.StepBar.StepIndex + 1).ToString())
{
if (item.Description == "部署前准备")
{
var n = new BeforeDeployment();
n.SC.TextChanged += SC_TextChanged;
mainContent.Children.Add(n);
}
else if (item.Description == "打印机安装")
{
//mainContent.Children.Add(new PrinterInstall());
mainContent.Children.Add(new PrinterRootInstall());
}
else if (item.Description == "软件安装")
{
mainContent.Children.Add(new SoftwareInstall());
}
else if (item.Description == "Office安装")
{
mainContent.Children.Add(new OfficeInstall());
}
else if (item.Description == "系统及Office激活")
{
mainContent.Children.Add(new Activator());
}
}
}
}
private void SC_TextChanged(object sender, TextChangedEventArgs e)
{
if ((sender as TextBox).Text == "即将进入下一步")
{
myStepBar.StepBar.Next();
}
}
}
}