Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi!

I´m developing a WPF application and I´ve next problem.
In my app I have a TabControl with some TabItems. In each TabItem I have the estructure below:

XML
<TabItem Selector.Selected="TabItemFiles_Selected" Style="{StaticResource TabItemHorizontal}">
                   <TabItem.Header>
                       <StackPanel>
                           <Image Width="50" Height="50"                             Source="Images/Files.png"/>
                       </StackPanel>
                   </TabItem.Header>
                   <tabItemControls:TabFiles x:Name="Files" MinHeight="{x:Static constantes:Constantes.AltoResolucionPantalla}" Margin="5,10,5,5"/>
               </TabItem>




Inside of this TabItemControl:TabFiles, I´ve the code below in a Grid:

XML
<WindowsFormsHost Grid.Column="2">
   <wf:Panel x:Name="PrevisualizadorTrabajos">
   </wf:Panel>
</WindowsFormsHost>


I fill the content of PrevisualizadorTrabajos Panel at TabItemControl:TabFiles Loaded event.

The problem comes when this TabItemControl is shown for the first time. The content of the WindowsFormsHost control is shown firstly than other components on this TabItemControl and it creates an unpleasant visual effect.

How can I fix it?

Thank you very much.
Posted
Updated 22-Jan-14 21:33pm
v2
Comments
Sergey Alexandrovich Kryukov 22-Jan-14 12:16pm    
What do you mean by "loads"? What event, exactly? Why is this the problem? What "unpleasant effect"?
—SA
torin86 22-Jan-14 12:57pm    
Sorry for my explanation.
At TabItem_Loaded event I fill my Panel and when I run the application and go into this TabItem, the content of the mentioned panel is shown (loaded) first and thent (like a second) the rest of the components are shown. I want to delete this effect.
I hope I have expressed myself better.
Thanks.
Sergey Alexandrovich Kryukov 22-Jan-14 19:47pm    
There is no such event, "TableItem_Loaded", it's looks more like your handler of some event. But I even don't know such class, "TableItem". Probably it's you class we are unaware of. I even did not understand if this is a UI element or not, of System.Windows.Forms part or WPF part. And when you say "Panel" (say, class name), the question is: which one? In other word, not enough information, by far...
—SA

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900