in several Views we have container components - for example Grid
or ScrollViewer
- that are bound to a property on their own ViewModel or ViewModelItem.
In some cases the View (parent) containing these components can be shown without the ViewModel/ViewModelItem of the components being initialized. To avoid showing a user empty datagrids we are using FallBackValue=Hidden
to make sure the container is only shown when it's ViewModel/ViewModelItem is initialized/loaded.
A hypothetical example would be a Window
containing a DataGrid
and a more detailed view to the right. The detailed view would be its own UserControl
with its own ViewModel and the DataGrid
would have its own ViewModel
as well. When opening said Window
the ViewModel of the DataGrid
would be loaded immediately - but since no row has been selected the ViewModel that belongs to the detailed View would not be intialized, which means that the Visibility
Binding of the detail View would fail and the binding's FallbackValue
would be used to hide the detail View.
The issue with this approach is that the Visual Studio WPF/XAML designer will not show the content of the affected containers since they are hidden due to their FallbackValue.
Question: Is there a way to get the designer to show specific controls/components that have the FallBackValue
of a Visibility
binding set to Hidden
? Clicking into the XAML code that is inside these hidden containers does not show them.
Edit 1
I found this answer. Setting d:IsHidden="false"
does not help. Regardless of if it's set before or after the Visibility
property.