質問編集履歴
3
インデント
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,69 +28,67 @@
|
|
28
28
|
|
29
29
|
```ここに言語を入力
|
30
30
|
|
31
|
-
|
31
|
+
private string listName0;
|
32
32
|
|
33
|
-
|
33
|
+
private string listName1;
|
34
34
|
|
35
35
|
|
36
36
|
|
37
|
-
|
37
|
+
public string ListName0
|
38
38
|
|
39
|
-
|
39
|
+
{
|
40
40
|
|
41
|
-
|
41
|
+
get { return listName0; }
|
42
42
|
|
43
|
-
|
43
|
+
set { SetProperty(ref listName0, value, "ListName0"); }
|
44
44
|
|
45
|
-
|
45
|
+
}
|
46
46
|
|
47
|
-
|
47
|
+
public string ListName1
|
48
48
|
|
49
|
-
|
49
|
+
{
|
50
50
|
|
51
|
-
|
51
|
+
get { return listName1; }
|
52
52
|
|
53
|
-
|
53
|
+
set { SetProperty(ref listName1, value, "ListName1"); }
|
54
54
|
|
55
|
-
|
55
|
+
}
|
56
56
|
|
57
57
|
|
58
58
|
|
59
59
|
|
60
60
|
|
61
|
-
|
61
|
+
public virtual bool SetProperty<T>(ref T target, T value, string name)
|
62
62
|
|
63
|
-
|
63
|
+
{
|
64
64
|
|
65
|
-
|
65
|
+
if (target == null)
|
66
66
|
|
67
|
-
|
67
|
+
{
|
68
68
|
|
69
|
-
|
69
|
+
if (value == null)
|
70
70
|
|
71
|
-
|
71
|
+
return false;
|
72
72
|
|
73
|
-
|
73
|
+
}
|
74
74
|
|
75
|
-
|
75
|
+
else
|
76
76
|
|
77
|
-
|
77
|
+
{
|
78
78
|
|
79
|
-
|
79
|
+
if (target.Equals(value))
|
80
80
|
|
81
|
-
|
81
|
+
return false;
|
82
82
|
|
83
|
-
|
83
|
+
}
|
84
84
|
|
85
|
+
target = value;
|
85
86
|
|
87
|
+
RaisePropertyChanged(name);
|
86
88
|
|
87
|
-
|
89
|
+
return true;
|
88
90
|
|
89
|
-
RaisePropertyChanged(name);
|
90
|
-
|
91
|
-
return true;
|
92
|
-
|
93
|
-
|
91
|
+
}
|
94
92
|
|
95
93
|
|
96
94
|
|
@@ -124,13 +122,13 @@
|
|
124
122
|
|
125
123
|
```ここに言語を入力
|
126
124
|
|
127
|
-
|
125
|
+
Binding textNamebinding = new Binding();
|
128
126
|
|
129
|
-
|
127
|
+
string name = "ListName" + (ikoumokuNo).ToString();
|
130
128
|
|
131
|
-
|
129
|
+
textNamebinding.Path = new PropertyPath(name);
|
132
130
|
|
133
|
-
|
131
|
+
BindingOperations.SetBinding(labelns[iLabelNo], Label.ContentProperty, textNamebinding);
|
134
132
|
|
135
133
|
```
|
136
134
|
|
2
インデント
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,9 +28,9 @@
|
|
28
28
|
|
29
29
|
```ここに言語を入力
|
30
30
|
|
31
|
-
private string listName0;
|
31
|
+
private string listName0;
|
32
32
|
|
33
|
-
private string listName1;
|
33
|
+
private string listName1;
|
34
34
|
|
35
35
|
|
36
36
|
|
1
タグ </> ボタン
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,7 +26,9 @@
|
|
26
26
|
|
27
27
|
以下
|
28
28
|
|
29
|
+
```ここに言語を入力
|
30
|
+
|
29
|
-
|
31
|
+
private string listName0;
|
30
32
|
|
31
33
|
private string listName1;
|
32
34
|
|
@@ -92,7 +94,11 @@
|
|
92
94
|
|
93
95
|
|
94
96
|
|
97
|
+
```
|
98
|
+
|
95
99
|
最終的にINotifyPropertyChanged を継承したクラスでView側にBindingさせる。
|
100
|
+
|
101
|
+
```ここに言語を入力
|
96
102
|
|
97
103
|
protected virtual void RaisePropertyChanged(string name)
|
98
104
|
|
@@ -108,11 +114,15 @@
|
|
108
114
|
|
109
115
|
|
110
116
|
|
117
|
+
```
|
118
|
+
|
111
119
|
|
112
120
|
|
113
121
|
View側ソース
|
114
122
|
|
115
123
|
loadイベントで実行するのコード
|
124
|
+
|
125
|
+
```ここに言語を入力
|
116
126
|
|
117
127
|
Binding textNamebinding = new Binding();
|
118
128
|
|
@@ -121,6 +131,8 @@
|
|
121
131
|
textNamebinding.Path = new PropertyPath(name);
|
122
132
|
|
123
133
|
BindingOperations.SetBinding(labelns[iLabelNo], Label.ContentProperty, textNamebinding);
|
134
|
+
|
135
|
+
```
|
124
136
|
|
125
137
|
ikoumokuNoの変数でBindingする変数を特定させている。
|
126
138
|
|