Hi, I am working with a screen with an infinite vertical height (the entire contents of the xaml is encased in Scrollviewer)
When the screen first opens, there are two default panels, and the user has the option to add as many panels as he/she wants.
Everytime they open a new panel, I would like it to dock underneath any existing panels (so as the user adds panels, the screen fills up vertically, the scrollviewer becomes longer etc.)
This code works for me if I am trying to add a panel to the right side of the screen in MainViewModel.cs:
public void OpenPositionSummary()
{
var view = _container.Resolve<PositionSummaryView>();
view.DataContext = _container.Resolve<PositionSummaryViewModel>();
var region = RegionManager.Regions["DockedRight"];
region.Add(view); //add the view
region.Activate(view); //active the view
}
But if I change the code to
var region = RegionManager.Regions["DockedBottom"];
I get an error.
How can I make it so that my viewmodel always adds panels to the bottom of whatever is currently on the screen?
Thanks
Hi thanks for the quick response,
The error I get is "The region manager does not contain the DockedBottom region."
Of course, I didn't have to explicitly add "DockedRight" to region manager, so I don't understand why I would have to explicitly add docked bottom.
Hello Christian,
What is the error that you get? Is it an exception? Can you provide those details?
I don't see a reason why your "DockedRight" region code works but the "DockedBottom" region code causes an error. What is different about these two regions?