dialog - uwp - How to make ContentDialog size according to contents? -


in contentdialog, have stackpanel 3 controls (vertical orientation). problem contentdialog's height stretches way bottom of window though contents don't occupy half of it.

i'm having guess stackpanel's issue, nevertheless how fix this?

i set maxheight, have fill fixed values differ per contentdialog...

update

this in mainpage.xaml (default starting page of vs uwp template). xaml shows creation of 1 use-case button, on click event:

    private async void button_click(object sender, routedeventargs e)     {         dataentrydialog dialog = new dataentrydialog();          //show dialog         await dialog.showasync();     } 

dataentrydialog.xaml:

<contentdialog     x:class="app1.dialogs.useraccountdataentrydialog"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"     mc:ignorable="d"     title="title"     primarybuttontext="save"     secondarybuttontext="cancel"     loaded="contentdialog_loaded"     primarybuttonclick="contentdialog_primarybuttonclick">      <stackpanel>         <textbox header="username" margin="0,20,0,0"/>         <passwordbox header="password" margin="0,12,0,0"/>         <checkbox content="active" margin="0,12,0,0"/>     </stackpanel> </contentdialog> 

looks that's default behavior of contentdialog. if resize uwp app window, you'll see stretch vertically , horizontally depending on size of window. guess, done on purpose app's dialogs supported on platforms (desktop, mobile, tablet, xbox, etc...)


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

Command prompt result in label. Python 2.7 -