0

On my silverlight project I create this property :

private bool _isEnabled = true;
public bool IsEnabled
{
    get
        {
            return _isEnabled;
        }
   set
   {
        _isEnabled = value;
        RaisePropertyChanged("IsEnabled");
    }
}

But it always return false instead of true Why is that ? Thanks,

Aviv
  • 53
  • 2
  • 2
  • 5
  • 1
    What **precisely** makes you think this is returning false? Have you viewed it in the debugger, logged it, or are you deducing it from some behaviour in your application? – RB. Apr 11 '12 at 08:41
  • Sure you arent changing it to be disabled somewhere? – BugFinder Apr 11 '12 at 08:47
  • 1
    Is this supposed to be a DependencyProperty? – Anders Marzi Tornblad Apr 11 '12 at 09:21
  • I do binding to this property to check box and they always disabled. I put brakepoint on the "set" value and it not gets false from outside. and I put brakepoint on the "get" value and it return false. It is not DependencyProperty it is normal property at the ViewModel – Aviv Apr 11 '12 at 11:36
  • @Aviv try set a breakpoint on setter to see if your breakpoint being hitted when you click the CheckBox and see if is setting to true. So you know if they are proper binded. – King Chan Apr 11 '12 at 14:35

1 Answers1

0

1) Check Your Assigning INotifyPropertyChanged class Like That (inheritance)

Public class MainPageVM:INotifyPropertyChanged

2) Check Your Xaml Code Mode Property

IsEnabled="{Binding IsEnabled,Mode=TwoWay}"
mani kandan
  • 306
  • 2
  • 3