Click here to Skip to main content
15,881,882 members
Home / Discussions / C#
   

C#

 
AnswerRe: App Without Installation Pin
Eddy Vluggen27-Oct-12 4:28
professionalEddy Vluggen27-Oct-12 4:28 
QuestionBest way for 'OK' and 'Cancel' button implementation in a modal dialog Pin
Praveen Raghuvanshi26-Oct-12 9:40
professionalPraveen Raghuvanshi26-Oct-12 9:40 
AnswerRe: Best way for 'OK' and 'Cancel' button implementation in a modal dialog Pin
cocis4826-Oct-12 11:13
cocis4826-Oct-12 11:13 
GeneralRe: Best way for 'OK' and 'Cancel' button implementation in a modal dialog Pin
Praveen Raghuvanshi27-Oct-12 7:39
professionalPraveen Raghuvanshi27-Oct-12 7:39 
AnswerRe: Best way for 'OK' and 'Cancel' button implementation in a modal dialog Pin
Eddy Vluggen27-Oct-12 4:34
professionalEddy Vluggen27-Oct-12 4:34 
GeneralRe: Best way for 'OK' and 'Cancel' button implementation in a modal dialog Pin
Praveen Raghuvanshi27-Oct-12 7:45
professionalPraveen Raghuvanshi27-Oct-12 7:45 
GeneralRe: Best way for 'OK' and 'Cancel' button implementation in a modal dialog Pin
cocis4827-Oct-12 16:01
cocis4827-Oct-12 16:01 
AnswerRe: Best way for 'OK' and 'Cancel' button implementation in a modal dialog Pin
BobJanova29-Oct-12 0:38
BobJanova29-Oct-12 0:38 
There are essentially two ways to do this. The first is what you've done: copy the object, have the dialog operate on that copy, and update the original if you press OK. The second is rather similar, but instead of having a copy of the base data object to operate on, you operate on a specific data object for the form (i.e. it has properties for the fields that are editable on this form only), and if you press OK you assign all the properties from that data object into the source.

In the second case the data object can actually be the form itself, particularly with WPF's data binding that allows you to have UI controls display numbers, enum choices etc simply. This is normally what I do.

Re undo/redo, you need to save a command when you change the original object, i.e. press OK. Do you need to be able to undo each thing individually? ... I would normally expect 'Edit Object' to end up as a single undo action which is easier (you just have a command which stores the properties that were changed and the previous value, or even the whole before and after states, of the source object). If you do need undo entries for every dialog interaction then you need to have a local command stack within the dialog, and when you save the object you can execute them all in order on the source object and push them onto the global undo stack against that object.
GeneralRe: Best way for 'OK' and 'Cancel' button implementation in a modal dialog Pin
Praveen Raghuvanshi31-Oct-12 7:59
professionalPraveen Raghuvanshi31-Oct-12 7:59 
QuestionInvoking a method using its 'string' name Pin
PozzaVecia26-Oct-12 8:28
PozzaVecia26-Oct-12 8:28 
AnswerRe: Invoking a method using its 'string' name Pin
jschell26-Oct-12 8:46
jschell26-Oct-12 8:46 
GeneralRe: Invoking a method using its 'string' name Pin
BobJanova29-Oct-12 0:40
BobJanova29-Oct-12 0:40 
GeneralRe: Invoking a method using its 'string' name Pin
jschell29-Oct-12 8:27
jschell29-Oct-12 8:27 
GeneralRe: Invoking a method using its 'string' name Pin
BobJanova29-Oct-12 23:37
BobJanova29-Oct-12 23:37 
GeneralRe: Invoking a method using its 'string' name Pin
jschell30-Oct-12 9:54
jschell30-Oct-12 9:54 
AnswerRe: Invoking a method using its 'string' name Pin
Clifford Nelson26-Oct-12 8:48
Clifford Nelson26-Oct-12 8:48 
GeneralRe: Invoking a method using its 'string' name Pin
PozzaVecia26-Oct-12 9:01
PozzaVecia26-Oct-12 9:01 
AnswerRe: Invoking a method using its 'string' name Pin
Clifford Nelson26-Oct-12 9:03
Clifford Nelson26-Oct-12 9:03 
AnswerRe: Invoking a method using its 'string' name Pin
BobJanova29-Oct-12 0:42
BobJanova29-Oct-12 0:42 
QuestionUnexpected naming of client for a WCF service Pin
Tridip Bhattacharjee26-Oct-12 7:17
professionalTridip Bhattacharjee26-Oct-12 7:17 
AnswerRe: Unexpected naming of client for a WCF service Pin
Richard MacCutchan26-Oct-12 7:47
mveRichard MacCutchan26-Oct-12 7:47 
AnswerRe: Unexpected naming of client for a WCF service Pin
Ravi Bhavnani26-Oct-12 8:56
professionalRavi Bhavnani26-Oct-12 8:56 
GeneralRe: Unexpected naming of client for a WCF service Pin
Tridip Bhattacharjee26-Oct-12 9:34
professionalTridip Bhattacharjee26-Oct-12 9:34 
GeneralRe: Unexpected naming of client for a WCF service Pin
Ravi Bhavnani26-Oct-12 9:43
professionalRavi Bhavnani26-Oct-12 9:43 
GeneralRe: Unexpected naming of client for a WCF service Pin
Tridip Bhattacharjee26-Oct-12 9:59
professionalTridip Bhattacharjee26-Oct-12 9:59 

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.