I have a Panel whose Width can be resized during runtime:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="770*"/>
</Grid.ColumnDefinitions>
<panels:NavigationPanel x:Name="cmBar" Margin="2,2,0,2"
HorizontalAlignment="Left" Width="220"/>
<panels:DetailAreaPanel x:Name="detailGrid" Margin="224,2,2,2" />
</Grid>
When the program is closed, I want to save the new Width in the registry. So the program will load to the same size next time its opened. I have everything working except the Width, unless I hardcode the new Width. So I would assume that my save is wrong.
all[5] = cmBar.ActualWidth.ToString();
all[] is then wrote into the registry. No matter how the panel is resized cmBar.ActualWidth is always 220. Any ideas?
Aviad P. had one this right the
.Widthis what is causing the problem. The solution is is when i load the width to load it as.MaxWidthThis will do the resizing but allow.ActualWidthto have the real width of the panel.