Minimize application during active ProgressDialog - wpf

Is there a way to give the user the option to minimize the application while showing the ProgressDialog?
controller = await dialogCoordinator.ShowProgressAsync(this, "Header", "Message, please wait...");
It currently remains opened and user is unable to minimize or move the window.

We've had the same requirement on our Application which lead us to develop our own ProgressBar control and place it on a layer on top of the Application, in the MainView which left the top bar including the minimize and maximize buttons - working.

The problem you are describing is general and has nothing to do with the dialog you are displaying. If mahapps.metro is really just a toolkit, standard solutions should work
Appplication.MainWindow.WindowState = WindowState.Minimized
If this still doesn't work for you, it means that you are in the "framework in the framework" situation and have to get out of the box using some win32 interop like ShowWindow(...)

Hi we also faced this issue, after lots of months of searching in google and gitter ,
I found that there is a property in the metroWindow class (which is this,in the author example)
metroWindow.ShowDialogsOverTitleBar
once I set it to false , I was able to minimize my application via the title bar ,
hopes it helps anyone.

Related

Windows 8 like modal dialog using WPF

I am working on a WPF-MVVM (.Net 4.0) application that has a Metro look (it just has a look, it is not a metro application.)
I need to show a windows 8 like message box that blocks the operations for the user before he rids that message box by clicking yes/no/cancel (or any button.).
I came across this otherwise great article and momentarily thought that I have found the solution. But this has its own drawback.It just stops the user from interacting with the controls behind by mouse clicks. The user can however use the tab key to get back to the buttons behind and click them (pressing enter).
A number of things are coming to my mind:
should I go for custom adorners and play with hitTestable property?
Or should I place a control and play with its visible property.
Before going for any approach I thought of putting forward my question to the wonderful community here if someone has done a similar thing in past and provide me some pointer/reference/approach.
Can someone suggest what is the way to achieve this? Please note I will be happy to use prism or any other open source if that solves the purpose but the window will have to be custom made.
Please excuse me if you find this too stupid a question. Please pardon my ignorance. Thanks for reading this.
I recently came across a similar problem, I resolved it using a DialogPresenter as explained there:
http://www.codeproject.com/Articles/36516/WPF-Modal-Dialog
I had to do a few tweaks there and there but overall it's working fine and I now have a nice way to display dialog boxes!
There is a better way of doing it
var dialog = new MessageDialog("Select Social network is already authorised!");
dialog.ShowAsync();

Can I use the WP7 Panorama control outside of WP7?

I need a WPF control that acts like the Panorama control for Windows Phone 7, but I need it for a desktop application.
It will contain a series of panels (or Panorama Items) that the application will be able to slide through horizontally programmatically.
Also, the content inside the panels not currently displayed on the screen will need to be "lazy loaded". In other words, they should be referenced but not loaded or rendered.
Can I somehow adapt the WP7 Panorama control to do this? Or will I have to develop a custom control from scratch to behave similarly to it?
Thank you!
EDIT:
I could probably use a VirtualizingPanel to implement the lazyload behaviour.
MahApps.Metro while still not super mature does allow for the wp7 Panorama control. Demo of how to use a panorama here. I've played with it a little and while its not the most customizable thing out there it gets the job done. Pretty sweet. Also Sacha Barber (Codeproject Demigod) wrote up an article on making your own. Of which I haven't looked at yet but, the guy usually does awesome work. So I'd check that one out as well.
http://blogs.microsoft.co.il/blogs/arielbh/archive/2010/10/21/porting-windows-phone-7-s-panorama-control-to-silverlight-4.aspx gives some clues about how do to this.
It suggests using http://phone.codeplex.com/ as your base and then you can use http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=4b281bde-9b01-4890-b3d4-b3b45ca2c2e4 (Microsoft Surface Manipulations and Inertia Sample for Microsoft Silverlight) to run convert get it to respond to touch.
Seems none exist as far as I can see so far.
This blog has started an attempt at making it, so you could work from there to make your own. Be sure to also check out this page which details the creation of an individual panorama item too.

wpf WindowsFormHost

Hi Every Body
Am Working With WPF Application
I Needed To Use MS Reports In My Application So I Used WindowsFormsHost
But The Problem Is That The WindowsFormsHost Can'nt Handle Touch Events
How I Can Handle Touch Events In My Report In WindowsFormsHost
Please I Need Ur Help
Thanks
The question is as old as multi touch. As long as the control doesn't support it, you have to trick. Whether that's going to work depends on the control. The BING map control was successfully made to respond to touches. I think there's a touch enabled layer that takes touches and translates them to window messages. This can get a real mess.
Please keep in mind, that even if you can get such a solution to work, you won't get a touch optimized control. The control will probably have a bad, bad user experience...
If it's all about displaying data, I've described a possible alternative implementation on my post: for answer How to display a PDF document in a Microsoft Surface application?

Windows App Focus: Why does it require a click?

When I have 2 apps open and one has the focus but I want to execute a command in the other app, it requires a click to regain focus and another to execute the command. Is there some good reason why I couldn't take focus on MouseOver? I'm working with a WPF app if that is pertinent. TIA
EDIT: Oddly enough the MouseOvers work without focus.
I would not recommend doing this. This is not a standard way of working in Windows, so you will confuse your users. People are used to clicking into an application (or tabbing) to provide focus.
However, this is a configurable setting via the Accessability Tools in Windows. It can be enabled by choosing "Activate a window by hovering over it with the mouse" globally. Let your users specify this behavior if they want it.
The setting is configurable at a system-wide level. You should never ever override the user's current setting regarding this.
MS Windows Vista -- focus follows mouse (There's also a link on how to do it on XP.)
Edit: Normally, you can click a button on a form and both bring focus to the window and click it at the same time. The origins of the current setting "eating" the initial mouse click that brings focus to a window started as a fix to a bug in the Ribbon UI. The discussion is somewhere in this video: The Story of the Ribbon. Sorry I can't narrow it down more than that, but at least the video is a great insight and work watching - maybe you can send a message to Jensen Harris if you need a faster answer.
Edit 2: I just added a button to a WPF window, and I'm able to click it as long as I can see it - whether or not the window has focus.
You can take focus on MouseOver manually

How to run Google Earth Inside a WPF Control

I’m trying to run Google earth inside WPF but I don’t know how. Basically I have managed to run Google Earth in a Windows Form Control inside a Windows Form, everything was OK.
Trying to do the same thing in WPF, well, give strange result a small Google Earth screen placed anywhere in the form an not inside the User Control I have created, and there is now way to make this Google Earth Control grow, or shrink, when I grow or shrink the WPF Form.
Any help would be appreciated, I really mean any!
If you have a Windows Forms control that already works exactly as you want, you could always use WindowsFormsHost to put that control on your WPF form. That might be the easiest thing to do... or is that what you're already doing that isn't working?
I also wrote an application that placed Google Earth inside a WinForms WebBrowserControl that was based on the more-or-less official example hosted by Google. It worked fine. I struggled to recreate the same application inside a WPF WebBrowserControl. My experience confirms what appears to be the general consensus that the WPF WebBrowserControl is harder to use because it provides less control. (e.g. With the WinForms WebBrowserControl you can use the properties to remove the scroll bar and eliminate the IE security question on startup, but with WPF WebBrowserControl you have to use kludges inside to HTML file loaded to get the same effect.) If you are following the Google GE plugin WinForms example, you have to move the JavaScript callback functions into a separate class because of WPF window cant be a parent of the .Net-COM interop between JavaScript and C#. Maybe the other artifacts you described are due to how you resolved this latter limitation. Before finding this solution, I was tempted to put the WinForms WebBrowser control inside the WPF window, but others have posted of unpleasing side-effects of doing this.

Resources