Click here to Skip to main content
15,921,941 members
Home / Discussions / WPF
   

WPF

 
QuestionWPF / MVVM - Modular Design Question Pin
Kevin Marois7-Mar-13 7:27
professionalKevin Marois7-Mar-13 7:27 
AnswerRe: WPF / MVVM - Modular Design Question Pin
SledgeHammer017-Mar-13 9:51
SledgeHammer017-Mar-13 9:51 
You'd have to know about the child views if you are creating them dynamically. What you DON'T have to know about is headerText and the vm.

Use a ViewLocator service or just specify it in the XAML. When the view is created, your VM will automatically be created and bound to the DataContext.

headerText should be specified in the XAML through data binding or hardcoded in the VM. The MainWindowViewModel certainly shouldn't know about it.

The real question is why you are getting a loadView method where you have access to the tab control itself. Big MVVM no-no.

TabControl should be in the main windows XAML and bound to an ItemsSource property. You shouldn't create tabs by hand, just add to the ItemsSource collection. That way you can do all the data binding in XAML.
GeneralRe: WPF / MVVM - Modular Design Question Pin
Kevin Marois7-Mar-13 14:10
professionalKevin Marois7-Mar-13 14:10 
GeneralRe: WPF / MVVM - Modular Design Question Pin
SledgeHammer017-Mar-13 15:07
SledgeHammer017-Mar-13 15:07 
GeneralRe: WPF / MVVM - Modular Design Question Pin
Kevin Marois8-Mar-13 5:28
professionalKevin Marois8-Mar-13 5:28 
AnswerRe: WPF / MVVM - Modular Design Question Pin
Wayne Gaylard8-Mar-13 6:10
professionalWayne Gaylard8-Mar-13 6:10 
GeneralRe: WPF / MVVM - Modular Design Question Pin
Kevin Marois8-Mar-13 6:14
professionalKevin Marois8-Mar-13 6:14 
GeneralRe: WPF / MVVM - Modular Design Question Pin
Wayne Gaylard8-Mar-13 6:35
professionalWayne Gaylard8-Mar-13 6:35 
GeneralRe: WPF / MVVM - Modular Design Question Pin
Kevin Marois11-Mar-13 8:39
professionalKevin Marois11-Mar-13 8:39 
GeneralRe: WPF / MVVM - Modular Design Question Pin
SledgeHammer0111-Mar-13 10:20
SledgeHammer0111-Mar-13 10:20 
GeneralRe: WPF / MVVM - Modular Design Question Pin
Wayne Gaylard12-Mar-13 1:38
professionalWayne Gaylard12-Mar-13 1:38 
AnswerRe: WPF / MVVM - Modular Design Question Pin
Abhinav S10-Mar-13 5:31
Abhinav S10-Mar-13 5:31 
GeneralRe: WPF / MVVM - Modular Design Question Pin
SledgeHammer0111-Mar-13 14:52
SledgeHammer0111-Mar-13 14:52 
AnswerRe: WPF / MVVM - Modular Design Question Pin
Abhinav S11-Mar-13 17:03
Abhinav S11-Mar-13 17:03 
GeneralRe: WPF / MVVM - Modular Design Question Pin
SledgeHammer0111-Mar-13 17:38
SledgeHammer0111-Mar-13 17:38 
QuestionHow to expand TreeViewItem programatically? Pin
SledgeHammer013-Mar-13 19:16
SledgeHammer013-Mar-13 19:16 
AnswerRe: How to expand TreeViewItem programatically? Pin
Mycroft Holmes4-Mar-13 11:49
professionalMycroft Holmes4-Mar-13 11:49 
GeneralRe: How to expand TreeViewItem programatically? Pin
SledgeHammer014-Mar-13 12:09
SledgeHammer014-Mar-13 12:09 
GeneralRe: How to expand TreeViewItem programatically? Pin
Mycroft Holmes3-Apr-13 14:06
professionalMycroft Holmes3-Apr-13 14:06 
QuestionAuto complite text box Pin
columbos149273-Mar-13 8:51
columbos149273-Mar-13 8:51 
AnswerRe: Auto complite text box Pin
Wayne Gaylard4-Mar-13 6:26
professionalWayne Gaylard4-Mar-13 6:26 
QuestionOverride Textbox Pin
Kevin Marois1-Mar-13 8:16
professionalKevin Marois1-Mar-13 8:16 
AnswerRe: Override Textbox Pin
Richard MacCutchan2-Mar-13 0:05
mveRichard MacCutchan2-Mar-13 0:05 
AnswerRe: Override Textbox Pin
Pete O'Hanlon2-Mar-13 1:09
mvePete O'Hanlon2-Mar-13 1:09 
GeneralRe: Override Textbox Pin
Kevin Marois5-Mar-13 11:01
professionalKevin Marois5-Mar-13 11:01 

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.