I have a user control that is having issues binding to a dependency property for IsEnabled. I have also tried manually setting the IsEnabled="false" and that also appears to be not working.
Here is the code:
public partial class News : UserControl { public static readonly DependencyProperty IsAuthenticatedProperty = DependencyProperty.Register( "IsAuthenticated", typeof(bool), typeof(News), new FrameworkPropertyMetadata( new PropertyChangedCallback(ChangeAuth))); public bool IsAuthenticated { get { return (bool) GetValue(IsAuthenticatedProperty); } set { SetValue(IsAuthenticatedProperty, value); } } private static void ChangeAuth(DependencyObject source, DependencyPropertyChangedEventArgs e) { if (e.NewValue is bool == false) { (source as News).UpdateAuth(false); } else { (source as News).UpdateAuth(true); } } private void UpdateAuth(bool value) { IsAuthenticated = value; } public News() { IsAuthenticated = false; this.IsEnabled = false; InitializeComponent(); } Any Ideas ? Thanks In Advance