0

I used the code below to set the width of ContentDialog

<ContentDialog
    x:Class="MyAPP.SettingContentDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Picvac_UWP"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Title="Random Select the number"
    PrimaryButtonText="Cancel"
    SecondaryButtonText="Ok"
 
    Width="800"
    >

but the width ContentDialog never can be more than 550 pixels

enter image description here

it looks like

Width="800"

does not work.

I also try to change the width of the Grid in ContentDialog to more than 550 pixels, the width of ContentDialog always is 550

enter image description here

Your comment welcome

arachide
  • 8,006
  • 18
  • 71
  • 134
  • Does this answer your question? [ContentDialog max width](https://stackoverflow.com/questions/45917333/contentdialog-max-width) – Leander Oct 05 '20 at 16:07
  • no, it does not work for me – arachide Oct 05 '20 at 16:18
  • Did you take the accepted answer or the most upvoted answer from the SO thread I linked? Since the most upvoted answer is literally the answer given here, therefore making this thread completely redundant. It would be great if you could then close this thread. – Leander Oct 11 '20 at 17:41

1 Answers1

3

The default ContentDialog MaxWidth is 584 that was setting in the generic.xaml file. if you want to edit it, you could make new one to cover the default like the following.

<Application.Resources>
    <x:Double x:Key="ContentDialogMaxWidth">900</x:Double>
.......
Nico Zhu
  • 32,367
  • 2
  • 15
  • 36
  • thanks a lot, is it possible to check this question? https://stackoverflow.com/questions/64185992/the-break-point-in-c-winrt-component-code-is-not-triggered I have stuck on the problem a lot time – arachide Oct 06 '20 at 06:50
  • Yep, I saw that case early, but I'm not familiar with cpp wrt, I need to do more researching. please wait a while. – Nico Zhu Oct 06 '20 at 06:54