Click here to Skip to main content
12,621,744 members (37,817 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: Silverlight
Hi
I am using MVVM pattern in my project and used Tab Control. Tab Items have validation.
<usercontrol>
    <grid x:name="Layout Root" xmlns:x="#unknown">
        <tabcontrol bindingvalditionerror="TabControl_validtion" x:name="TabControl">
            <tabitem>
                <myusercontrol1 datacontext="{Binding}" />
            </tabitem>
            <tabitem>
                <myusercontrol2 datacontext="{Binding}" />
            </tabitem>
            <tabitem>
                <myusercontrol2 datacontext="{Binding}" />
            </tabitem>
        </tabcontrol>
    </grid>
</usercontrol>
private void TabControl_validtion(object sender, ValidationErrorEventArgs e)
      {
          switch (e.Action)
          {
              case ValidationErrorEventAction.Added:
                  if (!Errors.Contains(e.Error))
                  {
                      this.Errors.Add(e.Error);
                  }
                  break;
              case ValidationErrorEventAction.Removed:
                  this.Errors.Remove(e.Error);
                  break;
              default:
                  break;
          }
      }
it's showing only errors for visible(currently opened) TabItem. And i need to show all the errors from all tabs. How can i achieve this?
Posted 27-Sep-12 20:12pm
Updated 27-Sep-12 20:14pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 28 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100