Click here to Skip to main content
15,918,109 members
Home / Discussions / WPF
   

WPF

 
Questioncall many method in CustomValidation Pin
ctlqt1224-Jun-10 18:17
ctlqt1224-Jun-10 18:17 
QuestionHow to set a ordered tabbing of input controls from one group box to another groupbox? Pin
G Nathan23-Jun-10 23:05
G Nathan23-Jun-10 23:05 
QuestionUsing MVVM approach to open different views on button clicking Pin
tarun2322-Jun-10 23:41
tarun2322-Jun-10 23:41 
AnswerRe: Using MVVM approach to open different views on button clicking Pin
Abhinav S23-Jun-10 2:17
Abhinav S23-Jun-10 2:17 
GeneralRe: Using MVVM approach to open different views on button clicking Pin
tarun2323-Jun-10 17:52
tarun2323-Jun-10 17:52 
AnswerRe: Using MVVM approach to open different views on button clicking Pin
Abhinav S23-Jun-10 18:21
Abhinav S23-Jun-10 18:21 
GeneralRe: Using MVVM approach to open different views on button clicking Pin
tarun2323-Jun-10 21:43
tarun2323-Jun-10 21:43 
GeneralRe: Using MVVM approach to open different views on button clicking Pin
Pete O'Hanlon23-Jun-10 22:02
mvePete O'Hanlon23-Jun-10 22:02 
You don't set the datacontext of a view in the viewmodel. What you do, and there are many versions to this, is declare the VM as the DataContext of the view. How you do it depends on how comfortable with the different mechanisms of binding available, e.g. you could set it in the View XAML, or in the code behind. Supposing you set it in the code behind, you set it using something like this:
private MainWindowViewModel _mmvm;
private void SetupViewModel()
{
  _mmvm = new MainWindowViewModel();
  DataContext = _mvvm;
}
Then all you need do is call this method, and you have hooked it up.

"WPF has many lovers. It's a veritable porn star!" - Josh Smith

As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.


My blog | My articles | MoXAML PowerToys | Onyx



GeneralRe: Using MVVM approach to open different views on button clicking Pin
tarun2324-Jun-10 0:17
tarun2324-Jun-10 0:17 
GeneralRe: Using MVVM approach to open different views on button clicking Pin
Pete O'Hanlon24-Jun-10 2:43
mvePete O'Hanlon24-Jun-10 2:43 
QuestionDoes Anyone Feel Like an Adventure? [modified] Pin
#realJSOP22-Jun-10 2:20
professional#realJSOP22-Jun-10 2:20 
AnswerRe: Does Anyone Feel Like an Adventure? Pin
Abhinav S23-Jun-10 2:40
Abhinav S23-Jun-10 2:40 
GeneralRe: Does Anyone Feel Like an Adventure? [modified] Pin
#realJSOP23-Jun-10 3:14
professional#realJSOP23-Jun-10 3:14 
GeneralRe: Does Anyone Feel Like an Adventure? Pin
Abhinav S23-Jun-10 5:13
Abhinav S23-Jun-10 5:13 
GeneralRe: Does Anyone Feel Like an Adventure? [modified] Pin
#realJSOP23-Jun-10 5:31
professional#realJSOP23-Jun-10 5:31 
GeneralRe: Does Anyone Feel Like an Adventure? Pin
Abhinav S23-Jun-10 18:23
Abhinav S23-Jun-10 18:23 
GeneralRe: Does Anyone Feel Like an Adventure? Pin
#realJSOP24-Jun-10 0:00
professional#realJSOP24-Jun-10 0:00 
GeneralRe: Does Anyone Feel Like an Adventure? Pin
#realJSOP24-Jun-10 2:47
professional#realJSOP24-Jun-10 2:47 
GeneralRe: Does Anyone Feel Like an Adventure? Pin
Abhinav S24-Jun-10 4:16
Abhinav S24-Jun-10 4:16 
GeneralRe: Does Anyone Feel Like an Adventure? Pin
#realJSOP24-Jun-10 6:36
professional#realJSOP24-Jun-10 6:36 
GeneralRe: Does Anyone Feel Like an Adventure? Pin
#realJSOP25-Jun-10 9:22
professional#realJSOP25-Jun-10 9:22 
GeneralRe: Does Anyone Feel Like an Adventure? Pin
Abhinav S25-Jun-10 17:20
Abhinav S25-Jun-10 17:20 
QuestionHow to : textbox got focus, label is be bigger Pin
milica121-Jun-10 23:35
milica121-Jun-10 23:35 
AnswerRe: How to : textbox got focus, label is be bigger Pin
Michael Eber22-Jun-10 6:06
Michael Eber22-Jun-10 6:06 
GeneralRe: How to : textbox got focus, label is be bigger Pin
milica122-Jun-10 21:04
milica122-Jun-10 21:04 

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.