Click here to Skip to main content
15,895,667 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Can't hit my asmx from Silverlight.. Pin
Nick Jacobs19-Jul-10 2:21
Nick Jacobs19-Jul-10 2:21 
GeneralRe: Can't hit my asmx from Silverlight.. Pin
#realJSOP19-Jul-10 3:47
mve#realJSOP19-Jul-10 3:47 
GeneralRe: Can't hit my asmx from Silverlight.. Pin
Nick Jacobs21-Jul-10 17:37
Nick Jacobs21-Jul-10 17:37 
QuestionMore MVVM WPF Angst Pin
_Maxxx_18-Jul-10 16:49
professional_Maxxx_18-Jul-10 16:49 
AnswerRe: More MVVM WPF Angst Pin
Pete O'Hanlon18-Jul-10 21:46
mvePete O'Hanlon18-Jul-10 21:46 
GeneralRe: More MVVM WPF Angst Pin
_Maxxx_19-Jul-10 0:44
professional_Maxxx_19-Jul-10 0:44 
GeneralRe: More MVVM WPF Angst Pin
Pete O'Hanlon19-Jul-10 0:57
mvePete O'Hanlon19-Jul-10 0:57 
GeneralRe: More MVVM WPF Angst Pin
_Maxxx_19-Jul-10 14:36
professional_Maxxx_19-Jul-10 14:36 
First, thanks for taking the time to read my waffle, let alone responding Smile | :)

Pete O'Hanlon wrote:
the View has to have knowledge of the ViewModel


Yep - badly worded by me. What I mean is that all interaction is done via binding - the only reference in code is in the main window which sets the Content of the labels to an instance of the ClockViewModel- so the VM knows nothing at all about the view, while the view only knows of the ViewModel because its content is an instance of one, and it uses a ContentTemplateSelector to determine how to display it.

The View itself shows the time by binding to the Hours Minutes and Seconds properties of the VM - so sure, it knows there will be a Vm with these properties, but it has no reference to an instance (* of course it does, really, it's just handled by WPF and not me!)

I agree your solution works, and works fine - what I am looking at, though, is the concept more that the practicality of this particular example.

What if I want to introduce a third view? I really wanted the designer to be able to just knock up any number of views to handle the same VM without having to change the VM.

I can extend your idea to use an enumerating rather than a boolean - but again that requires that I know all of the views in advance.

So here's what I would like to happen:

I write my ClockVM with appropriate properties.
I write a TemplateSelector which, based upon something in the View, determines which template (IOW which View) to select.
The designer designs several views.
The designer adds templates to the dictionary
I add code to the Window which sets the Content of each control to it's VM - without knowledge of whether this is a digital, analogue or something else version.

Ideally then, without any code changes to the Template Selector, it just works!

This requires that the template selector has access to something in the view which tells it which template to return.

So (as a poor example) I'd like the designer to be able to put a control on the window, and set something (in Xaml) to tell the SelectTemplate method which template to select.

I think my lack of understanding of WPF is hampering me somewhat - maybe it's just not possible to do what I want (maybe it's not sensible!)

Essentially what I am working toward is the idea that a number of viewmodels can be created and given to a design team who can put the gui side of the application together with little or no help from the development team.
___________________________________________
.\\axxx
(That's an 'M')

QuestionWPF Calendar Binding Pin
carrigart18-Jul-10 6:33
carrigart18-Jul-10 6:33 
AnswerRe: WPF Calendar Binding Pin
Parwej Ahamad18-Jul-10 8:20
professionalParwej Ahamad18-Jul-10 8:20 
GeneralRe: WPF Calendar Binding Pin
carrigart18-Jul-10 9:37
carrigart18-Jul-10 9:37 
QuestionValidator.ValidateProperty always throw error and application is exited Pin
ctlqt1217-Jul-10 23:10
ctlqt1217-Jul-10 23:10 
QuestionFull Silverlight website Pin
mehrdadc4816-Jul-10 18:33
mehrdadc4816-Jul-10 18:33 
AnswerRe: Full Silverlight website Pin
Kunal Chowdhury «IN»17-Jul-10 4:45
professionalKunal Chowdhury «IN»17-Jul-10 4:45 
AnswerRe: Full Silverlight website Pin
Abhinav S17-Jul-10 6:35
Abhinav S17-Jul-10 6:35 
QuestionWPF MVVM Multiple Vs with one VM Pin
_Maxxx_15-Jul-10 19:51
professional_Maxxx_15-Jul-10 19:51 
AnswerRe: WPF MVVM Multiple Vs with one VM Pin
Arun Jacob15-Jul-10 21:47
Arun Jacob15-Jul-10 21:47 
GeneralRe: WPF MVVM Multiple Vs with one VM Pin
_Maxxx_16-Jul-10 0:20
professional_Maxxx_16-Jul-10 0:20 
GeneralRe: WPF MVVM Multiple Vs with one VM Pin
_Maxxx_16-Jul-10 0:24
professional_Maxxx_16-Jul-10 0:24 
GeneralRe: WPF MVVM Multiple Vs with one VM Pin
Arun Jacob16-Jul-10 0:28
Arun Jacob16-Jul-10 0:28 
GeneralRe: WPF MVVM Multiple Vs with one VM Pin
Pete O'Hanlon16-Jul-10 1:38
mvePete O'Hanlon16-Jul-10 1:38 
AnswerRe: WPF MVVM Multiple Vs with one VM Pin
Jammer15-Jul-10 22:45
Jammer15-Jul-10 22:45 
QuestionHow to set the youtube player location fix in a xaml page, its getting on the botton of the page ...instead of the right position. Pin
Ch.Gayatri Subudhi15-Jul-10 19:10
Ch.Gayatri Subudhi15-Jul-10 19:10 
QuestionWPF equivalent of anchoring controls? Pin
Michael Eber15-Jul-10 10:29
Michael Eber15-Jul-10 10:29 
AnswerRe: WPF equivalent of anchoring controls? Pin
Kubajzz15-Jul-10 11:05
Kubajzz15-Jul-10 11:05 

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.