Click here to Skip to main content
15,860,859 members
Home / Discussions / WPF
   

WPF

 
QuestionDispatcherTimer Tick event not fired Pin
Praveen Raghuvanshi17-Jan-13 4:54
professionalPraveen Raghuvanshi17-Jan-13 4:54 
AnswerRe: DispatcherTimer Tick event not fired Pin
Paulo Zemek23-Jan-13 6:28
mvaPaulo Zemek23-Jan-13 6:28 
QuestionWhich way to load entity child collections? Pin
Adam_Dev16-Jan-13 5:11
Adam_Dev16-Jan-13 5:11 
QuestionWPF with Web Pin
Rishabh Kumar14-Jan-13 8:42
Rishabh Kumar14-Jan-13 8:42 
AnswerRe: WPF with Web Pin
Abhishek Pant14-Jan-13 9:17
professionalAbhishek Pant14-Jan-13 9:17 
AnswerRe: WPF with Web Pin
Abhinav S16-Jan-13 17:20
Abhinav S16-Jan-13 17:20 
QuestionWPF - Bind IsEnabled To Method On VM Pin
Kevin Marois13-Jan-13 11:06
professionalKevin Marois13-Jan-13 11:06 
AnswerRe: WPF - Bind IsEnabled To Method On VM Pin
Wayne Gaylard14-Jan-13 0:55
professionalWayne Gaylard14-Jan-13 0:55 
The best way is to have a bool Property in your VM, to which you caan bind the IsEnabled property of the relevant controls like this:-

VM:
C#
public bool CanEnableField(string Key)
{
    // if the form is in Add or Edit Mode, and the user has rights to the field, then EnableControls = true
}

public bool EnableControls
        {
            get
            {
                return enableControls;
            }
            set
            {
                if (enableControls != value)
                {
                    enableControls = value;
                    OnPropertyChanged("EnableControls");
                }
            }
        }


View:
XML
<Label Grid.Row="2" Content="Name : " HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="2,2,2,7" />
                <TextBox Grid.Column="1" Grid.Row="2" Margin="2" IsEnabled="{Binding Path=EnableControls}" Text="{Binding Path=SelectedCustomer.Name, ValidatesOnDataErrors=True,UpdateSourceTrigger=PropertyChanged}" />


Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman

AnswerRe: WPF - Bind IsEnabled To Method On VM Pin
Richard Deeming14-Jan-13 2:13
mveRichard Deeming14-Jan-13 2:13 
GeneralRe: WPF - Bind IsEnabled To Method On VM Pin
Kevin Marois14-Jan-13 10:40
professionalKevin Marois14-Jan-13 10:40 
GeneralRe: WPF - Bind IsEnabled To Method On VM Pin
Kevin Marois20-Jan-13 8:47
professionalKevin Marois20-Jan-13 8:47 
QuestionWPF - Sync Combox Pin
Kevin Marois12-Jan-13 15:19
professionalKevin Marois12-Jan-13 15:19 
AnswerRe: WPF - Sync Combox Pin
Mycroft Holmes13-Jan-13 0:50
professionalMycroft Holmes13-Jan-13 0:50 
GeneralRe: WPF - Sync Combox Pin
Kevin Marois13-Jan-13 17:24
professionalKevin Marois13-Jan-13 17:24 
GeneralRe: WPF - Sync Combox Pin
Mycroft Holmes14-Jan-13 0:11
professionalMycroft Holmes14-Jan-13 0:11 
GeneralRe: WPF - Sync Combox Pin
Kevin Marois14-Jan-13 5:25
professionalKevin Marois14-Jan-13 5:25 
GeneralRe: WPF - Sync Combox Pin
SledgeHammer0114-Jan-13 9:34
SledgeHammer0114-Jan-13 9:34 
GeneralRe: WPF - Sync Combox Pin
Kevin Marois23-Jan-13 17:41
professionalKevin Marois23-Jan-13 17:41 
QuestionStyle From Resource File Not Being Applied Pin
Kevin Marois12-Jan-13 10:20
professionalKevin Marois12-Jan-13 10:20 
AnswerRe: Style From Resource File Not Being Applied Pin
Richard MacCutchan12-Jan-13 23:44
mveRichard MacCutchan12-Jan-13 23:44 
GeneralRe: Style From Resource File Not Being Applied Pin
Mycroft Holmes13-Jan-13 0:45
professionalMycroft Holmes13-Jan-13 0:45 
GeneralRe: Style From Resource File Not Being Applied Pin
Richard MacCutchan13-Jan-13 1:24
mveRichard MacCutchan13-Jan-13 1:24 
GeneralRe: Style From Resource File Not Being Applied Pin
Kevin Marois13-Jan-13 10:58
professionalKevin Marois13-Jan-13 10:58 
QuestionRoutedEvent vs AttachedEvent - Syntax difference only? Confused Pin
devvvy9-Jan-13 20:05
devvvy9-Jan-13 20:05 
QuestionHow to play an Audio File After another has Finished in WPF MediaElement Pin
Vimalsoft(Pty) Ltd4-Jan-13 3:58
professionalVimalsoft(Pty) Ltd4-Jan-13 3:58 

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.