Click here to Skip to main content
15,900,816 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Value Conversions Pin
Geysser9-Oct-11 8:18
Geysser9-Oct-11 8:18 
GeneralRe: Value Conversions Pin
SledgeHammer019-Oct-11 9:02
SledgeHammer019-Oct-11 9:02 
AnswerRe: Value Conversions Pin
Pete O'Hanlon9-Oct-11 9:30
mvePete O'Hanlon9-Oct-11 9:30 
GeneralRe: Value Conversions Pin
Geysser10-Oct-11 5:55
Geysser10-Oct-11 5:55 
GeneralRe: Value Conversions Pin
Pete O'Hanlon10-Oct-11 6:12
mvePete O'Hanlon10-Oct-11 6:12 
GeneralRe: Value Conversions Pin
SledgeHammer0110-Oct-11 10:03
SledgeHammer0110-Oct-11 10:03 
GeneralRe: Value Conversions Pin
SledgeHammer0110-Oct-11 11:13
SledgeHammer0110-Oct-11 11:13 
GeneralRe: Value Conversions Pin
SledgeHammer0111-Oct-11 5:10
SledgeHammer0111-Oct-11 5:10 
It was only a quick example of partial classes, not production or working code. You kind of missed my point(s) though:

1) code generators such as ado.net, wcf, etc. *already give* you partial classes, might as well take advantage.
2) partial classes are not in the VM, they are in the partial class.
3) often times, you need to pass in multiple objects to value converters so you have all the info you need... heck, I've written a value converter when I needed to pass in 7 objects. SEVEN!
4) the VM doesn't set the properties, the object does.

Here, since you didn't like my previous example, I'll give you a better one. Lets say you wanted the TxtColor to be black unless the persons age was < 21 where it would be red. Ok, so a value converter would pretty much just need the age, not a big deal. But the partial class would just expose an additional TxtColor property. It would also watch for changes to the 'Age' property so it could update itself.

Lets say that to decide on the TxtColor you needed additional input... the age, maybe the value of a radio button, the value of a check box, the type of user, etc. Now you are starting to grab the data from so many places that you need to pass a lot into the value converter. Since that happens via data binding, you add an additional expense as well. Could be useful if some of those values are going to change of course Smile | :) , but if its just a static property, a value converter is not really the best solution.
QuestionCustom Strtpage Namespace Problem Pin
Kevin Marois7-Oct-11 8:53
professionalKevin Marois7-Oct-11 8:53 
AnswerRe: Custom Strtpage Namespace Problem Pin
Alisaunder7-Oct-11 9:35
Alisaunder7-Oct-11 9:35 
GeneralRe: Custom Strtpage Namespace Problem Pin
Kevin Marois7-Oct-11 10:05
professionalKevin Marois7-Oct-11 10:05 
GeneralRe: Custom Strtpage Namespace Problem Pin
Kevin Marois7-Oct-11 10:41
professionalKevin Marois7-Oct-11 10:41 
QuestionUnable to click or select TextBox in WPF? [SOLVED] Pin
Alisaunder6-Oct-11 5:29
Alisaunder6-Oct-11 5:29 
AnswerRe: Unable to click or select TextBox in WPF? Pin
SledgeHammer016-Oct-11 6:33
SledgeHammer016-Oct-11 6:33 
GeneralRe: Unable to click or select TextBox in WPF? Pin
Alisaunder6-Oct-11 6:40
Alisaunder6-Oct-11 6:40 
GeneralRe: Unable to click or select TextBox in WPF? Pin
Pete O'Hanlon6-Oct-11 7:14
mvePete O'Hanlon6-Oct-11 7:14 
GeneralRe: Unable to click or select TextBox in WPF? Pin
Alisaunder6-Oct-11 8:04
Alisaunder6-Oct-11 8:04 
GeneralRe: Unable to click or select TextBox in WPF? Pin
SledgeHammer016-Oct-11 7:26
SledgeHammer016-Oct-11 7:26 
GeneralRe: Unable to click or select TextBox in WPF? Pin
Alisaunder6-Oct-11 8:02
Alisaunder6-Oct-11 8:02 
GeneralRe: Unable to click or select TextBox in WPF? Pin
SledgeHammer016-Oct-11 8:23
SledgeHammer016-Oct-11 8:23 
AnswerRe: Unable to click or select TextBox in WPF? Pin
Alisaunder23-Oct-11 2:32
Alisaunder23-Oct-11 2:32 
QuestionPRISM - When is the module catalogue's modules registered with the container? Pin
Phillip Donegan4-Oct-11 22:13
Phillip Donegan4-Oct-11 22:13 
AnswerRe: PRISM - When is the module catalogue's modules registered with the container? Pin
Abhinav S5-Oct-11 2:04
Abhinav S5-Oct-11 2:04 
Questionxps file Pin
Aartemis4-Oct-11 5:41
Aartemis4-Oct-11 5:41 
AnswerRe: xps file Pin
Pete O'Hanlon4-Oct-11 5:50
mvePete O'Hanlon4-Oct-11 5:50 

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.