static void IsReadOnlyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
{
TextBox textbox = sender as TextBox;
textbox.ChangeVisualState(false);
if (textbox.AutomationPeer != null)
{
textbox.AutomationPeer.RaisePropertyChangedEvent(ValuePatternIdentifiers.IsReadOnlyProperty,
args.OldValue,
args.NewValue);
}
}