errortemplate

WPF ListBox ErrorTemplate

醉酒当歌 提交于 2020-01-24 08:48:49
问题 In my WPF application I've a ListBox binding to a collection of view models. Those view models support validation by implement INotifyDataErrorInfo. I’m trying to display an error template for items with validation errors in my ListBox. I’m able to get the ListBox to display the default error template by setting NotifyOnValidationError=True on the ItemSource binding of the ListBox. Which looks like this: Code of my ListBox: <ListBox x:Name="ListBoxEvents" ItemsSource="{Binding Events,

WPF ListBox ErrorTemplate

社会主义新天地 提交于 2020-01-24 08:47:07
问题 In my WPF application I've a ListBox binding to a collection of view models. Those view models support validation by implement INotifyDataErrorInfo. I’m trying to display an error template for items with validation errors in my ListBox. I’m able to get the ListBox to display the default error template by setting NotifyOnValidationError=True on the ItemSource binding of the ListBox. Which looks like this: Code of my ListBox: <ListBox x:Name="ListBoxEvents" ItemsSource="{Binding Events,

TextBox with validation loses ErrorTemplate on tab change

一笑奈何 提交于 2019-11-27 19:39:54
I have a TextBox with a validation rule that is on a tab of a TabControl. The default ErrorTemplate correctly shows (red border around TextBox) when the validation rule fails. However if there is a switch to another tab and then back to the tab with the TextBox the ErrorTemplate hightlight is gone. If there is a change in the TextBox the validation rule is still called and returns false but the error highlight still doesn't show. Only when the text content is changed to be valid and then again to be invalid does the highligh comeback. I would like that if the text content is invalid that

TextBox with validation loses ErrorTemplate on tab change

落花浮王杯 提交于 2019-11-26 19:57:39
问题 I have a TextBox with a validation rule that is on a tab of a TabControl. The default ErrorTemplate correctly shows (red border around TextBox) when the validation rule fails. However if there is a switch to another tab and then back to the tab with the TextBox the ErrorTemplate hightlight is gone. If there is a change in the TextBox the validation rule is still called and returns false but the error highlight still doesn't show. Only when the text content is changed to be valid and then

Validation Error Style in WPF, similar to Silverlight

被刻印的时光 ゝ 提交于 2019-11-26 17:02:20
By default, the Validation.ErrorTemplate in WPF is just a small red border without any ToolTip . In Silverlight 4 , the validation error is nicely styled out-of-the-box. Here is a comparison of a validation error occuring in Silverlight 4 and WPF Silverlight 4 WPF Notice the really flat, boring look of the WPF version compared to the, in my opinion, great look in Silverlight. Does any similar validation styles/templates exist in the WPF Framework or has anybody created nicely styled validation templates like the Silverlight version above? Or will I have to create them from scratch? If anybody

Validation Error Style in WPF, similar to Silverlight

北城以北 提交于 2019-11-26 04:59:35
问题 By default, the Validation.ErrorTemplate in WPF is just a small red border without any ToolTip . In Silverlight 4 , the validation error is nicely styled out-of-the-box. Here is a comparison of a validation error occuring in Silverlight 4 and WPF Silverlight 4 WPF Notice the really flat, boring look of the WPF version compared to the, in my opinion, great look in Silverlight. Does any similar validation styles/templates exist in the WPF Framework or has anybody created nicely styled