Click here to Skip to main content
15,911,896 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: WPF FrameWork Pin
Pete O'Hanlon16-Oct-13 11:11
mvePete O'Hanlon16-Oct-13 11:11 
AnswerRe: WPF FrameWork Pin
SledgeHammer0116-Oct-13 17:44
SledgeHammer0116-Oct-13 17:44 
AnswerRe: WPF FrameWork Pin
Abhinav S16-Oct-13 18:18
Abhinav S16-Oct-13 18:18 
Questionwhat better way to open the form?! c# wpf Pin
juliogyn16-Oct-13 3:33
juliogyn16-Oct-13 3:33 
AnswerRe: what better way to open the form?! c# wpf Pin
GuyThiebaut16-Oct-13 5:24
professionalGuyThiebaut16-Oct-13 5:24 
AnswerRe: what better way to open the form?! c# wpf Pin
Pete O'Hanlon16-Oct-13 10:29
mvePete O'Hanlon16-Oct-13 10:29 
QuestionWPF databinding versus dispatcher Pin
GuyThiebaut15-Oct-13 5:03
professionalGuyThiebaut15-Oct-13 5:03 
AnswerRe: WPF databinding versus dispatcher Pin
David C# Hobbyist.15-Oct-13 7:11
professionalDavid C# Hobbyist.15-Oct-13 7:11 
GeneralRe: WPF databinding versus dispatcher Pin
GuyThiebaut15-Oct-13 7:59
professionalGuyThiebaut15-Oct-13 7:59 
GeneralRe: WPF databinding versus dispatcher Pin
Mycroft Holmes15-Oct-13 12:40
professionalMycroft Holmes15-Oct-13 12:40 
GeneralRe: WPF databinding versus dispatcher Pin
GuyThiebaut16-Oct-13 2:41
professionalGuyThiebaut16-Oct-13 2:41 
GeneralRe: WPF databinding versus dispatcher Pin
Mycroft Holmes16-Oct-13 12:43
professionalMycroft Holmes16-Oct-13 12:43 
AnswerRe: WPF databinding versus dispatcher Pin
Abhinav S15-Oct-13 18:23
Abhinav S15-Oct-13 18:23 
AnswerRe: WPF databinding versus dispatcher Pin
Kenneth Haugland16-Oct-13 2:25
mvaKenneth Haugland16-Oct-13 2:25 
GeneralRe: WPF databinding versus dispatcher Pin
GuyThiebaut16-Oct-13 2:44
professionalGuyThiebaut16-Oct-13 2:44 
GeneralRe: WPF databinding versus dispatcher Pin
Kenneth Haugland16-Oct-13 2:51
mvaKenneth Haugland16-Oct-13 2:51 
QuestionWPF Views & ViewModels Question Pin
Kevin Marois14-Oct-13 7:43
professionalKevin Marois14-Oct-13 7:43 
AnswerRe: WPF Views & ViewModels Question Pin
SledgeHammer0114-Oct-13 18:03
SledgeHammer0114-Oct-13 18:03 
GeneralRe: WPF Views & ViewModels Question Pin
Kevin Marois15-Oct-13 7:19
professionalKevin Marois15-Oct-13 7:19 
GeneralRe: WPF Views & ViewModels Question Pin
SledgeHammer0115-Oct-13 10:48
SledgeHammer0115-Oct-13 10:48 
GeneralRe: WPF Views & ViewModels Question Pin
Kevin Marois16-Oct-13 9:16
professionalKevin Marois16-Oct-13 9:16 
GeneralRe: WPF Views & ViewModels Question Pin
SledgeHammer0116-Oct-13 10:01
SledgeHammer0116-Oct-13 10:01 
GeneralRe: WPF Views & ViewModels Question Pin
Kevin Marois16-Oct-13 11:10
professionalKevin Marois16-Oct-13 11:10 
Wow, well maybe I'm not too far off then. Consider...
SledgeHammer01 wrote:
If its hard coded, I hard code it in the XAML (psuedo
code):
 
<TabControl>
  
<Tabs>
      <Tab>
  
      <ChildView1 />
     
</Tab>
      <Tab>
  
      <ChildView2 />
     
</Tab>
  
<Tabs>
</TabControl>
 
The XAML for ChildView1 and
ChildView2 would use the ViewLocator to find the VM. Something
like:
 
<UserControl
somenamespace:ViewModelBase.ViewModel="{x:Type local:DocumentMapCtrlVM}" ...
/>
 
your ViewLocator should wire up the DataContext, etc. as
shown in that link.
 
If its dynamic (or determined at runtime),
you'd need to build a collection of some object where you have the name of the
tab and the usercontrol instance for example and then bind the tab content to
the object.UserControl from the collection with a data template.


1) I already do all this


SledgeHammer01 wrote:
For opening a dialog, I like to use a dialog service. That kind of needs a DI
engine / container. You'd register a generic base
interface:
 
interface IDialogService
{
  
AddressObject ShowAddressDialog(Window owner);
}
 
for example...
in the tablet version, you'd register a version that slides it in like you are
doing now and in the desktop version, you'd register a version that shows a
popup dialog version instead, but its all the same interfaces, so your calling
code is the same for both versions.
 


2) I'm already doing this.


But think of this... I think my problem is that I don't need a ViewModelLocator - I need a ViewLocator...

Since both the PC or Tablet JobViews are using the same VM, the only questions is which View to load.

What do you think?
If it's not broken, fix it until it is

GeneralRe: WPF Views & ViewModels Question Pin
SledgeHammer0116-Oct-13 17:41
SledgeHammer0116-Oct-13 17:41 
GeneralRe: WPF Views & ViewModels Question Pin
SledgeHammer0116-Oct-13 10:09
SledgeHammer0116-Oct-13 10:09 

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.