Can't remove padding of custom ContentDialog
See original GitHub issueDescribe the bug
I want to remove the padding of a subclassed ContentDialog.
Setting ContentDialogPadding
to 0 is not working.
Steps to reproduce the bug
<ContentDialog
x:Class="Namespace.AuthDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Style="{StaticResource DefaultContentDialogStyle}"
mc:Ignorable="d">
<ContentDialog.Resources>
<Thickness x:Key="ContentDialogPadding">0</Thickness>
</ContentDialog.Resources>
...
</ContentDialog>
Expected behavior
Actual behavior
NuGet package version: [Microsoft.UI.Xaml 2.6.1]
Windows app type:
UWP | Win32 |
---|---|
YES |
Windows version | Saw the problem? |
---|---|
Build 19043.1165 | Yes |
October 2020 Update (19042) | |
May 2020 Update (19041) | |
November 2019 Update (18363) | |
May 2019 Update (18362) | |
October 2018 Update (17763) | |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | Yes |
Xbox | |
Surface Hub | |
IoT |
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (8 by maintainers)
Top Results From Across the Web
How to remove padding from content dialog? - uwp
I tried with padding & margin in both ContentDialog's tag and Root Grid as below. <ContentDialog... Padding="0" Margin="0"> <Grid Background=" ...
Read more >ContentDialog Class (Windows.UI.Xaml.Controls)
Represents a dialog box that can be customized to contain checkboxes, hyperlinks, buttons and any other XAML content.
Read more >InfoBar - Windows apps
If the InfoBar content, excluding custom content, is unable to fit on a single horizontal line they will be laid out vertically. The...
Read more >Fixed Size ContentDialog – C# Development - Skanky
A ContentDialog is placed in PopupRoot. Behind it, there is a Rectangle which dims other displayed elements and stops them being interacted with....
Read more >Creating a pop up menu dialog box – C# Development - Skanky
Menu > Project > Add new item > Visual C# > Content Dialog. We delete the following default ContentDialog options to remove them:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@michael-hawker thanks! Yes, using the adjusted template in my custom ControlDialog seems to work
I plan to submit a fix for #424 on a future dev stream of mine and try and investigate #4247 too. I was able to build the WinUI repo locally and run their test app. Just trying to get our Toolkit release together and working on our last feature there, so don’t know timing yet.
@tipa you can copy the style and test the suggested fix in #4247 and see if that works, knowing that would be helpful.