Click here to Skip to main content
15,895,011 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Best Way To Do This Pin
Renat Khabibulin4-May-11 16:55
Renat Khabibulin4-May-11 16:55 
AnswerRe: Best Way To Do This Pin
RichardGrimmer20-May-11 3:58
RichardGrimmer20-May-11 3:58 
QuestionWCF RIA / MVVM Question Pin
eddieangel4-May-11 11:33
eddieangel4-May-11 11:33 
AnswerRe: WCF RIA / MVVM Question Pin
Pete O'Hanlon4-May-11 12:25
mvePete O'Hanlon4-May-11 12:25 
QuestionHow do I databind a ListView to a property in child collection in WPF? Pin
B2C4-May-11 3:01
B2C4-May-11 3:01 
AnswerRe: How do I databind a ListView to a property in child collection in WPF? Pin
RichardGrimmer4-May-11 4:33
RichardGrimmer4-May-11 4:33 
GeneralRe: How do I databind a ListView to a property in child collection in WPF? Pin
B2C4-May-11 5:15
B2C4-May-11 5:15 
GeneralRe: How do I databind a ListView to a property in child collection in WPF? Pin
SledgeHammer014-May-11 7:00
SledgeHammer014-May-11 7:00 
You are re-creating the State object for every County object which is *REALLY* bad and will come back to bite you down the road. Not because of memory concerns (well, that is an issue too), but the bigger problem is that you will screw up data binding.

Lets say you have 100 counties that have State = California. As you have it implemented, there will be 100 County objects and 100 State (California) objects. Now lets say your UI is binding to County.State.NickName for each of the 100 County objects. If you change NickName in one of the State (California) objects, it will not get reflected in the other 99 counties because those will all be considered different instances. I.e. your UI will be bound to 100 *different* State objects instead of the same one.

There are only 50 states, so what I think you want to do here is have a singleton "States" array that contains the 50 states and have the County just point to the one state object from that array... actually a dictionary might be more appropriate... so you could do something like:

public County()
{
State = States["CA"];
State = States["NY"];
}

etc.

That way if a state is updated, you are guaranteed that anything that is referencing it will also get updated.
GeneralRe: How do I databind a ListView to a property in child collection in WPF? Pin
AspDotNetDev4-May-11 7:59
protectorAspDotNetDev4-May-11 7:59 
AnswerRe: How do I databind a ListView to a property in child collection in WPF? Pin
Ian Shlasko4-May-11 5:40
Ian Shlasko4-May-11 5:40 
QuestionPrintable Area's Size - SL Printing API Pin
jadughar4-May-11 0:38
jadughar4-May-11 0:38 
AnswerRe: PageVisual's Size - SL Printing API Pin
Pete O'Hanlon4-May-11 2:18
mvePete O'Hanlon4-May-11 2:18 
GeneralRe: PageVisual's Size - SL Printing API Pin
jadughar4-May-11 4:24
jadughar4-May-11 4:24 
QuestionMVVM Pin
arkiboys3-May-11 22:50
arkiboys3-May-11 22:50 
AnswerRe: MVVM Pin
Dave Kerr3-May-11 23:09
mentorDave Kerr3-May-11 23:09 
GeneralRe: MVVM Pin
arkiboys3-May-11 23:19
arkiboys3-May-11 23:19 
QuestionSilverlight Compatibility with existing C#2.0 libraries Pin
insanechingi3-May-11 22:14
insanechingi3-May-11 22:14 
AnswerRe: Silverlight Compatibility with existing C#2.0 libraries Pin
Pete O'Hanlon3-May-11 23:14
mvePete O'Hanlon3-May-11 23:14 
QuestionSilverlight best Printing solution ??? Pin
jadughar2-May-11 4:08
jadughar2-May-11 4:08 
AnswerRe: Silverlight best Printing solution ??? Pin
Pete O'Hanlon2-May-11 9:40
mvePete O'Hanlon2-May-11 9:40 
AnswerRe: Silverlight best Printing solution ??? Pin
Mycroft Holmes2-May-11 13:10
professionalMycroft Holmes2-May-11 13:10 
GeneralRe: Silverlight best Printing solution ??? Pin
jadughar3-May-11 23:36
jadughar3-May-11 23:36 
AnswerRe: Silverlight best Printing solution ??? Pin
Abhinav S2-May-11 18:59
Abhinav S2-May-11 18:59 
GeneralRe: Silverlight best Printing solution ??? Pin
jadughar2-May-11 22:32
jadughar2-May-11 22:32 
AnswerRe: Silverlight best Printing solution ??? Pin
thrakazog3-May-11 6:25
thrakazog3-May-11 6:25 

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.