質問編集履歴

1

ソースをマークダウン形式で編集しました。

2017/07/13 11:55

投稿

kinkin334
kinkin334

スコア62

test CHANGED
File without changes
test CHANGED
@@ -22,165 +22,165 @@
22
22
 
23
23
  Xamlソース
24
24
 
25
- (略)
26
-
27
- ↓ ViewModel上のイベントバインドしたメソッドが実行される
28
-
29
- <i:Interaction.Triggers>
30
-
31
- <i:EventTrigger EventName="Loaded">
32
-
33
- <cmd:EventToCommand Command="{Binding PageMemberListLoadedCommand}" PassEventArgsToCommand="True" />
34
-
35
- </i:EventTrigger>
36
-
37
- </i:Interaction.Triggers>
38
-
39
- ↑ ViewModel上のイベントバインドしたメソッドが実行される
40
-
41
- (略)
42
-
43
- <DataGridTemplateColumn x:Name="ColName" Width="150">
44
-
45
- <DataGridTemplateColumn.Header>
46
-
47
- <Button x:Name="ColNameTitleButton"
48
-
49
- Content="名前"
50
-
51
- Style="{StaticResource TitleButton}"
52
-
53
- Width="150">
54
-
55
- ↓ ViewModel上のイベントバインドしたメソッドが実行されない
56
-
57
- <i:Interaction.Triggers>
58
-
59
- <i:EventTrigger EventName="Click">
60
-
61
- <cmd:EventToCommand Command="{Binding ButtonClickCommand}" PassEventArgsToCommand="True" />
62
-
63
- </i:EventTrigger>
64
-
65
- </i:Interaction.Triggers>
66
-
67
- ↑ ViewModel上のイベントバインドしたメソッドが実行されない
68
-
69
- </Button>
70
-
71
- </DataGridTemplateColumn.Header>
72
-
73
- <DataGridTemplateColumn.CellTemplate>
74
-
75
- <DataTemplate>
76
-
77
- <Button x:Name="btnName"
78
-
79
- HorizontalContentAlignment="Left"
80
-
81
- Style="{StaticResource CellButton}"
82
-
83
- Width="150">
84
-
85
- ↓ ViewModel上のイベントバインドしたメソッドが実行されない
86
-
87
- <i:Interaction.Triggers>
88
-
89
- <i:EventTrigger EventName="Click">
90
-
91
- <cmd:EventToCommand Command="{Binding ButtonClickCommand}" PassEventArgsToCommand="True" />
92
-
93
- </i:EventTrigger>
94
-
95
- </i:Interaction.Triggers>
96
-
97
- ↑ ViewModel上のイベントバインドしたメソッドが実行されない
98
-
99
- </Button>
100
-
101
- </DataTemplate>
102
-
103
- </DataGridTemplateColumn.CellTemplate>
104
-
105
- </DataGridTemplateColumn>
25
+ > (略)
26
+
27
+ > ↓ ViewModel上のイベントバインドしたメソッドが実行される
28
+
29
+ > <i:Interaction.Triggers>
30
+
31
+ > <i:EventTrigger EventName="Loaded">
32
+
33
+ > <cmd:EventToCommand Command="{Binding PageMemberListLoadedCommand}" PassEventArgsToCommand="True" />
34
+
35
+ > </i:EventTrigger>
36
+
37
+ > </i:Interaction.Triggers>
38
+
39
+ > ↑ ViewModel上のイベントバインドしたメソッドが実行される
40
+
41
+ >(略)
42
+
43
+ > <DataGridTemplateColumn x:Name="ColName" Width="150">
44
+
45
+ > <DataGridTemplateColumn.Header>
46
+
47
+ > <Button x:Name="ColNameTitleButton"
48
+
49
+ > Content="名前"
50
+
51
+ > Style="{StaticResource TitleButton}"
52
+
53
+ > Width="150">
54
+
55
+ > ↓ ViewModel上のイベントバインドしたメソッドが実行されない
56
+
57
+ > <i:Interaction.Triggers>
58
+
59
+ > <i:EventTrigger EventName="Click">
60
+
61
+ > <cmd:EventToCommand Command="{Binding ButtonClickCommand}" PassEventArgsToCommand="True" />
62
+
63
+ > </i:EventTrigger>
64
+
65
+ > </i:Interaction.Triggers>
66
+
67
+ > ↑ ViewModel上のイベントバインドしたメソッドが実行されない
68
+
69
+ > </Button>
70
+
71
+ > </DataGridTemplateColumn.Header>
72
+
73
+ > <DataGridTemplateColumn.CellTemplate>
74
+
75
+ > <DataTemplate>
76
+
77
+ > <Button x:Name="btnName"
78
+
79
+ > HorizontalContentAlignment="Left"
80
+
81
+ > Style="{StaticResource CellButton}"
82
+
83
+ > Width="150">
84
+
85
+ > ↓ ViewModel上のイベントバインドしたメソッドが実行されない
86
+
87
+ > <i:Interaction.Triggers>
88
+
89
+ > <i:EventTrigger EventName="Click">
90
+
91
+ > <cmd:EventToCommand Command="{Binding ButtonClickCommand}" PassEventArgsToCommand="True" />
92
+
93
+ > </i:EventTrigger>
94
+
95
+ > </i:Interaction.Triggers>
96
+
97
+ > ↑ ViewModel上のイベントバインドしたメソッドが実行されない
98
+
99
+ > </Button>
100
+
101
+ > </DataTemplate>
102
+
103
+ > </DataGridTemplateColumn.CellTemplate>
104
+
105
+ > </DataGridTemplateColumn>
106
106
 
107
107
 
108
108
 
109
109
  ViewModelソース
110
110
 
111
- ↓ ViewModel上の実行されるメソッド
112
-
113
- private ICommand _PageMemberListLoadedCommand;
114
-
115
- public ICommand PageMemberListLoadedCommand
116
-
117
- {
118
-
119
- get
120
-
121
- {
122
-
123
- return _PageMemberListLoadedCommand ?? (_PageMemberListLoadedCommand = new RelayCommand<RoutedEventArgs>(PageMemberListLoaded));
124
-
125
- }
126
-
127
- }
128
-
129
-
130
-
131
- public void PageMemberListLoaded(RoutedEventArgs e)
132
-
133
- {
134
-
135
- (略)
136
-
137
- }
138
-
139
- ↑ ViewModel上の実行されるメソッド
140
-
141
-
142
-
143
- ↓ ViewModel上の実行されないメソッド
144
-
145
- private ICommand _ButtonClickCommand;
146
-
147
- public ICommand ButtonClickCommand
148
-
149
- {
150
-
151
- get
152
-
153
- {
154
-
155
- return _ButtonClickCommand ?? (_ButtonClickCommand = new RelayCommand<RoutedEventArgs>(ButtonClick));
156
-
157
- }
158
-
159
- }
160
-
161
-
162
-
163
- public void ButtonClick(RoutedEventArgs e)
164
-
165
- {
166
-
167
- try
168
-
169
- {
170
-
171
- MessageBox.Show("ButtonClick");
172
-
173
- }
174
-
175
- catch
176
-
177
- {
178
-
179
- }
180
-
181
- }
182
-
183
- ↑ ViewModel上の実行されないメソッド
111
+ > ↓ ViewModel上の実行されるメソッド
112
+
113
+ > private ICommand _PageMemberListLoadedCommand;
114
+
115
+ > public ICommand PageMemberListLoadedCommand
116
+
117
+ > {
118
+
119
+ > get
120
+
121
+ > {
122
+
123
+ > return _PageMemberListLoadedCommand ?? (_PageMemberListLoadedCommand = new RelayCommand<RoutedEventArgs>(PageMemberListLoaded));
124
+
125
+ > }
126
+
127
+ > }
128
+
129
+ >
130
+
131
+ > public void PageMemberListLoaded(RoutedEventArgs e)
132
+
133
+ > {
134
+
135
+ >(略)
136
+
137
+ > }
138
+
139
+ > ↑ ViewModel上の実行されるメソッド
140
+
141
+ >
142
+
143
+ > ↓ ViewModel上の実行されないメソッド
144
+
145
+ > private ICommand _ButtonClickCommand;
146
+
147
+ > public ICommand ButtonClickCommand
148
+
149
+ > {
150
+
151
+ > get
152
+
153
+ > {
154
+
155
+ > return _ButtonClickCommand ?? (_ButtonClickCommand = new RelayCommand<RoutedEventArgs>(ButtonClick));
156
+
157
+ > }
158
+
159
+ > }
160
+
161
+ >
162
+
163
+ > public void ButtonClick(RoutedEventArgs e)
164
+
165
+ > {
166
+
167
+ > try
168
+
169
+ > {
170
+
171
+ > MessageBox.Show("ButtonClick");
172
+
173
+ > }
174
+
175
+ > catch
176
+
177
+ > {
178
+
179
+ > }
180
+
181
+ > }
182
+
183
+ > ↑ ViewModel上の実行されないメソッド
184
184
 
185
185
 
186
186