Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
660
Red Border Lost on Tab Changed
posted

I have the exact same problem as the person in this post http://community.infragistics.com/forums/p/48373/257041.aspx

This posts states:

I have several XamTextEditor/XamComboEditor controls in a TabItemEx. Their values are binded to an object, like this: SelectedItem="{Binding Path=Status, UpdateSourceTrigger=LostFocus, ValidatesOnDataErrors=True}"

The object implements IDataErrorInfo. When the property has an error the control is surrounded by a thin red border. When I activate another tab and then go back to the tab with control with the error the border is gone. Even though object still has an error.

Any ideas?

With a reply of...

I found a work around, I surrounded the control with <AdornerDecorator> tag and the border stays.

I just want to know if there is a better way to do this. I have over 4,000 xamEditors to implement over the next few years and don't feel like wrapping every one of them in an AdornedDecorator.

Thank You

Parents
  • 54937
    Verified Answer
    Offline posted

    You don't have to put an AdornerDecorator around each control - just within the Content of the TabItem. Adorners are managed by the WPF framework and are provided by 1 of 2 elements - a ScrollContentPresenter (i.e. from a ScrollViewer) and an AdornerDecorator. When you change tabs the elements are being unloaded since a tabcontrol only keeps the content of the selected tab item in the visual tree. When the elements are unloaded the wpf framework removes the adorners.

    <TabItem Header="Home">
       <AdornerDecorator>
         <Grid>...or what ever is in the tab</Grid>
       </AdornerDecorator>
    </TabItem>

Reply Children
No Data