private static void TextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var instance = (d as LargeImageButton); if (instance == null) return; instance.TextBlockTextRight.Text = ((string) e.NewValue); }