MahApps / MahApps.Metro

A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
https://mahapps.com
MIT License
9.28k stars 2.45k forks source link

DataContext is not passed to UIElement in CustomDialog.DialogTop #3708

Closed seba30 closed 4 years ago

seba30 commented 4 years ago

Hello,

I've started a new project with .NET Core, MahApps 2.0.0-alpha0605 and observed an ugly behavior.

If I'm using a CustomDialog and override the DialogTop property, then the DataContext of the View is not passed to the Content element (here a Button), but the ContentPresenter around the Button has the DataContext set to my ViewModel.

image

But the UIElement in the CustomDialog's content gets the DataContext.

image


Compared to MahApps 1.6.5 the behavior has changed.

image

Any ideas? Thank you!

punker76 commented 4 years ago

@seba30 I think I know what's wrong. I'll try to fix it later.

punker76 commented 4 years ago

@seba30 this has now been fixed, and it will be released in the next version of MahApps.Metro v2.0

seba30 commented 4 years ago

I'll give it a try. Thank you for your fast support!