質問編集履歴

3

エラー時のStyleが記載できていなかった

2021/10/13 09:54

投稿

Base
Base

スコア28

test CHANGED
File without changes
test CHANGED
@@ -46,6 +46,46 @@
46
46
 
47
47
 
48
48
 
49
+ App.xaml
50
+
51
+ ```xaml
52
+
53
+ <Application.Resources>
54
+
55
+ <Style x:Key="errorStyleLostFocus" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type FrameworkElement}}" >
56
+
57
+ <Style.Triggers>
58
+
59
+ <Trigger Property="Validation.HasError" Value="True">
60
+
61
+ <Setter Property="Background" Value="Red"/>
62
+
63
+ </Trigger>
64
+
65
+ </Style.Triggers>
66
+
67
+ </Style>
68
+
69
+ <Style x:Key="errorStyleGotFocus" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type FrameworkElement}}" >
70
+
71
+ <Style.Triggers>
72
+
73
+ <Trigger Property="Validation.HasError" Value="True">
74
+
75
+ <Setter Property="Background" Value="Red"/>
76
+
77
+ </Trigger>
78
+
79
+ </Style.Triggers>
80
+
81
+ </Style>
82
+
83
+ </Application.Resources>
84
+
85
+ ```
86
+
87
+
88
+
49
89
  View
50
90
 
51
91
  ```xaml

2

タグを一つ削除

2021/10/13 09:54

投稿

Base
Base

スコア28

test CHANGED
File without changes
test CHANGED
File without changes

1

試したことに参考URLを追加

2021/10/13 08:33

投稿

Base
Base

スコア28

test CHANGED
File without changes
test CHANGED
@@ -288,6 +288,12 @@
288
288
 
289
289
 
290
290
 
291
+ 2) ReactivePropertyを使ったエラーチェック
292
+
293
+ https://teratail.com/questions/346500
294
+
295
+
296
+
291
297
  ### 補足情報(FW/ツールのバージョンなど)
292
298
 
293
299
  VisualStudio2019