In a wpf application, I have a user control with a Grid
“ContentGrid” which can get bigger than the user control, then all the parents of ContentGrid are resized too big.
I do not understand why the Viewbox
does not do its job and keep everything inside resized so one can see everything, with no resizing of controls outside it.
How to make sure the content of the viewbox won’t resize its parents ?
<UserControl x:Class="myUC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Viewbox>
<Grid Name="ContentGrid">