I have a scenario where I change the size of a content dialog in the view model. This works fine in the AnniversaryUpdate, but with the Creators Update, I get a totally different (and unworkable) behavior.
I have a content dialog where I want to change the screen size from portrait to landscape based on user input. In build 14393 (anniversary) it works just fine. When I toggle the project to use the Creators Update (150630) it does not work at all.
Here is the XAML code driving the issue:
<ContentDialog
x:Class="DialogView"
...snip...
Background="LightGray"
MinHeight="{Binding GridHeight}" MinWidth="{Binding GridWidth}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid Background="AliceBlue" Visibility="Collapsed"/>
<Button Content="{Binding Orientation}" Height="40" Click="ToggleButton_Click" VerticalAlignment="Top" HorizontalAlignment="Left"/>
</Grid>
When I run built for the Creators Update, I get a very small dialog that will not change size.
The default style for Windows.UI.Xaml.Controls.ContentDialog in 14393 is different from the default style for Windows.UI.Xaml.Controls.ContentDialog in 15063.
In the default style for Windows.UI.Xaml.Controls.ContentDialog in 15063, it use
ContentDialogMinHeight
andContentDialogMinWidth
to set theMinHeight
andMinWidth
. And the default value ofContentDialogMinHeight
andContentDialogMinWidth
are 184 and 320.When you set the value to
MinHeight
andMinWidth
property in theContentDialog
control, it will not change the value that define in the style.In 14393, it does not define the
MinHeight
andMinWidth
in the default style. If you want to get the sameMinHeight
andMinWidth
as 14393 in 15063, you should be able to copy the default style in 15063 and remove the following code: