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

WPF

 
QuestionCan't hit my asmx from Silverlight.. Pin
Nick Jacobs18-Jul-10 17:35
Nick Jacobs18-Jul-10 17:35 
AnswerRe: Can't hit my asmx from Silverlight.. Pin
Abhinav S18-Jul-10 18:11
Abhinav S18-Jul-10 18:11 
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 
Thanks - but that's not what I"m getting at, really.

I thought the idea of MVVM is to separate the presentation from the rest of the application.

So I define the requirements of a view (it needs to show the time and allow the Hours Minutes and Seconds to be updated, for example) but leave the presentation up to the designer.

Now the designer wants to show an analogue clock sometimes, and a digital clock other times - no business logic reason, juse pure presentation (you know how these arty types get after a latte!)

Now I can have them develop two separate User Controls (views) both of which use the same VM, and use them where appropriate, or I could create two Vms and have them create a view for each.

But...

At the moment, following much investigation, I am allowing WPF to decide upon the View to use based upon the VM - so neither the view nor the viewmodel are aware of one another's existence, and importantly the designer can see data. In window XAML I had

<Label Name="labelc" ContentTemplate="{StaticResource digitalTemplate}" />


for example.

this gets the template from my resource dictionary, for the digital clock, and all works fine.

but I changed that to use

<Label Name="labelc" ContentTemplateSelector="{StaticResource ClockTemplateSelector}" />


Which, as I said in my original post I think, works fine, but the TemplateSelector seems to work on the principal that it is the ModelView that is going to decide upon which template to use, and not the 'context' in which the view is being viewed.

So what I was hoping for was a way for the templateSelector to be able to determine something about how it is being displayed, and make a decision mased upon that information as to which template to return.

I guess I was just concerened in case I was missing something obvious.

what I'd like to see is :

designer designs templates for Digital and analogue clocks
templateselector is written to use one or the other depending upon the screen real-estate available.
The designer just references the contenttemplateSelector appropriately, and can see, at design time, what the outcome will be.
___________________________________________
.\\axxx
(That's an 'M')

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

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.