I'd like to limit my Dialog window min height & width when not minimized, but have it be a smaller size when minimized. I try setting MinHeight & MinWidth to 400, and MnimizedHeight to 25, MinimizedWidth to 200. But, then when I minimize the window, it stays 400x400. I guess that's technically correct since I set that as min width\height, but I was assuming MinimizedHeight\Width would override those values when the window was minimized.
Is there any way to achieve what I'm looking for? The repro below shows what I mean. I'd like it to stay at least 400x400 when not minimized, then be 200x25 when minimized. Setting the MinimizedPanel's row height to 25 handles the height, but I still have the width problem.
Thanks,Keith
<Grid x:Name="LayoutRoot" > <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions>
<Canvas Grid.Row="0" > <igWindow:XamWebDialogWindow MinHeight="400" MinWidth="400" MinimizedHeight="25" MinimizedWidth="200" MinimizedPanel="{Binding ElementName=PanelMinimized}"/> </Canvas> <StackPanel x:Name="PanelMinimized" Grid.Row="1" /></Grid>
OK, thanks Mihail. This was my fallback plan. :-)
Hi Keith, In XamWebDialogWindow MinWidth and MinHeight are with higher priority than MinimizedWidth and MinimizedHeight.
XAML:
<igWindow:XamWebDialogWindow Width="500" Height="500" SizeChanged="XamWebDialogWindow_SizeChanged" MinimizedHeight="25" MinimizedWidth="200" MinimizedPanel="{Binding ElementName=PanelMinimized}"/> <StackPanel x:Name="PanelMinimized" Grid.Row="1" /> </Grid>
C#
private void XamWebDialogWindow_SizeChanged(object sender, SizeChangedEventArgs e) { XamWebDialogWindow win = sender as XamWebDialogWindow; if (win != null) { if (win.WindowState != Infragistics.Silverlight.WindowState.Minimized) { if (win.ActualWidth < 400) { win.Width = 400; } if (win.ActualHeight < 400) { win.Height = 400; } } } }
You can use EventHandler for SizeChanged Event to implement desired behavior:
Best Wishes!
Mihail