2

As opposed to this, does anybody has figured out a way to show all hidden elements while working in Visual Studio designer(or Blend)?

It's anti-productive to constantly change the default visibility property of elements to be able to see them while editing Xaml files.

Community
  • 1
  • 1
  • You can do this a number of ways, I prefer design time data contexts as it prevents writing code in the viewmodel for supporting the design/development. That said, it can lead to more code overall. – kidshaw Jun 28 '15 at 18:03

1 Answers1

0

After researching, I found this. So here's a tested solution that can be implemented in the view model :

//Declare default Visibility values
private Visibility _processBarVisibility = Visibility.Hidden;
private Visibility _buttonVisibility = Visibility.Hidden;

public ViewModel()
{
    //In constructor, override Visibility values if in design mode
    DependencyObject dep = new DependencyObject();
    if (DesignerProperties.GetIsInDesignMode(dep))
    {
        _processBarVisibility = Visibility.Visible;
        _buttonVisibility = Visibility.Visible;
    }
}
Community
  • 1
  • 1