Click here to Skip to main content
15,881,852 members
Home / Discussions / WPF
   

WPF

 
QuestionAnother real newbie question - wiring events to handlers not in the code-behind class Pin
Marc Clifton2-Feb-14 10:57
mvaMarc Clifton2-Feb-14 10:57 
AnswerRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
Pete O'Hanlon2-Feb-14 11:27
mvePete O'Hanlon2-Feb-14 11:27 
GeneralRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
Marc Clifton5-Feb-14 15:09
mvaMarc Clifton5-Feb-14 15:09 
GeneralRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
Pete O'Hanlon5-Feb-14 23:15
mvePete O'Hanlon5-Feb-14 23:15 
AnswerRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
_Maxxx_2-Feb-14 19:19
professional_Maxxx_2-Feb-14 19:19 
GeneralRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
Mycroft Holmes3-Feb-14 3:05
professionalMycroft Holmes3-Feb-14 3:05 
GeneralRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
_Maxxx_3-Feb-14 9:29
professional_Maxxx_3-Feb-14 9:29 
GeneralRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
Marc Clifton5-Feb-14 15:13
mvaMarc Clifton5-Feb-14 15:13 
_Maxxx_ wrote:
but out of interest, why not put it in the code behind?


1. It seems ridiculous to put the event wire-up in the code-behind when in my opinion, I would think XAML should be able to handle the wire-up declaratively.

2. I don't want the functionality in the Page's code-behind because I have functionality that is common to all pages but needs to be wired up to each button on the page.

3. It's ridiculous to me to write a code-behind handler in each page for each button that then calls some common code elsewhere -- why can't I just wire up the event in the XAML?

4. Clearly I can wire-up the event in the code-behind, why would I be restricted from doing exactly the same thing declaratively in the XAML?

So far, doing this one simple thing, it appears I have stumbled across a serious XAML inadequacy. Is that correct?

(And please, don't go on about MVVM and all that rot -- there are many scenarios where MVVM is not the right approach, and I happen to be dealing with one of them.)

Marc
GeneralRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
_Maxxx_5-Feb-14 15:26
professional_Maxxx_5-Feb-14 15:26 
QuestionHow do I wire Command to functions not in the view? Pin
Marc Clifton2-Feb-14 10:14
mvaMarc Clifton2-Feb-14 10:14 
QuestionHow to bind a dataset to a WPF richtextbox? Pin
fsunole0329-Jan-14 10:43
fsunole0329-Jan-14 10:43 
AnswerRe: How to bind a dataset to a WPF richtextbox? Pin
Wayne Gaylard30-Jan-14 1:07
professionalWayne Gaylard30-Jan-14 1:07 
QuestionHandling RowEditEnding in a DataGrid according to MVVM pattern Pin
Piotr Z27-Jan-14 23:43
Piotr Z27-Jan-14 23:43 
AnswerRe: Handling RowEditEnding in a DataGrid according to MVVM pattern Pin
Pete O'Hanlon28-Jan-14 0:29
mvePete O'Hanlon28-Jan-14 0:29 
GeneralRe: Handling RowEditEnding in a DataGrid according to MVVM pattern Pin
Piotr Z28-Jan-14 0:51
Piotr Z28-Jan-14 0:51 
GeneralRe: Handling RowEditEnding in a DataGrid according to MVVM pattern Pin
Pete O'Hanlon28-Jan-14 1:10
mvePete O'Hanlon28-Jan-14 1:10 
AnswerRe: Handling RowEditEnding in a DataGrid according to MVVM pattern Pin
_Maxxx_2-Feb-14 19:36
professional_Maxxx_2-Feb-14 19:36 
QuestionProblems updating datagrid from collection Pin
abollmeyer23-Jan-14 10:55
abollmeyer23-Jan-14 10:55 
AnswerRe: Problems updating datagrid from collection Pin
Mycroft Holmes23-Jan-14 12:04
professionalMycroft Holmes23-Jan-14 12:04 
QuestionBinding property from XML file data Pin
abollmeyer21-Jan-14 9:18
abollmeyer21-Jan-14 9:18 
AnswerRe: Binding property from XML file data Pin
abollmeyer21-Jan-14 14:44
abollmeyer21-Jan-14 14:44 
QuestionCombobox / Textblock field Pin
eddieangel21-Jan-14 6:24
eddieangel21-Jan-14 6:24 
AnswerRe: Combobox / Textblock field Pin
Jason Gleim21-Jan-14 7:52
professionalJason Gleim21-Jan-14 7:52 
GeneralRe: Combobox / Textblock field Pin
eddieangel21-Jan-14 8:07
eddieangel21-Jan-14 8:07 
GeneralRe: Combobox / Textblock field Pin
Jason Gleim21-Jan-14 8:48
professionalJason Gleim21-Jan-14 8:48 

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.