Click here to Skip to main content
15,891,431 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Make a textbox act like Excell Cell Pin
Vimalsoft(Pty) Ltd18-Jul-12 22:34
professionalVimalsoft(Pty) Ltd18-Jul-12 22:34 
QuestionWrite Comments on Image Pin
varaprasad20209-Jul-12 3:59
varaprasad20209-Jul-12 3:59 
AnswerRe: Write Comments on Image Pin
Pete O'Hanlon9-Jul-12 4:15
mvePete O'Hanlon9-Jul-12 4:15 
GeneralRe: Write Comments on Image Pin
vinodkrebc9-Jul-12 8:22
vinodkrebc9-Jul-12 8:22 
QuestionImmage Annotation Pin
varaprasad20209-Jul-12 3:57
varaprasad20209-Jul-12 3:57 
QuestionWorking with WPF Web browser control Pin
AshishGoyal086-Jul-12 0:46
AshishGoyal086-Jul-12 0:46 
AnswerRe: Working with WPF Web browser control Pin
darshan_ur12-Jul-12 2:06
darshan_ur12-Jul-12 2:06 
GeneralAccept Button and Data Binding inconsistency Pin
Bernhard Hiller4-Jul-12 23:11
Bernhard Hiller4-Jul-12 23:11 
It is convenient to have an "Accept Button" (in WPF: IsDefault="True") on a Form.
In the Windows Forms world, I used to read the data from the UI to the object(s) in the corresponding Click event of the button.
But with WPF, data binding ought to be used. In the constructor of the Window, I set this.DataContext = test;
And here comes the problem: the user entered some text in TextBox2, and hits the Enter key. Now, the command bound to the OK button gets executed, the data are saved.
But it is not the correct data! Why? TextBox2 has not yet lost focus, and consequently the ViewModel has not yet been updated.
[Edit]In Windows Forms, several controls have a Validating event. That event gets fired before the Click event event of the button, though the focus remains on that element.[/Edit]
How do you overcome such a problem?

modified 5-Jul-12 6:01am.

AnswerRe: Accept Button and Data Binding inconsistency Pin
Wayne Gaylard4-Jul-12 23:20
professionalWayne Gaylard4-Jul-12 23:20 
GeneralRe: Accept Button and Data Binding inconsistency Pin
Bernhard Hiller4-Jul-12 23:22
Bernhard Hiller4-Jul-12 23:22 
AnswerRe: Accept Button and Data Binding inconsistency Pin
Abhinav S4-Jul-12 23:23
Abhinav S4-Jul-12 23:23 
GeneralRe: Accept Button and Data Binding inconsistency Pin
Bernhard Hiller4-Jul-12 23:36
Bernhard Hiller4-Jul-12 23:36 
GeneralRe: Accept Button and Data Binding inconsistency Pin
Pete O'Hanlon5-Jul-12 0:30
mvePete O'Hanlon5-Jul-12 0:30 
GeneralRe: Accept Button and Data Binding inconsistency Pin
Abhinav S5-Jul-12 0:47
Abhinav S5-Jul-12 0:47 
GeneralRe: Accept Button and Data Binding inconsistency Pin
Wayne Gaylard5-Jul-12 2:20
professionalWayne Gaylard5-Jul-12 2:20 
GeneralRe: Accept Button and Data Binding inconsistency Pin
Bernhard Hiller5-Jul-12 2:56
Bernhard Hiller5-Jul-12 2:56 
GeneralRe: Accept Button and Data Binding inconsistency Pin
Pete O'Hanlon5-Jul-12 9:38
mvePete O'Hanlon5-Jul-12 9:38 
QuestionWPF Cascading filters Pin
Ross Cain4-Jul-12 8:45
Ross Cain4-Jul-12 8:45 
QuestionBinding Tooltip to template element Pin
Blikkies4-Jul-12 3:31
professionalBlikkies4-Jul-12 3:31 
AnswerRe: Binding Tooltip to template element Pin
Pete O'Hanlon4-Jul-12 3:40
mvePete O'Hanlon4-Jul-12 3:40 
GeneralRe: Binding Tooltip to template element Pin
Blikkies4-Jul-12 4:01
professionalBlikkies4-Jul-12 4:01 
GeneralRe: Binding Tooltip to template element Pin
Pete O'Hanlon4-Jul-12 4:16
mvePete O'Hanlon4-Jul-12 4:16 
AnswerRe: Binding Tooltip to template element Pin
vinodkrebc6-Jul-12 0:59
vinodkrebc6-Jul-12 0:59 
GeneralWPF Button Image Source Pin
Kevin Marois2-Jul-12 11:47
professionalKevin Marois2-Jul-12 11:47 
GeneralRe: WPF Button Image Source Pin
Unnikrishnan_S_N3-Jul-12 2:14
Unnikrishnan_S_N3-Jul-12 2:14 

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.