Click here to Skip to main content
16,008,469 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: XmlDocument Pin
#realJSOP19-Feb-11 2:34
professional#realJSOP19-Feb-11 2:34 
GeneralRe: XmlDocument Pin
Abhinav S19-Feb-11 3:14
Abhinav S19-Feb-11 3:14 
QuestionAccess xml file from .xaml page Pin
arkiboys18-Feb-11 5:16
arkiboys18-Feb-11 5:16 
AnswerRe: Access xml file from .xaml page Pin
Abhinav S18-Feb-11 6:24
Abhinav S18-Feb-11 6:24 
QuestionMVVM: Best Practices and Design Patterns Pin
IngoVals18-Feb-11 4:54
IngoVals18-Feb-11 4:54 
AnswerRe: MVVM: Best Practices and Design Patterns Pin
Abhinav S18-Feb-11 6:20
Abhinav S18-Feb-11 6:20 
AnswerRe: MVVM: Best Practices and Design Patterns Pin
SledgeHammer0118-Feb-11 6:56
SledgeHammer0118-Feb-11 6:56 
AnswerRe: MVVM: Best Practices and Design Patterns Pin
BubingaMan22-Feb-11 4:35
BubingaMan22-Feb-11 4:35 
1. This seems to me that you think of view models as being representations of entities. While in a lot of cases, you will indeed find such correlation, I prefer to think of viewmodels as representations that describe what the view looks like. Having said that, there's nothing wrong with viewmodels that have other viewmodels as properties. In the end, a viewmodel is just an object implementing INotifyPropertyChanged and coupled to xaml via binding.

The structure of your view/model can be (should be?) reflected by the other.
A viewmodel customer can thus have a collection "invoices" while each invoice has a collection "invoiceDetails".
In the xaml, you'ld bind that customer object to the datacontext of a customer control (or grid or whatever you use to represent your customer). Inside that control, you could have an itemscontrol for example to wich you bind the invoices and on that itemscontrol another itemscontrol to bind the details.
There's also nothing wrong with binding the invoices to a combobox for example and only fetching the details of that invoice once it is selected to show that in another itemscontrol etc etc.

In short: it would kinda depend on your user interface.

2. I have never uses iEditableIObject, but have implemented similar systems myself to find out if a viewmodel is "dirty". An undo would (in that system) result in a reload of the dirty object. Perhaps I reïnvented the wheel there, I dunno. It worked fine and clean though.

3. As said allready, you could use WCF polling for this. Usually though, this really isn't done unless there are specific requirements that need such a feature. Unless you plan on caching the whole database, each request would be a new business call, so the data will always be reloaded from the database anyway - giving you the "last version" every call.

4. Personally, I'm not a fan of linq entities, but to each his own. One thing that isn't really personal though is that you should try to keep business entities inside your business layer. Business entities should never leave your business. Use DTO's instead. You can use these dto's binding if all you need to do is show the information on screen. Mostly, you'll want to initisialise viewmodels from these dto's instead.

5. There are dozens of ways to accomplish this, all of wich require some coding. There's no generic way of doing this as far as I know. Me, I'ld probably create a template (or even control if usefull) for each type of detail and show the correct one based on some property in the viewmodel detailing the type that should be used (through binding).

I hope that was somewhat helpfull.
QuestionOpen WPF Application from within Excel Add-In Pin
muelito18-Feb-11 3:18
muelito18-Feb-11 3:18 
Question2 different styles - 2 different objects - both affected the same way??? Pin
bigwillyca17-Feb-11 6:35
bigwillyca17-Feb-11 6:35 
AnswerRe: 2 different styles - 2 different objects - both affected the same way??? Pin
dasblinkenlight18-Feb-11 3:06
dasblinkenlight18-Feb-11 3:06 
GeneralRe: 2 different styles - 2 different objects - both affected the same way??? Pin
bigwillyca18-Feb-11 5:02
bigwillyca18-Feb-11 5:02 
QuestionHow to sort the items under some node in Silverlight tree view? Pin
Tesic Goran17-Feb-11 3:20
professionalTesic Goran17-Feb-11 3:20 
AnswerRe: How to sort the items under some node in Silverlight tree view? Pin
SledgeHammer0117-Feb-11 7:14
SledgeHammer0117-Feb-11 7:14 
GeneralRe: How to sort the items under some node in Silverlight tree view? Pin
Tesic Goran17-Feb-11 19:35
professionalTesic Goran17-Feb-11 19:35 
Answersymbols not loaded Pin
cmichaelgraham17-Feb-11 3:04
cmichaelgraham17-Feb-11 3:04 
GeneralRe: symbols not loaded Pin
SledgeHammer0117-Feb-11 7:12
SledgeHammer0117-Feb-11 7:12 
GeneralRe: symbols not loaded Pin
Abhinav S17-Feb-11 17:49
Abhinav S17-Feb-11 17:49 
QuestionHow to restyle tab control in WPF Pin
Tridip Bhattacharjee16-Feb-11 23:09
professionalTridip Bhattacharjee16-Feb-11 23:09 
AnswerRe: How to restyle tab control in WPF Pin
SledgeHammer0117-Feb-11 7:10
SledgeHammer0117-Feb-11 7:10 
QuestionOpen a new Window from a Page in silverlight 4.0 Pin
Member-495917616-Feb-11 22:54
Member-495917616-Feb-11 22:54 
AnswerRe: Open a new Window from a Page in silverlight 4.0 Pin
#realJSOP17-Feb-11 7:11
professional#realJSOP17-Feb-11 7:11 
Questionbackground worker Pin
arkiboys14-Feb-11 3:48
arkiboys14-Feb-11 3:48 
AnswerRe: background worker Pin
Pete O'Hanlon14-Feb-11 10:08
mvePete O'Hanlon14-Feb-11 10:08 
GeneralRe: background worker Pin
arkiboys15-Feb-11 2:40
arkiboys15-Feb-11 2:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.