private static void OnConfirmTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { // Get ActionDialog instance var dlg = (ActionDialog)d; // Update button text dlg.PrimaryButtonText = (string)e.NewValue; }