private static void OnActionIconChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) { PhoneTextBox phoneTextBox = sender as PhoneTextBox; if (phoneTextBox != null) { phoneTextBox.UpdateActionIconVisibility(); } }