WPF - Bound Control Not Updating When Property Changed?

I've bound the Text property of a TextBox to a base object's property and it seems to work just fine. Unfortunately, when I programatically change the value of the property, it doesn't seem to update on the GUI.

Here's the property:

public string SealedDate
{
    get
    {
        string result = string.Empty;

        if (_DACase.SealedDate != DateTime.MinValue)
        {
            result = Formatting.FormatDate(_DACase.SealedDate);
        }

        return result;
    }
    set
    {
        DateTime theDate = DateTime.MinValue;

        if (DateTime.TryParse(value, out theDate)
            && _DACase.SealedDate != theDate)
        {
            _DACase.SealedDate = theDate;
            base.OnChanged(); //fires event so I know the value of the object has changed
        }
    }
}

And the value of that property is being set when another property it being set:

public bool IsSealed
{
    get
    {
        return _DACase.SealedId > 0
            || _DACase.SealedDate != DateTime.MinValue;
    }
    set
    {
        if (value != (_DACase.SealedId > 0 || _DACase.SealedDate != DateTime.MinValue))
        {
            if (value)
            {
                this.SealedId = Authentication.CurrentUser.Id;
                this.SealedDate = Formatting.FormatDate(DateTime.Now);
            }
            else
            {
                this.SealedId = 0;
                this.SealedDate = DateTime.MinValue.ToString();
            }
            base.OnChanged();
        }
    }
}

And the XAML of the TextBox that isn't updating when I think it should:

<TextBox Name="txtSealedDate" Text="{Binding SealedDate}" Grid.Column="5" Grid.Row="3" IsReadOnly="True" />

Answers


Vlad's solution (in the comments) was correct.


Need Your Help

Android NDK incremental build

android android-ndk android-ndk-r4 incremental-build

I'm currently working on a large Android app using a massive amount of C++ code.

Any problems with this approach to cancel/abort Async servlet processing

java rest java-ee servlets servlet-3.0

In an Async servlet processing scenario, I want to achieve cancellation of requests.

autocomplete specify more parameters?

jquery asp.net

I'm using jquery UI autocomplete