WPF preview isnt correct.

Ive had this issue in a bit. IDK if the problem ist on my site but it seems like i cant find anyone else with this issue.

So i made a Project with a Window that should be 150 in height and 400 in width. The Preview shows me the whole window. No element is cut. However when i compile the Window the elements get cut.

Can someone help me?

0
3 comments

Hello Ivan,

Thank you for contacting Rider support.

This is a known problem for WPF developers. I found several related threads you can find usefull:

I have several suggestions based on these threads:

  • Try adding parameter SizeToContent="WidthAndHeight" to your Window element;
  • Try using HorizontalAlignment/VerticalAlignment on your controls;
  • Use DockPanel, Grid, StackPanel elements to organize your controls;

Hope it helps.

1

SizeToContent="WidthAndHeight" fixed the problem.

0
Hello Ivan,

I am happy to know that I was able to help.

Should you have any other questions or difficulties, please let me know.

Have a nice day!
0

Please sign in to leave a comment.