WPF Desktop application and design patterns - wpf

I have to develop a desktop application and the back end will be SQL Express.
I am new to wpf.
Any design patterns i can use? any sample application for wpf with db?
Please help me.

Prism 4 is by Microsoft Patterns and Practices team and it advocates MVVM, Dependency Injection, and modular application development. The book (which I bought and read) is now free online. The book covers several design practices and should be a fairly good start to everything you would need to know to write maintainable, testable, flexible applications in WPF. Prism is also a framework which aids in modular app development and MVVM. It is also fairly popular.
Prism 4.1
^ Seriously, read this book. It takes 2 days max.

As per my suggestion MVVM pattern would be nice if you use in your application. Because it has many ways to reuse your code.
You can find tutorial on the same at below links:
http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
http://www.codeproject.com/Articles/126249/MVVM-Pattern-in-WPF-A-Simple-Tutorial-for-Absolute
http://wpftutorial.net/MVVM.html
Let me know if you need more help.

You can use MVVM design pattern, It will help you to Reuse of code, Flexibility and Customization, Separation of the UI design and development , Testing ...
Refer these article to understand the MVVM pattern and also for sample WPF application..
http://www.codeproject.com/Articles/278901/MVVM-Pattern-Made-Simple
http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
http://msdn.microsoft.com/en-us/library/gg405484%28v=pandp.40%29.aspx

Related

PRISM to angular migration feasible or not

I have an old project which has been done by someone in Silverlight with PRISM. I want to migrate front-end to angular2. Is it feasible? Because I am totally un-aware of PRISM. Is PRISM works on traditional old form submission or with webservices? I am familiar with angular2 and dont know much about PRISM.
please guide.
As far as the technical aspects are concerned, these are different frameworks and your team will have some learning curve if you dont already know angular2.
Yes PRISM works with services and it help you design Windows Presentation Foundation (WPF) desktop applications in conjunction with MVVM pattern. PRISM is about separation of concerns and loose coupling and helps you design applications using loosely coupled components that can evolve independently.
To me, migration is more of a strategic decision, if you have healthy customer base and your app is going to stay for quite some time then at some stage you have to leave the older technologies and move towards the trending ones.

Retired Content Model View Presenter on MSDN

I am learning to develop windows forms application with Entity Framework using Model View Presenter pattern, since it is the suggested design pattern for windows forms development on stackoverflow. On the other hand, there is a 'retired content' note on every article about MVP, on MSDN.
This is quite confusing, as I don't whether I should continue learning about MVP and try to implement it in windows forms development or there is another better design pattern that I should follow.
Any suggestion?
links:
http://msdn.microsoft.com/en-us/library/ff647543.aspx
http://msdn.microsoft.com/en-us/library/ff649820.aspx
For WinForms you should stick with MVP (Supervising Controller).
The reason you are seeing retired content is because Microsoft is heavily invested in the new Windows 8, Metro Style applications. WinRT built using C++, C# and WPF, or HTML5 + JavaScript are going to be what you will build applications in going forward, so it makes sense to learn at least one of those.
WinForms isn't officially deprecated, but don't expect it to get a lot of love from MS. I would spend some time learning XAML, and the MVVM pattern. That being said, the concepts for all UI design patterns (MVC, MVP, MVVM) are all very similar, so learning one will help you understand the others.

Compare and contrast Caliburn v. MVVM Light Toolkit (mainly for Silverlight)?

I want to learn more about a MVVM framework but I don't have a lot of time to devote. Does someone have experience with Caliburn (or micro Caliburn) and MVVM Light Toolkit and can give some reasons to start with one framework over the other? This would mainly be for Silverlight development.
Or perhaps is there another framework that might be easier to start with?
thanks
Have a look at this nice article that provides a summary and comparison of various MVVM frameworks - http://www.japf.fr/2009/10/a-quick-tour-of-existing-mvvm-frameworks/. The choice of an MVVM framework depends on the time available and the complexity of your project. If you wish to learn how to use a MVVM framework, it is best to work on a small project first in which you explore one or more frameworkss. MVVMLight and Caliburn are popular frameworks and they are used by both Silverlight and Windows Phone 7 developers. There are numerous sample applications available on the web that illustrate the use of these frameworks.
HTH, indyfromoz

how start implement MVVM pattern

=======
So i decide to to develop my asp.net site into Silverlight.
I today start to search articles about MVVM pattern which i want use in my Silverlight app, and i am confused :/ It's hart to me understand how works this pattern. I am find 3 frameworks which supports MVVM pattern in Silverlight - Caliburn, MVVM Light Toolkit and GoodLight.
Should i start from own implementation of pattern or use framework?
Is this frameworks only a project solutions in which i can insert my code?
Which framework is the best for novice and which for professional?
I ask for this, cause i must start to rewrite my app from asp.net to Silverlight and i don't know that i can do it first and later (when i understand MVVM pattern and framework) implement this pattern in finished app ? Or from begining rewrite project to MVVM framework?
Going from ASP.NET to Silverlight is likely to require a (nearly) complete rewrite. The usage scenario is quite different. Silverlight is all about providing a client-side like development environment - it makes it so you can write an application the same way you'd write a client-side, desktop application, but execute this within the context of a browser.
This has fairly broad implications on how you'd use and develop your software.
That being said - for frameworks... Personally, I'd recommend getting a good grasp of MVVM first, then choose a framework (if any). MVVM is really a simple architectural design pattern. Once you understand it, the frameworks will make more sense. It's difficult to suggest "pick this framework", since they all add their own, valuable, additions and ways of working.
There are many good sources for learning about MVVM. Personally, (I'm being biased here), I like the intro I wrote (even if it's WPF oriented instead of SL oriented, the concepts are the same). That being said, Jerimiah Morrill's MVVM for Tards is also very good to get a basic understanding of what, exactly, it means when you say MVVM.
Once you understand this, the frameworks will be much more approachable (or avoidable, if you don't want them).

Do you know any real-world, useful WPF/Silverlight applications using MVVM?

I'm looking for code of full applications that (1) use the MVVM pattern and (2) are approachable for WPF/Silverlight/MVVM beginners. So far I have only found:
Crack.NET - A runtime debugging and scripting tool (useful but quite complicated)
CipherText - WPF Password Manager (perfect but written in VB.NET)
What are some others?
preferably smaller helper apps or tools that use MVVM but that have a completed feel, perhaps with WPF/Silverlight graphic/animation goodness, etc. which show not only the MVVM concepts being used but in a context of a real-world, completed application
My Contribution
Thanks for all the tips, I collected together a list of 15+ MVVM code examples and posted the here:
Overview of WPF/Silverlight code examples that help you learn MVVM.
I too class myself as a beginner in MVVM developing a large scale application for about a month now. I'm over most of the main hurdles, but keep getting confused up by a few things.
Be careful with the suggestions from Kent. They'll get you started, but the subtle differences in Silverlight and WPF will trip you up occasionally (triggers are one).
I don't know of any full sites, but I started with the Composite Application Guidance and PRISM libraries. These a little too cumbersome for a 'beginner' and just MVVM, but some of the concepts are very useful (event aggregator for example).
I suggest that you read blogs by Josh Twist, Josh Smith, Shaun Wildermuth and Nikhil Kothari. These guys are very knowledgeable. They are also very open to answering questions too.
What is your development background? Some of the concepts surrounding method calls, responses and delegation are a real break from "traditional sequential" coding techniques.
Given the question, you may be interested in the current effort going on to create a "Pet Shop" type reference implementation for M-V-VM. You can join the conversation or follow progress here.
I've been using MVVM for the last couple of months on a project and it's been fantastic. I've been doing UI work for over 12 years and it's the best thing I've come across.
I have been using MVVM for about 2 years now, and I can say that it is a resounding success. I have shipped one large-scale medical imaging solution using MVVM in Silverlight. I am also about to ship a complicated WPF application using Prism and MVVM extensively. In fact, I don't know how I'd achieve some of my problems elegantly without MVVM in this more recent application.
+1 on MVVM. It works. It is testable. It is extensible. It facilitates developer-designer workflows. It ALSO doesn't have to be messy and plumbing-heavy.
In addition, I created a medium-sized Silverlight application using MVVM for the CodeMash conference in January. You can see it and get the source code here.
Try this one. Also, Family.Show may be useful.
The WPF Disciples group has decided to create a real-world MVVM + Mediator reference application similar to the Pet Shop refence application for Web Apps. Your can follow the development on codeplex here

Resources