Fit a window into XAML content
Hi,
I want to create a popup window populated with a XAML, and I want that window to fit the size of the XAML content.
How can I know the correct size for the window.
# In WPF I think I can use the property SizeToContent to let the window automatically adjust its size.
https://docs.microsoft.com/en-us/dotnet ... mework-4.8
thanks.
I want to create a popup window populated with a XAML, and I want that window to fit the size of the XAML content.
How can I know the correct size for the window.
# In WPF I think I can use the property SizeToContent to let the window automatically adjust its size.
https://docs.microsoft.com/en-us/dotnet ... mework-4.8
thanks.
-
sfernandez
Site Admin
- Posts: 3154
- Joined:
Re: Fit a window into XAML content
In the upcoming 3.0 version we implemented SizeToContent property in our Window implementation: #1631
Basically what we did is call Measure(INF, INF) on the content, and then AdjustWindowRect() to calculate the appropriate window size.
Basically what we did is call Measure(INF, INF) on the content, and then AdjustWindowRect() to calculate the appropriate window size.
Re: Fit a window into XAML content
Thank you. Will try to mimic that implementation. We are still using version 2.2 of NoesisGUI. I hope that will not block this feature.Basically what we did is call Measure(INF, INF) on the content, and then AdjustWindowRect() to calculate the appropriate window size.
Re: Fit a window into XAML content
Yes, the implementation of displays in 3.0 should be compatible with 2.2. Please, try it at let us know. Thanks!
Who is online
Users browsing this forum: Bing [Bot] and 2 guests