Click here to Skip to main content
15,887,683 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How to place a multiple window controls inside one window control in WPF Pin
Pete O'Hanlon6-Sep-11 2:57
mvePete O'Hanlon6-Sep-11 2:57 
GeneralRe: How to place a multiple window controls inside one window control in WPF Pin
Wayne Gaylard6-Sep-11 3:00
professionalWayne Gaylard6-Sep-11 3:00 
AnswerRe: How to place a multiple window controls inside one window control in WPF Pin
Pete O'Hanlon6-Sep-11 2:15
mvePete O'Hanlon6-Sep-11 2:15 
QuestionWPF - basic data binding and "Save" x "Cancel changes" Pin
Member 10339075-Sep-11 5:33
Member 10339075-Sep-11 5:33 
AnswerRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
Pete O'Hanlon5-Sep-11 5:40
mvePete O'Hanlon5-Sep-11 5:40 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
SledgeHammer019-Sep-11 10:01
SledgeHammer019-Sep-11 10:01 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
SledgeHammer019-Sep-11 10:46
SledgeHammer019-Sep-11 10:46 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
SledgeHammer019-Sep-11 11:14
SledgeHammer019-Sep-11 11:14 
Collin Jasnoch wrote:
Soo how do you expect the IEditableObject to do this work??? (if you read Pete's
blog he even says that his EditableObject uses reflection....). Also reflection
is not that slow. I mean if this has to occur over and over (like 100's of time
in seconds.. why would this be though???) and the object is very large (consider
refactoring) you may want a different option (again.. I do not see how the
IEditableObject solves this.. it is merely an interface, NOT an implimentation
of it).


Are you familiar with how IEditableObject works? You just implement 3 standard methods any way you want. If I was doing it? Well, I'd have my base object implement ICloneable and use that to clone the object properly. That has the benefit of being another standard interface that other people might want to use and is more performant then reflection. You *COULD* implement your ICloneable to copy the object with reflection, but thats just plain silly.

I highly suggest you run some performance benchmarks on reflection and see just how slow it is.

Collin Jasnoch wrote:
So were you planning on binding some UI elements to private properties??? Or
'Complex' properties as you put it? If so, the logic is already there... Because
you already implimented it. Also, if you want it to support private fields you
can certainly impliment that (I did not because I had no need for it)


OK, adding support for private properties was just a minor nitpick and that is trivial... but yeah, I'm binding to a complex property right now as I type this. How is your code going to handle:

Dictionary<string, Dictionary<string, CMTInfo[]>>

?

Thats a valid "complex" type that I'm binding to a TreeView.

Collin Jasnoch wrote:
Do you really think the OP requires this anywhere???


Yeah, cuz, NOBODY uses the data grid Smile | :) . Data grid used IEditableObject as one example of a popular control that uses it.

Collin Jasnoch wrote:
On a last point, even if you provide a nice implimentation of IEditableObject
(that somehow does NOT use reflection), you are now forcing a base class on an
object for simple functionality (see post above.. what like 10 lines of
code).


Whats your point? Anything you bind to in the UI needs to implement INotifyPropertyChanged / INotifyCollectionChanged anyways. Whats another small interface?

Anyways, even if you want to use the code you posted above, thats fine, but I'd still wrap it in an IEditableObject interface so it can be used with controls.

My initial objection was not that you were using reflection (although it IS slow and you aren't caching ANY of the really slow reflection methods), it was that you weren't using IEditableObject.
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
SledgeHammer019-Sep-11 12:47
SledgeHammer019-Sep-11 12:47 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
Alisaunder12-Sep-11 6:32
Alisaunder12-Sep-11 6:32 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
SledgeHammer0112-Sep-11 6:44
SledgeHammer0112-Sep-11 6:44 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
Member 103390713-Sep-11 22:47
Member 103390713-Sep-11 22:47 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
Pete O'Hanlon13-Sep-11 22:59
mvePete O'Hanlon13-Sep-11 22:59 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
Member 103390714-Sep-11 2:05
Member 103390714-Sep-11 2:05 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
Pete O'Hanlon14-Sep-11 2:15
mvePete O'Hanlon14-Sep-11 2:15 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
Mycroft Holmes13-Sep-11 23:27
professionalMycroft Holmes13-Sep-11 23:27 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
Pete O'Hanlon14-Sep-11 23:13
mvePete O'Hanlon14-Sep-11 23:13 
QuestionCall the client program Pin
luozi20114-Sep-11 14:55
luozi20114-Sep-11 14:55 
AnswerRe: Call the client program Pin
Pete O'Hanlon4-Sep-11 20:08
mvePete O'Hanlon4-Sep-11 20:08 
QuestionConverting an Bitmap to ImageSource problem Pin
Mike Hankey4-Sep-11 10:31
mveMike Hankey4-Sep-11 10:31 
AnswerRe: Converting an Bitmap to ImageSource problem Pin
RichardGrimmer5-Sep-11 5:25
RichardGrimmer5-Sep-11 5:25 
GeneralRe: Converting an Bitmap to ImageSource problem Pin
Pete O'Hanlon5-Sep-11 5:30
mvePete O'Hanlon5-Sep-11 5:30 
GeneralRe: Converting an Bitmap to ImageSource problem Pin
RichardGrimmer5-Sep-11 5:33
RichardGrimmer5-Sep-11 5:33 
GeneralRe: Converting an Bitmap to ImageSource problem Pin
Pete O'Hanlon5-Sep-11 5:37
mvePete O'Hanlon5-Sep-11 5:37 
GeneralRe: Converting an Bitmap to ImageSource problem Pin
Mike Hankey5-Sep-11 9:57
mveMike Hankey5-Sep-11 9:57 

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.