Click here to Skip to main content
15,897,891 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WCF: Message Security with a User Name Client - how to retrieve username+pwd from server side on a per request basis? Pin
devvvy27-Mar-11 21:57
devvvy27-Mar-11 21:57 
QuestionWrapPanel Bound To Collection Pin
Kevin Marois24-Mar-11 12:09
professionalKevin Marois24-Mar-11 12:09 
AnswerRe: WrapPanel Bound To Collection Pin
Mycroft Holmes24-Mar-11 12:46
professionalMycroft Holmes24-Mar-11 12:46 
GeneralRe: WrapPanel Bound To Collection Pin
Kevin Marois24-Mar-11 12:57
professionalKevin Marois24-Mar-11 12:57 
GeneralRe: WrapPanel Bound To Collection Pin
Kevin Marois24-Mar-11 13:29
professionalKevin Marois24-Mar-11 13:29 
GeneralRe: WrapPanel Bound To Collection Pin
SledgeHammer0124-Mar-11 14:06
SledgeHammer0124-Mar-11 14:06 
GeneralRe: WrapPanel Bound To Collection Pin
Kevin Marois24-Mar-11 14:25
professionalKevin Marois24-Mar-11 14:25 
GeneralRe: WrapPanel Bound To Collection Pin
SledgeHammer0124-Mar-11 15:10
SledgeHammer0124-Mar-11 15:10 
Oh duh... I must have been smoking crack earlier...

You are inside of the DataTemplate, so {Binding} is pointing to your item, not the VM. In this case, its MenuButtonData.

Now, you wanted to be like the cool kids and use MVVM Smile | :) , so you made your life a lot more difficult because you can't use RelativeSource / FindAncestor to get to where the property is.

I guess you could make the command a static property and refer to it that way, but then how would the static handler get to your VM?

Or you could try use RelativeSource / FindAncestor to get to your view if it has a reference to the ViewModel and then access the property through there. However that wouldn't be proper MVVM.

Your other option (which is what I do in my code) is to subscribe to the ItemContainerGenerator messages and when the container is generated for each item, use FindName to get to the RadioButton and hook up the command then.

The simplest way is to have the command in your view, but that ain't the best MVVM and it wouldn't really jive with your VM.

Its messy any way you do it.
GeneralRe: WrapPanel Bound To Collection Pin
SledgeHammer0124-Mar-11 15:13
SledgeHammer0124-Mar-11 15:13 
GeneralRe: WrapPanel Bound To Collection Pin
Mycroft Holmes24-Mar-11 15:50
professionalMycroft Holmes24-Mar-11 15:50 
GeneralRe: WrapPanel Bound To Collection [modified] Pin
Kim Breugelmans24-Mar-11 20:19
Kim Breugelmans24-Mar-11 20:19 
GeneralRe: WrapPanel Bound To Collection Pin
Kevin Marois25-Mar-11 5:43
professionalKevin Marois25-Mar-11 5:43 
GeneralRe: WrapPanel Bound To Collection Pin
SledgeHammer0125-Mar-11 6:32
SledgeHammer0125-Mar-11 6:32 
GeneralRe: WrapPanel Bound To Collection Pin
Kevin Marois25-Mar-11 7:07
professionalKevin Marois25-Mar-11 7:07 
GeneralOk Everyone, Here It Is Pin
Kevin Marois25-Mar-11 7:31
professionalKevin Marois25-Mar-11 7:31 
GeneralRe: WrapPanel Bound To Collection Pin
Kim Breugelmans25-Mar-11 7:04
Kim Breugelmans25-Mar-11 7:04 
GeneralRe: WrapPanel Bound To Collection Pin
SledgeHammer0125-Mar-11 9:30
SledgeHammer0125-Mar-11 9:30 
QuestionWPF binding to a simple CLR Property? (Visibility=Collapsed) Pin
devvvy23-Mar-11 16:23
devvvy23-Mar-11 16:23 
AnswerRe: WPF binding to a simple CLR Property? (Visibility=Collapsed) Pin
devvvy23-Mar-11 19:42
devvvy23-Mar-11 19:42 
AnswerRe: WPF binding to a simple CLR Property? (Visibility=Collapsed) Pin
Pete O'Hanlon23-Mar-11 23:03
mvePete O'Hanlon23-Mar-11 23:03 
QuestionBook - Silverlight 4 - Problem Design Solution Pin
arkiboys23-Mar-11 2:41
arkiboys23-Mar-11 2:41 
AnswerRe: Book - Silverlight 4 - Problem Design Solution Pin
Mycroft Holmes23-Mar-11 12:20
professionalMycroft Holmes23-Mar-11 12:20 
GeneralRe: Book - Silverlight 4 - Problem Design Solution Pin
arkiboys23-Mar-11 22:31
arkiboys23-Mar-11 22:31 
GeneralRe: Book - Silverlight 4 - Problem Design Solution Pin
Mycroft Holmes23-Mar-11 23:01
professionalMycroft Holmes23-Mar-11 23:01 
Questionproblem in accessing files network folder path. Pin
souravghosh1822-Mar-11 20:31
souravghosh1822-Mar-11 20:31 

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.