You cannot do it directly in VS (thatβs why Blend exists, I think :), but you can try using XamlWriter to get the xaml code of the control you want to change.
Just create a new WPF application, add the control you want to change, and a button with a click handler.
Write the following inside the button click handler:
private void OnGetXamlButtonClick(object sender, RoutedEventArgs e) { string xaml = XamlWriter.Save(MyControl.Style); }
source share