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

Set position of MainWindow based on loaded ContentControl

$
0
0

Hi All,

Is it possible to set Top and Left for MainWindow that will be based on loaded ContentControl?

My MainWindow has SizeToContent set for WidthAndHeight. 

Each of my views loaded to MainWindow is different. Sometimes, size is changing while using my app (one view has 3 TabItems, 2 are the same, but the third one is bigger). 

Normally, I would use SystemParameters.FullPrimaryScreenHeight - Height for Top and SystemParameters.FullPrimaryScreenWidth - Width for Left, and bind it to it. (Instead FullPrimaryScreenHeight, WorkArea.Height, etc). But how could I get Height and Width of current View/MainWindow and handle this calculation when something is changing with the size of MainWindow?

Should I create special style or template for the Window?

Thank you for any ideas.



Viewing all articles
Browse latest Browse all 18858

Trending Articles



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