Click here to Skip to main content
16,004,919 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: Website And Service Using Real Time Data Feed Pin
Eddy Vluggen2-Aug-12 23:50
professionalEddy Vluggen2-Aug-12 23:50 
AnswerRe: Website And Service Using Real Time Data Feed Pin
wizardzz9-Aug-12 8:15
wizardzz9-Aug-12 8:15 
QuestionCommonApplicationData Pin
mmujahid29-Jun-12 11:38
mmujahid29-Jun-12 11:38 
AnswerRe: CommonApplicationData Pin
Richard Andrew x6429-Jun-12 11:51
professionalRichard Andrew x6429-Jun-12 11:51 
QuestionBest Pattern for a New Service Pin
Brian C Hart26-Jun-12 9:12
professionalBrian C Hart26-Jun-12 9:12 
SuggestionRe: Best Pattern for a New Service Pin
kisMicrosoftDev27-Jun-12 6:23
kisMicrosoftDev27-Jun-12 6:23 
AnswerRe: Best Pattern for a New Service Pin
jschell27-Jun-12 10:14
jschell27-Jun-12 10:14 
GeneralRe: Best Pattern for a New Service Pin
Brian C Hart27-Jun-12 11:00
professionalBrian C Hart27-Jun-12 11:00 
AnswerRe: Best Pattern for a New Service Pin
jschell28-Jun-12 8:41
jschell28-Jun-12 8:41 
QuestionWPF App Design Thoughts Pin
Kevin Marois20-Jun-12 7:58
professionalKevin Marois20-Jun-12 7:58 
AnswerRe: WPF App Design Thoughts Pin
Ian Shlasko20-Jun-12 8:06
Ian Shlasko20-Jun-12 8:06 
GeneralRe: WPF App Design Thoughts Pin
Kevin Marois20-Jun-12 8:29
professionalKevin Marois20-Jun-12 8:29 
GeneralRe: WPF App Design Thoughts Pin
Pete O'Hanlon20-Jun-12 8:40
mvePete O'Hanlon20-Jun-12 8:40 
GeneralRe: WPF App Design Thoughts Pin
Kevin Marois20-Jun-12 8:45
professionalKevin Marois20-Jun-12 8:45 
GeneralRe: WPF App Design Thoughts Pin
Pete O'Hanlon20-Jun-12 8:56
mvePete O'Hanlon20-Jun-12 8:56 
The user control would still be there as a discrete object (the View in other words). The data template would simply marry the view to a particular view model. If you look at Josh Smith's classic MVVM article[^], he demonstrates this neatly with:
XML
<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:vm="clr-namespace:DemoApp.ViewModel"
  xmlns:vw="clr-namespace:DemoApp.View"
  >

  <!-- 
  This template applies an AllCustomersView to an instance 
  of the AllCustomersViewModel class shown in the main window.
  -->
  <DataTemplate DataType="{x:Type vm:AllCustomersViewModel}">
    <vw:AllCustomersView />
  </DataTemplate>

  <!-- 
  This template applies a CustomerView to an instance  
  of the CustomerViewModel class shown in the main window.
  -->
  <DataTemplate DataType="{x:Type vm:CustomerViewModel}">
    <vw:CustomerView />
  </DataTemplate>

 <!-- Other resources omitted for clarity... -->

</ResourceDictionary>

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

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 
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 

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.