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

Design and Architecture

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

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.