Nested Validation in Catel

179 Views Asked by At

On my Catel Tab Control I have 3 tab items. Each have Views and ViewModels and has validation. They are also 3 different things (with nothing in common, btw). When my View with the Tab Control is displayed, no validation errors are detected. Only when I click on a tab item and the tab item content has a validation error, am I alerted about the validation error.

Does the tab control provide a way to indicate if a tab item has validation errors (red square around the tab item header like with a text box that failed validation)?

I want to know about validation errors I have on tab items that are not visible without having to go through each one.

1

There are 1 best solutions below

3
On BEST ANSWER

The TabControl is a very complex control in WPF. Note that it will only show the current tab, not the other views (they will be unloaded).

To solve this, Catel provides its own TabControl where you can set the behavior of the tabs:

  1. LazyLoading => Load all tabs using lazy loading, but keeps the tabs in memory afterwards.
  2. LazyLoadingUnloadOthers => Load all tabs using lazy loading. As soon as a tab is loaded, all other loaded tabs will be unloaded.
  3. EagerLoading => Load all tabs as soon as the tab control is loaded.
  4. EagerLoadingOnFirstUse => Load all tabs when any of the tabs is used for the first time.

For more information, see https://catelproject.atlassian.net/wiki/display/CTL/TabControl