Minimise and maximise MetroWindow when ShowMessageAsync is being displayed - c#

I am using Mah Apps Metro in a WPF application and showing messages to users with their async dialog messages.
At a particular point in the application I am erasing a removable device which could take some time, in the mean time showing the user the ShowProgressAsync dialog until it completes.
var controller = await this.ShowProgressAsync("Please wait", "Preforming secure erase, this could take some time...", false, mds);
During the time the dialog is on the screen, it is not possible to interact with the window's minimise and maximise buttons and it's also not possible to move the window.
Is there a way I am able to show the dialog to the user and allow them to minimise/maximise/move the window or will I be forever stuck with the application in the location the dialog was displayed until it is closed?
(side note: the grip in the bottom right corner of the window will allow me to manually resize the window, just not the buttons on the title bar)
Thanks

The MappApp dialog is modal, so you cannot touch anything in the background because this is its purpose. As far as I know (for now) you cannot made modifications on this scenario.

Related

close a WPF Dialog Window when the user clicks outside it

GoodDay, Here i want to minimize the WPF Window, While user clicking outside of the window.
I can easily minimize the window by this code
mywindow.WindowState= WindowState.Minimized;
but i want minimize the window at the time of clicking outside of the window.
i searched about that. But i can only got the output of various events like, FocusChanged,MouseMove,MouseDown like that. those are not solve my issue
You could use the Deactivatedevent. Have a look at the MSDN for further information.
A window is deactivated (becomes a background window) when:
A user switches to another window in the current application.
A user switches to the window in another application by using ALT+TAB or by using Task Manager.
A user clicks the taskbar button for a window in another application.

Hide console window, not the taskbar button

I am in a need of hiding the console window, which I quickly resolved by P/Invoking ShowWindow. However, the call hides the console window as well as the taskbar button of the console window. I need the taskbar button to remain visible. I am not, however, looking for a way to minimize the console window. Clicking the taskbar button show not do anything. I tried to use SetWinEventHook and hide the window every time it was activated, but to no avail, as the window calling this function must run message loop in order to receive the events (and my console window didn't, no matter if I set OutOfContext or InContext flag).
Is there a way I can make my console application run, show itself in taskbar, then hide itself (or never show itself in a first place) and just keep running with no window but taskbar button visible?
The normal way to get a button on the taskbar is to create a visible unowned top-level window. So that's no use to you. One possible alternative is to use ITaskbarList::AddTab to add a button. I don't know whether or not this will do anything for an invisible window. Either way you'd need to run a message loop for your window. Even if you could do this the net result would not feel very nice for the user.

Change Minimize Animation

I have an application that minimizes to the system tray. That all works well, the problem is that when minimized the animation goes towards the left side of the screen.
Is there a way to change it so the animation goes towards the tray?
No. This animation is handled by Windows, and since you are invoking the Minimize routine on the window, Windows will automatically animate the window into the location where the window's button is on the taskbar. If you're looking for a "quick solution", there isn't one.
The most you could do is change the window's behavior so that when it's minimized, it actually closes instead. This would prevent the fly-down animation into the taskbar, and Windows would perform the window close animation instead, which may look more consistent with your application design. A lot of other tray icon programs handle it this way.
If you really want to change the window's animation, you will need to override any Windows window management features with your own, that way when the window is "minimized" (or closed), you can animate your window to appear to move into the notification area on the right.

Having a window with ShowInTaskbar, Topmost, but also a notification area icon

I have a program I want to be able to handle all three states:
Not showing in taskbar, acting just as a widget like the Windows sound, network programs etc
Showing in taskbar - but not Topmost. The window would still show the notification area icon, and should still behave in the same way as #1, but also show the window in the taskbar.
Showing in taskbar with topmost. The window should behave the same as #2, but now the window will show topmost. Note: it should still be capable of being minimised, in the same way that clicking on a taskbar icon minimises a program.
These are my criteria, and I have been working on having them all working nicely together, but I can't seem to get the last few tweaks ironed out. #1 is fine - I have sorted that out easily enough. #2 and #3 cause more issues.
My first question is, how does Windows handle the user clicking on a taskbar icon to get it to minimise/switch back to normal? As I'd prefer to emulate that with #2 and #3.
For #1 I currently hide the window simply by setting Window.Visibility to Visibility.Hidden. And to show the window, call Show() and then Activate().
Like I said, for #2 and #3, I'd like to copy what Windows does when the user clicks on the taskbar icon. Can I do that? Or would I have to find another way to do this?
1- this is called thumbnail buttons
You can check http://elegantcode.com/2010/12/17/wpf-adding-thumbnail-buttons-to-windows-7-task-bar/ OR http://shareourideas.com/2010/12/19/windows-7-taskbar-thumbnail-buttons-in-wpf/ OR http://msdn.microsoft.com/en-us/library/ff699128.aspx
2- there is property called TopMost in the Window class.
3- for the taskbar icon
you can use this library it is easy to use and powerful http://www.codeproject.com/Articles/22876/WPF-Taskbar-Notifier-A-WPF-Taskbar-Notification-Wi
4- to minimize and maximize you can simply use
this.WindowState = FormWindowState.Maximized;
* that is all the info you need to create your application as you want, if you face any problems read the articles well if the problem still there find where is the problem exactly and ask again.
hope this help...

How do you display Taskbar notifications?

How would one go about displaying taskbar notifications?
I want to write an app that periodically displays a flash card esque notification, the intention is to see if a 5 second or so distraction every hour can help with language learning.
In .NET you can use the Notification Icon to place a notification in the system tray.
For the application you describe, I probably wouldn't use a notification icon or taskbar icon. You'll likely need a larger window displayed, with larger font.
I'd open a frameless window (possibly faded or scrolled into view) that sits in the lower-left of the desktop. (Although of course remember that not everyone has the taskbar at the bottom of the screen).
As an example, look at what Outlook or many RSS readers do to notify of new messages - this feature is commonly called a "toast" pop-up.

Categories

Resources