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.33k stars 2.44k forks source link

WPF inside WF, Cannot close Flyouts and FlyView doesn't select #2416

Closed MattBg closed 8 years ago

MattBg commented 8 years ago

What steps will reproduce this issue?

I successfully encapsulated my WPF application inside a DLL. I added the DLL inside another bigger WINDOWS FORM project, and i simply instantiate a new window in this way:

        Dim win As New MyWPFappAsDLL.MainWindow
        win.Show()

Now the windows it's correctly showed and it works but only partially, i have problems with Flyout and FlipView. I can open and interact with the Flyout but i can't close it, and for the FlipView, the images are showed but the click on the < > arrow doesn't work.

I tryed the static comand: ElementHost.EnableModelessKeyboardInterop(win) but it doesn't work, Flyouts and FlyViews are still partially working.

My biggest guess is that as long as Mahapps is designed for WPF, i'm missing some system DLL that are included in WPF and absent in WF

I know it's intricate, but i must put my WPF inside a WF, as now i can't upgrade all in WPF.

There's a specific way for include my Mahapps based WPF inside a WF and have Flyouts and FlyView work as in WPF?

UPDATE: I added a button inside the flyout that simply sets IsOpen = False and the Flyout closes correctly, it seems the arrowClosing button is unresponsive, how can i handle the closing button in explicit way?

UPDATE 2: I temporally walked around this issue by setting CloseButtonVisibility = Collapsed from the Flyout. I created my own circled arrow button (and placed int he top left corner) that closes the Flyout and for the FlyView i removed the selectors with HideControlButtons() and i managed the page selection in a different way. This cheap trick works but if someone knows how to solve my issue please tell me.

Thank you!

Environment

punker76 commented 8 years ago

@MattBg Please try the latest pre-release, I changed some for the Flyouts close button

MattBg commented 8 years ago

@punker76 Just tested, in my situation (DLL inside FORM) the flyout's Close Button, in prerelease 1.3.0.76, works perfectly.

punker76 commented 8 years ago

@MattBg :cool: