質問編集履歴
2
複数プロパティ更新されないことを記述
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
|
-
Prism IDialogService を用いて開いた Dialog に設置した(TextBoxの)ユーザーコントロールのプロパティに対し、OnDialogOpened メソッド内で値更新したいが、ユーザーコントロールに表示されません。解決策をいただきたいです。
|
3
|
+
Prism IDialogService を用いて開いた Dialog に設置した(TextBoxの)ユーザーコントロールの複数プロパティに対し、OnDialogOpened メソッド内で値更新したいが、ユーザーコントロールには最初の1個目のプロパティしか表示されません。2個目以降のプロパティは表示されません。解決策をいただきたいです。
|
4
4
|
※同じDialog に設置した TextBox は表示されます。
|
5
5
|
|
6
|
-
下記のソースコードで言えば、Dialog 表示時 に、ユーザコントロールには ABC
|
6
|
+
下記のソースコードで言えば、Dialog 表示時 に、ユーザコントロールには ABC は表示されますが、DFE は表示されません。TextBox には DEF が表示されます。
|
7
7
|
|
8
8
|
### 該当のソースコード
|
9
9
|
Dialog を開くコード(別画面のViewModelから開いている)
|
@@ -22,8 +22,10 @@
|
|
22
22
|
<StackPanel Orientation="Vertical">
|
23
23
|
<ctl:XXX
|
24
24
|
x:Name="XXX"
|
25
|
-
|
25
|
+
Param1="{Binding Param1.Value}"
|
26
|
+
Param2="{Binding Param2.Value}"
|
27
|
+
/>
|
26
|
-
<TextBox Text="{Binding
|
28
|
+
<TextBox Text="{Binding Param2.Value}" />
|
27
29
|
</StackPanel>
|
28
30
|
```
|
29
31
|
|
@@ -55,7 +57,8 @@
|
|
55
57
|
|
56
58
|
public override void OnDialogOpened(IDialogParameters param)
|
57
59
|
{
|
58
|
-
this.
|
60
|
+
this.Param1.Value = "ABC";
|
61
|
+
this.Param2.Value = "DEF";
|
59
62
|
}
|
60
63
|
}
|
61
64
|
|
1
ソースコードの追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,8 +6,19 @@
|
|
6
6
|
下記のソースコードで言えば、Dialog 表示時 に、ユーザコントロールには ABC が表示されず、TextBox には ABC が表示されます。
|
7
7
|
|
8
8
|
### 該当のソースコード
|
9
|
+
Dialog を開くコード(別画面のViewModelから開いている)
|
10
|
+
```BBBViewModel.cs
|
11
|
+
/// <summary>
|
12
|
+
/// ウィンドウ表示
|
13
|
+
/// </summary>
|
14
|
+
private void OnMiniWindow()
|
15
|
+
{
|
16
|
+
this.dialogService.ShowDialog(ViewNames.AAA,null,null);
|
17
|
+
}
|
18
|
+
```
|
19
|
+
|
9
|
-
Dialog の View
|
20
|
+
Dialog の View(xaml)
|
10
|
-
```xaml
|
21
|
+
```AAA.xaml
|
11
22
|
<StackPanel Orientation="Vertical">
|
12
23
|
<ctl:XXX
|
13
24
|
x:Name="XXX"
|
@@ -16,8 +27,23 @@
|
|
16
27
|
</StackPanel>
|
17
28
|
```
|
18
29
|
|
30
|
+
Dialog の View(コードビハインド、.cs)
|
31
|
+
```AAA.xaml.cs
|
32
|
+
/// <summary>
|
33
|
+
/// AAADialog.xaml の相互作用ロジック
|
34
|
+
/// </summary>
|
35
|
+
public partial class AAADialog : UserControl
|
36
|
+
{
|
37
|
+
public AAADialog()
|
38
|
+
{
|
39
|
+
InitializeComponent();
|
40
|
+
}
|
41
|
+
}
|
42
|
+
```
|
43
|
+
|
44
|
+
|
19
45
|
Dialog の ViewModel
|
20
|
-
```cs
|
46
|
+
```AAADialogViewModel.cs
|
21
47
|
public class DialogViewModel : BindableBase,IDialogAware
|
22
48
|
{
|
23
49
|
public ReactiveProperty<string> Param { get; set; }
|