Login Window to Main Window in Prism (WPF) - 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.

Related

WPF design pattern for "automated" applications (Don't think MVVM is suitable?)

I'm trying to get into WPF and have been reading articles saying MVVM is generally the way to go for WPF.
What about application that doesn't require user interactions such as button clicks?
An example would be a Card reader application:
User connect card.
Application read and display card info on screen.
Perform backend validation.
Display result on screen.
I could be wrong but I don't see MVVM being suitable for such application. Is there a more suitable design pattern that I should be considering instead?
The point of MVVM is to detach your views from your code.
Lets say in a month you need another view, you can easily create one without having to worry about "logic" being part of the view.
Mind you, some things are still easier done in the code behind ... but depending on your "purist" status, it'll vary.
Having said that, you can still happily use MVVM for your card application, and use the GUI to switch around and show different views ...
Last thing is I'll recommend picking an MVVM framework to help you jump start. There's plenty of them out there, varying in complexity and goals.
MvvmLight , Castel (?), Prism, Micro mvvm (?) ... run a quick search and see which you like .
Having said the above, let me shamelessly plug this article: The big mvvm template

How to display WPF overlay on top of DirectX?

I learned how to hook into the game EndScene function, but how to host WPF content is something I am trying a very long time to understand.
I am trying to do something like Overwolf, for a specific game (starcraft), I asked their team how they do it, but they didn't give any information.
So I tried to examine what exactly OverwolfLauncher.exe does, and I found it injects 3 dlls:
OWExplorer-2006.dll, OWLog.dll, OWClient.dll.
The first two seem not really important. The third hooks into the game directx or opengl dll, and their overlay manager does some "magic". And that's only what I was able to understand.
I would be happy if someone could explain me how exactly Overwolf managed to host WPF content as overlay.
There are many questions like this on stackoverflow.
This one was marked as solved, but the solution seems to be about hosting DirectX inside WPF.

Silverlight OOB User Menu Control

Well ... at the risk of sounding like I really don't know anything about programming, I have a question about controls in Silverlight 5.
I have an OOB App that I am working with, but I need to add the User Menus (File, Edit, etc.) that are normally seen at the top of all apps. There used to be a control in VS (the Menu control) that was easily configurable. What is the control used to create the User Menus in Silverlight 5? The Context Menu is not what I am asking about. That is the right mouse click menu ... so that's not the answer ...
Please, understand my problem. It's been since Silverlight 2 since I worked in Silverlight. I appreciate any information you kind folks would be willing to provide.
There is no such thing available directly from Microsoft (meaning it's neither built-in or present in the Silverlight Toolkit).
You will have to use third-party controls such as DevExpress or Telerik.
EDIT: Some more advice in response to your comment.
Another possibility is to create UIs from scratch. There are two forms of UIs that I found inspiring lately, both of which don't use any ribbons or drop-down menues at all. The first is to use "Windows 8"-like dashboards instead of traditional menues, the other is the Windows Azure Management Portal (a web application).
I don't use traditional UI frameworks for menues myself, but mostly because I don't like those approaches and I'm picky with how user interfaces should work and look like.
But obviously you have to make a serious time investment to go new ways. And it will heavily depend on your application what approach makes sense.
Here's one simple approach that could work in a number of cases, I used it for a database application (I call it the Windows-Phone-7/8 approach):
The screen is divided into the "page" area and information bars. The information bars contain no menues, just who's logged on, a back-button, a home-button, and context-sensitive buttons depending on what's in the view. So basically it behaves like a web browser and you navigate through the app by clicking on "links" (buttons that take you elsewhere).
There's only one page area, so no windows and no popups. I've gone to the extreme of making even dialog windows to be pages.
Now you need menues. You do that with "dashboards", ie. pages that present some overview stuff and buttons that lead to the other areas of your application.
Although you could have action buttons like save or delete on the page itself, I put them in the bottom bar (but they are still dependent on the page your on) - that is exactly how it works in Windows Phone 7/8.
One last advice: The real effort is usually not in the menus anyway. Beside your application logic itself, it's a lot of little things like login screen, error handling and how to present error messages (look at the windows azure management portal for how they did that really nicely) and gracefully failing on session timeout. There's also a lot of nuisance on how you manage your data (ria-services, etc.).
So as long as you don't need fancy data grid grouping, rich-text edit or excel-like pivot controls, a toolkit might not help you as much as you'd hope - because they give you only the controls, not the entire UI.

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();

WPF: How to make a Google Chrome style GUI in WPF/MVVM?

I bet you guys know Google Chrome browser, yeah it comes from Chromium open-source projects, added some Google specific features.
I found the multi-tab GUI is quite attractive, especially the "drag-and-drop" feature for tabs and windows:
to "pull a tab" out to form a separate window, or
vice versa, to join a tab into a windows (that has a collection of tabs).
This would be quite helpful for designing some multi-process applications to achieve the stability, and a cool user experience, but ... how?
is it possible to do this in WPF?
or even one step more, is it possible to do this in MVVM?
Yeah, technically, everything is possible, but I can't see an easy pattern to do this
for WPF, how to handle such specific "crossing window" mouse interaction?
for MVVM, hmmm, will this be too challenging for MVVM?
cheers
maybe you should have a look at these libs/frameworks:
http://fabtab.codeplex.com/
http://avalondock.codeplex.com/
http://fluidkit.codeplex.com/
Its definitely possible. I've recreated the chrome tab look in the past with MVVM, complete with drag and drop, and I know another guy who created a tabbed application that lets you "pull away" tabs into a new window of its own. I believe it was all one application with multiple windows, so all open windows were part of the same application even if they show up separately in the task bar.
I'm not sure if I have his source code or not, I'd have to go digging for it.

Resources