Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

exists speciall issues (or is this weird) about saving systemresources while instantiating StackPanels?

$
0
0

Hey,

i Encounter following weird behaviour. I have written following code:

TabItem item = newTabItem();

StackPanelsubpanel =newStackPanel();

subpanel.Orientation = Orientation.Horizontal;

StackPanelpanel =newStackPanel();

panel.Orientation = Orientation.Vertical;    <<<<!!!!!!---this is the line i mean                  

panel.Children.Add(subpanel);

panel.Children.Add(newDataGrid());

item.Content = panel;

If i compile this code my application will debug significantly slower as with the following code example:

TabItem item = newTabItem();

item.Content = new DataGrid();

here i just added the DataGrid to the item and omit the StackPanels between. So far so good, ok , i was thought, this slows down my application, but following happended.

If i Change the Orientation property to horizontal in the marked line, also:

panel.Orientation = Orientation.Horizontal;

the application will run so fast as before. With run i mean start, cause the TabControl is initialized at the strt of the application. Is there something to think about this weird behaviour???

               

                       

                       

                       

                       

                       


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>