Best ways to manage all the Data taken from Tables in a Database and stored in a WPF App - wpf

Hi i am trying to find the best way to manage the Data (that comes from tables in a Database) in your App.
My main question is, what is the best approach to take to then i successfully work with Bindings, Notifying Properties/Collections Changes?
My App is to manage the Inventory of all kind of things in an Enterprise, so i collect the Data to my App, and then i am using DataViews to store it? But this is the best approch to then i can work with bindings and Notifying Changes?
I am recently entering in WPF (about 2 months), the concept of ViewModel it's what i am trying to understand now, because seems that is the most thing used to manage the Data stored in an WPF App. Or maybe i am understanding all wrong.
What I am asking is for advices and examples to then i understand which is the best aprroach.
Note: In my case i have a Main Window with a DataGrid which have DataGridTextColumns and DataGridComboBoxColumns, and i have auxiliary Windows to manage Categories, Places and etc with ListViews.
Thanks in advance!

When we are talking about WPF, then of-course we are talking about MVVM pattern, its the best way :)
This link is the best start point for MVVM pattern:
MVVM for Beginners

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

MVVM architecture

I need to build our future business applications with WPF using MVVM.
My typical application consists of several windows/tab pages with grids and form style windows. Both edit windows and grid windows can be different depending on the logged in user, so most of them will be built datadriven.
And I'm trying to write as few code as possible, as not written code is the only one to be guaranteed error free .
So, now my question: how to structure the entire thing?
The View is clear to me - is is built using XAML or by code.
The ViewModel should contain the business logic and the validation rules and should let feed the View the data, and should contain the commands for the actions.
So, where to put the data? A select returns a DataTable. Should this datatable exposed through the ViewModel to the View for the grid windows?
And for the form windows? Should the single DataRow exposed trough the ViewModel to the View?
Are there other helper or intermediate classes needed?
Thank you for any useful suggestion!
Wolfgang
Its best way to go with WPF and MVVM,
I suggest before you start go thru the basics of MVVM. for your reference you can understand better here
The preferred UI paradigm in WPF is to have tab controls and grids in a single window, something like this:
You don't have to stop there, you can nest them as deeply as you need to for the sake of clarity.

how can a programmer work with a web designer with silverlight?

we want to develop a silver light application. I am the programmer. management want to improve the Userinterface, so they want a web designer join the development. I am using VS2010 to develop the application. I know there is a tool callled expression blend, which is for designer. how can we work together. What is the best practice with this team of two of us.
Thanks.
David
We have hired an outside design agency to help with the design for a large Silverlight LOB application. I would suggest that you start the process with paper and pencil, gather ideas, look & feel, etc. Also consider who your target audience is, we created Personas that represent specific types of user, if your users have an issue with the final UI/UX thats bad.
We then let the designer create parts of the UI in blend with nothing behind (or maybe a little just to test an idea or prove a point).
At the same time you can consider/design the overall flow of the application (screens/views/sub-views) and get your infrastructure running (ie. which MVVM approach you like, how to chop up the views with controls or usercontrols etc).
Bringing the visuals together with the code we then did at intervals. It proved to be an iterative process but having different perspectives as the project progressed helped smooth out issues as they presented.
Definitely talk through the process before starting.
Bit of a ramble but I hope this helps.
I don't know about best practices for your situation, but Expression Blend can open the same project and solution files as Visual Studio, so you can both work from the same codebase. Whether you'll be stepping on each others' toes or not is another story. Perhaps somebody else will have more of an idea as to how the developer/designer dynamic works when working with Silverlight apps.
I would start with understanding of MVVM pattern.
With MVVM pattern you can create two separate ViewModels for every View. One can be a real one with good functionality and the second one will be for the designer - to work with fake data in Blend. Then you can easily work on the functionality side of the application (ViewMode and Model) and the designer will tweak the GUI (View).
You can test in ServiceLocator if you're in Blend or in runtime and provide appropriate ViewModel.
One of the easiest (and good for working in Bled) MVVM framework is: MVVM Light Toolkit

Is it a good idea if I make use of REST concepts, combining it with MVVM in WPF?

I like the concept of REST wherein each page is stateless. However, I haven't seen anyone using it in windows application. Way back, when I'm still using MVC and MVP patterns, one of my setbacks is handling states.
I don't know if this is a good idea, but I like to know your opinion on this. :)
Thanks.
I guess it depends on how you implement this. My view models typically keep state in properties that the views can bind to. However, I have sometimes found it useful to keep that state information in a separate object, which my view model hangs on to. My view can still bind to it and it declutters my view model.
I've built two large winforms apps using REST and I'm starting to experiment with WPF. WPF should be even easier.
I use MVC on the server for my REST resources and MVC on the desktop.

what are the necessary steps to be keep in mind, if anybody wants to convert Normal WPF project to MVVM enabled one?

If anybody wants to convert a Normal WPF project to MVVM enabled one,
what are the main points to be keep in mind while restructuring the entire application.
What are the main hurdles to accomplish the task?
Go through:
http://msdn.microsoft.com/en-us/magazine/dd419663.aspxlink text
Separate all presentation logic in view model, buisness logic in model, keep view without codebehind(sometimes not possible) ?

Resources