Click here to Skip to main content
11,638,173 members (76,246 online)

Silverlight / WPF

 
GeneralRe: Random Image with array Pin
Dave Kreskowiak21-Jan-13 17:54
mvpDave Kreskowiak21-Jan-13 17:54 
QuestionDispatcherTimer Tick event not fired Pin
Praveen Raghuvanshi17-Jan-13 4:54
memberPraveen Raghuvanshi17-Jan-13 4:54 
AnswerRe: DispatcherTimer Tick event not fired Pin
Paulo Zemek23-Jan-13 6:28
memberPaulo Zemek23-Jan-13 6:28 
QuestionWhich way to load entity child collections? Pin
UCLAdam16-Jan-13 5:11
memberUCLAdam16-Jan-13 5:11 
QuestionWPF with Web Pin
Rishabh Kumar14-Jan-13 8:42
memberRishabh Kumar14-Jan-13 8:42 
AnswerRe: WPF with Web Pin
Abhishek Pant14-Jan-13 9:17
memberAbhishek Pant14-Jan-13 9:17 
AnswerRe: WPF with Web Pin
Abhinav S16-Jan-13 17:20
mvpAbhinav S16-Jan-13 17:20 
QuestionWPF - Bind IsEnabled To Method On VM Pin
Kevin Marois13-Jan-13 11:06
memberKevin Marois13-Jan-13 11:06 
I'm working on an WPF MVVM application. The data entry screen has to have all it's fields disabled until the user clicks "Add" or "Edit", and also the fields cannot become enabled if the user does not have rights to that field.

So, I would like to bind all IsEnabled properties in the XAML to a single method on the ViewModel. I would need to pass in a string value which is the 'key' of the field. Then in the VM would use the key to check the rights. The method would be something like

public bool CanEnableField(string Key)
{
    // if the form is in Add or Edit Mode, and the user has rights to the field, then
    // return true, else false
}

A converter would probably not work because that class won't know about the VM and the form's mode (Add/Edit).

I could bind each field's IsEnabled to individual properties on the VM and handle all this in the getter, but that would be a lot of properties in the VM.

Anyone have any thoughts on how to do this?
If it's not broken, fix it until it is

AnswerRe: WPF - Bind IsEnabled To Method On VM Pin
Wayne Gaylard14-Jan-13 0:55
mentorWayne Gaylard14-Jan-13 0:55 
AnswerRe: WPF - Bind IsEnabled To Method On VM Pin
Richard Deeming14-Jan-13 2:13
memberRichard Deeming14-Jan-13 2:13 
GeneralRe: WPF - Bind IsEnabled To Method On VM Pin
Kevin Marois14-Jan-13 10:40
memberKevin Marois14-Jan-13 10:40 
GeneralRe: WPF - Bind IsEnabled To Method On VM Pin
Kevin Marois20-Jan-13 8:47
memberKevin Marois20-Jan-13 8:47 
QuestionWPF - Sync Combox Pin
Kevin Marois12-Jan-13 15:19
memberKevin Marois12-Jan-13 15:19 
AnswerRe: WPF - Sync Combox Pin
Mycroft Holmes13-Jan-13 0:50
memberMycroft Holmes13-Jan-13 0:50 
GeneralRe: WPF - Sync Combox Pin
Kevin Marois13-Jan-13 17:24
memberKevin Marois13-Jan-13 17:24 
GeneralRe: WPF - Sync Combox Pin
Mycroft Holmes14-Jan-13 0:11
memberMycroft Holmes14-Jan-13 0:11 
GeneralRe: WPF - Sync Combox Pin
Kevin Marois14-Jan-13 5:25
memberKevin Marois14-Jan-13 5:25 
GeneralRe: WPF - Sync Combox Pin
SledgeHammer0114-Jan-13 9:34
memberSledgeHammer0114-Jan-13 9:34 
GeneralRe: WPF - Sync Combox Pin
Kevin Marois23-Jan-13 17:41
memberKevin Marois23-Jan-13 17:41 
QuestionStyle From Resource File Not Being Applied Pin
Kevin Marois12-Jan-13 10:20
memberKevin Marois12-Jan-13 10:20 
AnswerRe: Style From Resource File Not Being Applied Pin
Richard MacCutchan12-Jan-13 23:44
mvpRichard MacCutchan12-Jan-13 23:44 
GeneralRe: Style From Resource File Not Being Applied Pin
Mycroft Holmes13-Jan-13 0:45
memberMycroft Holmes13-Jan-13 0:45 
GeneralRe: Style From Resource File Not Being Applied Pin
Richard MacCutchan13-Jan-13 1:24
mvpRichard MacCutchan13-Jan-13 1:24 
GeneralRe: Style From Resource File Not Being Applied Pin
Kevin Marois13-Jan-13 10:58
memberKevin Marois13-Jan-13 10:58 
QuestionRoutedEvent vs AttachedEvent - Syntax difference only? Confused Pin
devvvy9-Jan-13 20:05
memberdevvvy9-Jan-13 20:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.150728.1 | Last Updated 30 Jul 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid