質問編集履歴
2
情報量の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,26 +8,56 @@
|
|
8
8
|
|
9
9
|
```
|
10
10
|
|
11
|
-
|
11
|
+
//some_project.xaml
|
12
12
|
|
13
|
-
|
13
|
+
<UserControl:ToggleSwitch x:Name="SomeControl" Checked="ToggleSwitch_Checked"/>
|
14
14
|
|
15
|
-
|
15
|
+
<MediaElement x:Name="LoadingIcon"/>
|
16
16
|
|
17
|
-
process.StartInfo.FileName = "cmd";
|
18
17
|
|
19
|
-
process.StartInfo.Arguments = string.Format("/c \"{0} < {1}\"", @"test.exe", test_input_file_path);
|
20
18
|
|
21
|
-
proc
|
19
|
+
//some_project.xaml.cs
|
22
20
|
|
23
|
-
pr
|
21
|
+
private void LoadingStart(){
|
24
22
|
|
25
|
-
|
23
|
+
//LoadingIconの開始処理
|
26
24
|
|
27
|
-
|
25
|
+
}
|
28
26
|
|
29
|
-
};
|
30
27
|
|
28
|
+
|
29
|
+
private void LoadingFinish(){
|
30
|
+
|
31
|
+
//LoadingIconの終了処理
|
32
|
+
|
33
|
+
}
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
private void ToggleSwitch_Checked(object sender, RoutedEventArgs e){
|
38
|
+
|
39
|
+
var process = new Process()
|
40
|
+
|
41
|
+
Directory.SetCurrentDirectory(directory_path);
|
42
|
+
|
43
|
+
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
44
|
+
|
45
|
+
process.StartInfo.FileName = "cmd";
|
46
|
+
|
47
|
+
process.StartInfo.Arguments = string.Format("/c \"{0} < {1}\"", @"test.exe", test_input_file_path);
|
48
|
+
|
49
|
+
process.EnableRaisingEvents = true;
|
50
|
+
|
51
|
+
process.Exited += (sender, e) =>
|
52
|
+
|
53
|
+
{
|
54
|
+
|
55
|
+
SomeControl.IsChecked = false;
|
56
|
+
|
57
|
+
};
|
58
|
+
|
31
|
-
process.Start();
|
59
|
+
process.Start();
|
60
|
+
|
61
|
+
}
|
32
62
|
|
33
63
|
```
|
1
コードのマークアップ修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -5,6 +5,8 @@
|
|
5
5
|
Formではなく、WPFだと、上手く動かないように思います。Dispatcherとかが関係しているのでしょうか。不勉強なところ、大変恐縮ですが、ご教示頂けますと幸いです。
|
6
6
|
|
7
7
|
|
8
|
+
|
9
|
+
```
|
8
10
|
|
9
11
|
var process = new Process()
|
10
12
|
|
@@ -27,3 +29,5 @@
|
|
27
29
|
};
|
28
30
|
|
29
31
|
process.Start();
|
32
|
+
|
33
|
+
```
|