Click here to Skip to main content
15,879,053 members
Home / Discussions / WPF
   

WPF

 
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 
Questionaccessing remote system Pin
Arun kumar Gautam9-Oct-13 23:18
Arun kumar Gautam9-Oct-13 23:18 
AnswerRe: accessing remote system Pin
Richard MacCutchan9-Oct-13 23:25
mveRichard MacCutchan9-Oct-13 23:25 
GeneralRe: accessing remote system Pin
Arun kumar Gautam9-Oct-13 23:43
Arun kumar Gautam9-Oct-13 23:43 
GeneralRe: accessing remote system Pin
Richard MacCutchan10-Oct-13 0:07
mveRichard MacCutchan10-Oct-13 0:07 
AnswerRe: accessing remote system Pin
mohitsaxena110-Oct-13 7:50
professionalmohitsaxena110-Oct-13 7:50 
GeneralRe: accessing remote system Pin
Arun kumar Gautam11-Oct-13 7:00
Arun kumar Gautam11-Oct-13 7:00 
GeneralRe: accessing remote system Pin
Richard MacCutchan11-Oct-13 7:46
mveRichard MacCutchan11-Oct-13 7:46 
QuestionBinding converter in code behind Pin
USAFHokie804-Oct-13 2:24
USAFHokie804-Oct-13 2:24 
AnswerRe: Binding converter in code behind Pin
Richard Deeming4-Oct-13 3:02
mveRichard Deeming4-Oct-13 3:02 
AnswerRe: Binding converter in code behind Pin
USAFHokie804-Oct-13 3:24
USAFHokie804-Oct-13 3:24 
GeneralRe: Binding converter in code behind Pin
Richard Deeming4-Oct-13 3:34
mveRichard Deeming4-Oct-13 3:34 
AnswerRe: Binding converter in code behind Pin
mohitsaxena110-Oct-13 8:04
professionalmohitsaxena110-Oct-13 8:04 
Questionvalidation for 2 DateTimePicker (start date and end date) in WPF Pin
Yogi_vns0073-Oct-13 2:04
Yogi_vns0073-Oct-13 2:04 
AnswerRe: validation for 2 DateTimePicker (start date and end date) in WPF Pin
mohitsaxena110-Oct-13 8:09
professionalmohitsaxena110-Oct-13 8:09 
Questionget two columns Pin
picasso21-Oct-13 17:52
picasso21-Oct-13 17:52 

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.