Click here to Skip to main content
15,881,882 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: WPF App Design Thoughts Pin
Kevin Marois20-Jun-12 8:59
professionalKevin Marois20-Jun-12 8:59 
GeneralRe: WPF App Design Thoughts Pin
Kevin Marois20-Jun-12 9:01
professionalKevin Marois20-Jun-12 9:01 
GeneralRe: WPF App Design Thoughts Pin
Pete O'Hanlon20-Jun-12 9:18
mvePete O'Hanlon20-Jun-12 9:18 
GeneralRe: WPF App Design Thoughts Pin
Ian Shlasko20-Jun-12 9:43
Ian Shlasko20-Jun-12 9:43 
GeneralRe: WPF App Design Thoughts Pin
Pete O'Hanlon20-Jun-12 9:49
mvePete O'Hanlon20-Jun-12 9:49 
GeneralRe: WPF App Design Thoughts Pin
Ian Shlasko20-Jun-12 10:17
Ian Shlasko20-Jun-12 10:17 
GeneralRe: WPF App Design Thoughts Pin
Kevin Marois20-Jun-12 10:29
professionalKevin Marois20-Jun-12 10:29 
GeneralRe: WPF App Design Thoughts Pin
Ian Shlasko20-Jun-12 11:13
Ian Shlasko20-Jun-12 11:13 
Ideally, you don't want to change the DataContext property from code. The usual method is to set the entire window to a ViewModel, and each section can have its DataContext bound to a property on that ViewModel.

MainWindow --> DataContext = MainWindowVIewModel
ContentFrame --> DataContext bound to ContentModel property (on MainWindowViewModel)
HelpFrame --> DataContext bound to HelpModel property (on MainWindowViewModel)

That way, when you change the content, all you do is change, in this example, the ContentModel property. Since the GUI control is hooked up with databinding, it'll automatically grab the new data, and switch to the proper DataTemplate.

So in short, you want to set the uppermost DataContext property once on window load, then operate exclusively through ViewModel properties.
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)

GeneralRe: WPF App Design Thoughts Pin
Kevin Marois20-Jun-12 11:20
professionalKevin Marois20-Jun-12 11:20 
GeneralRe: WPF App Design Thoughts Pin
Ian Shlasko20-Jun-12 11:46
Ian Shlasko20-Jun-12 11:46 
GeneralRe: WPF App Design Thoughts Pin
Kevin Marois20-Jun-12 11:47
professionalKevin Marois20-Jun-12 11:47 
GeneralRe: WPF App Design Thoughts Pin
Ian Shlasko20-Jun-12 11:55
Ian Shlasko20-Jun-12 11:55 
GeneralRe: WPF App Design Thoughts Pin
kishhr22-Jun-12 8:59
kishhr22-Jun-12 8:59 
QuestionThin Client Compiler ? Pin
W Balboos, GHB19-Jun-12 6:28
W Balboos, GHB19-Jun-12 6:28 
AnswerRe: Thin Client Compiler ? Pin
Eddy Vluggen19-Jun-12 8:55
professionalEddy Vluggen19-Jun-12 8:55 
GeneralRe: Thin Client Compiler ? Pin
W Balboos, GHB19-Jun-12 9:21
W Balboos, GHB19-Jun-12 9:21 
GeneralRe: Thin Client Compiler ? Pin
Eddy Vluggen19-Jun-12 10:24
professionalEddy Vluggen19-Jun-12 10:24 
GeneralRe: Thin Client Compiler ? Pin
W Balboos, GHB20-Jun-12 1:41
W Balboos, GHB20-Jun-12 1:41 
GeneralRe: Thin Client Compiler ? Pin
Eddy Vluggen20-Jun-12 1:54
professionalEddy Vluggen20-Jun-12 1:54 
GeneralRe: Thin Client Compiler ? Pin
W Balboos, GHB20-Jun-12 2:11
W Balboos, GHB20-Jun-12 2:11 
GeneralRe: Thin Client Compiler ? Pin
Eddy Vluggen20-Jun-12 2:30
professionalEddy Vluggen20-Jun-12 2:30 
AnswerRe: Thin Client Compiler ? Pin
jschell19-Jun-12 13:21
jschell19-Jun-12 13:21 
GeneralRe: Thin Client Compiler ? Pin
W Balboos, GHB20-Jun-12 1:46
W Balboos, GHB20-Jun-12 1:46 
AnswerRe: Thin Client Compiler ? Pin
Bernhard Hiller19-Jun-12 20:41
Bernhard Hiller19-Jun-12 20:41 
GeneralRe: Thin Client Compiler ? Pin
W Balboos, GHB20-Jun-12 1:58
W Balboos, GHB20-Jun-12 1:58 

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.