Windows 8 like modal dialog using WPF - 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();

Related

Minimize application during active ProgressDialog

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.

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.

AutoComplete-ready ComboBox in Silverlight 3

Has anybody out there had a situation where you needed to implement an "editable" ComboBox in Silverlight? My client wants a ComboBox in their UI that allows the user to place focus on the selection box and start typing to automatically pull up the desired value from the available items, rather than requiring use of the drop-down list.
This feature is available, I know, in several implementations from third parties. For example, you can make this happen fairly easily with Telerik's RadControls for Silverlight. However, my client is restricted to using the Silverlight 3 Toolkit, with no third-party tools or plug-ins.
Any suggestions for a quick, down-and-dirty implementation? Any guidance or links are appreciated!
Thanks,
Jeff
Okay, we had the same problem.
We went ahead and used the AutoCompleteBox from the Silverlight 3 tookit. Their implementation has a lot of things missing that we wanted. Because of these limitations, we created our own that inherited from it. It worked great and was very simple to do. Any tutorial for making your own control that inherits from another will help you.
Have fun. Since the toolkit is open source, you can always look at the code for guidance.
You can see the samples from the toolkit here: https://www.silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/default.html

Login Window to Main Window in Prism (WPF)

I've been trying to figure out how to use Prism but I'm a bit lost right now on how to implement a feature on my small project... maybe I just dont know how to do it as I'm really new to WPF and the whole composition type of application as I was a Graphic/Web designer with an urge to learn more about programming. I friend of mine suggested that I should learn WPF and I did... I'm pretty good now with designing UI and the other things that makes it move. Last night I was able to write a WCF service and connect my WPF application to it which was really neat.
i was browsing last night when I found Prism and it got me really interested but I'm not sure how to use it completely... For now, all I want to know is how to wire a Login screen to a main screen using Prism.. most of the examples I've seen load contents to a shell window but I have not seen any that uses a Login screen that would redirect a user to a Main Window once a user is validated.
Can anyone point me to the right direction? A sample project perhaps? I know i'm not good at this yet but I'm eager to learn.
Thanks!
-Kiersten
If you enter, for example, this search query in the Prism forums at Codeplex, you will get many threads that deal with this situation.
A particularly helpful one could be this one.
Searching for "login" also provides useful results, as many them explain what to do after the login has been performed, how to load modules depending on permissions, etc.

How would I create a silverlight control for tagging content similar to StackOverflow?

I am new to Silverlight. How would I go about creating a control for users to tag content.
I would like it to work like it does it StackOverflow i.e. Autocomplete and when you press space it inserts the tag in a box with a remove button. I want the control to be bindable to a collection of strings.
If someone can just point me in the right direction to get me started I would be very grateful.
You need to start with an AutoComplete Textbox, there is already one available in the Silverlight Toolkit. Tim Heuer has several examples using it (he actually creates one himself in one of his posts somewhere), you can find one sample here. Once you have this in place, the rest of the control is pretty simple.

Resources