question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't remove padding of custom ContentDialog

See original GitHub issue

Describe 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 image

Actual behavior image

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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
tipacommented, Aug 19, 2021

@michael-hawker thanks! Yes, using the adjusted template in my custom ControlDialog seems to work

1reaction
michael-hawkercommented, Aug 19, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found