Materialdesigninxamltoolkit: DialogHost refresh issue on some computers (Surface laptop in this example)

Created on 29 Oct 2018  路  11Comments  路  Source: MaterialDesignInXAML/MaterialDesignInXamlToolkit

It does not happen on my old ThinkPad but it does happen on 2 Surface laptops I've tried.

This is the example in video: https://photos.app.goo.gl/kJjbu4wraiRJFVWH7
And this is repo of a slimmed down app that you can download and try: https://github.com/bebenins/DialogRefreshIssue

I'm pretty sure this started happening with 2.5.0 release because I noticed this one some dialogs once I updated to 2.5.0:
image

All 11 comments

Could you try software rendering mode as a test?
https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.renderoptions.processrendermode?view=netframework-4.7.2

Adding in app.xaml.cs

protected override void OnStartup(StartupEventArgs e)
{
    RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;
}

Could you try software rendering mode as a test?
https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.renderoptions.processrendermode?view=netframework-4.7.2

Adding in app.xaml.cs

protected override void OnStartup(StartupEventArgs e)
{
    RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;
}

Yep, that fixed it. So is this something to keep in mind or is there a way to "build" it into this toolkit and no one has to think about it again?
Thanks!

Sadly the issue is your hardware and/or drivers.
Mozilla maintains a public list of blocked hardware accelerated gpus. More details here: https://wiki.mozilla.org/Blocklisting/Blocked_Graphics_Drivers
Disabling it for everyone just because it doesn't work on a few gpus isn't very reasonable

There's still an issue with one type of dialog. I just updated the repo to include it. It's the 3rd button (Data Entry):
image

Any ideas what makes this special?
Thanks!

Your issue here is a rounding issue with the width
rounding-issue

If you in DialogDataEntry.xaml's UserControl add UseLayoutRounding="True" like this:

<UserControl x:Class="DialogRefreshIssue.DialogDataEntry"
             ...
             UseLayoutRounding="True">

Then it'll display it properly like this:
rounding-issue2

And Snoop now:
rounding-issue3

Thank you so much! I've learned something new today!

@jespersh Thank you again for helping with this. I'm trying to learn Snoop and having issues focusing on the Dialog. For some reason I don't see the same tree you are seeing even though the dialog is up. Could you please tell me how you focused on the dialog so that your tre starts with "(PopupRoot) 59"?
Thanks!
image

@bebenins the reason is because the tree view and snoop can only show a single visual tree at a time. Popups and windows each have their own tree. There is a slick little feature built into snoop where you simply hover your mouse over the element you want to select and press Ctrl+Shift. This should let you switch to inspecting the popup's tree.

@Keboo Thanks! Would have never guessed it

@bebenins is there more you need help with here? :-)

No I'm all set. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheSylence picture TheSylence  路  12Comments

StephanBis picture StephanBis  路  16Comments

wongjiahau picture wongjiahau  路  17Comments

bbougot picture bbougot  路  13Comments

Tyrrrz picture Tyrrrz  路  12Comments