Microsoft Code Name “Acropolis” is a set of components and tools intended to make it easier for developers to build and manage modular, business focused, client applications for Microsoft Windows on the .NET Framework
You can download Acropolis CTP1.
Navigation is an important thing when we build an application. And, this feature is available with Acropolis as part of its kernel.
The goal of this post is to talk about what kind of Navigation Acropolis provide out of the box and what are its limitations.
Acropolis provides 2 kinds of NavigationManager class:
- "SinglePartNavigationManager" that enables Single "Part" activation,
- "MultiplePartNavigationManager" that enables Multiple "Part" activation
These classes inherits from "NavigationManager" class that implements "INavigationManager" interface.
In Acropolis, NavigationManager behavior maintains a collection of "NavigationItem" instances with a "NavigationItemState" i.e (Activated | Deactivated).
Basically, a "NavigationItem" is associated to a child part during the application execution. See the schema below 3 Parts are dropped as Children in the application.
How to specify the NavigationManager ?
<AcropolisApplication.NavigationManager>
<Afx:MultiPartNavigationManager />
</AcropolisApplication.NavigationManager>
How to view Part ?
In order to do that, we use a WPF Control "PartPane" provided by Acropolis that allows to display a PartView. See the XAML code below:
<Windows:PartPane Part="{Binding Part.NavigationManager.ActivePart}"/>
The XAML code above is the best way when SinglePartNavigationManager is used. In contrast to MultiPartNavigationManager, it is necessary to bind all parts to a list, in the XAML code below, an "ItemsControl" control is useed:
<ItemsControl ItemsSource="{Binding Part.NavigationManager.ActiveParts}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Awx:PartPane Part="{Binding}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
Depending which kind of NavigationManager you use, the behavior is below:
- With SinglePartNavigationManager, only the last added part is activated (TaskPadPart3) and 2 first are deactivated (TaskPadPart1 and TaskPadPart2). See Figure 1.
- With MultiPartNavigationManager, all parts are activated (TaskPadPart1, TaskPadPart2 and TaskPadPart3). See Figure 2.
Figure 1.
Figure 2.
Limitations
Both SinglePartNavigationManager and MultiPartNavigationManager allow only "Single" Transition between Parts that are dropped into "AcropolisApplication.ChildParts". This means that these Parts live during the application execution even if there are deactivated. In order to activate a part, we must to call "NavigateTo" method available on NavigationManager and it requires to know which NavigationItem to be specified.
This case is suitable for RAD purpose but not in Software Industry where Part should be activated dynamically regarding UserContext, Business Scenario, and so on.
Conclusion
To sum up the navigation features that Acropolis provides by default, we can't have dynamic part activated by the navigation model, but it can be extented. Acropolis's Team has done an awesome job to provide a great open and extensible framework (hope it is not in final release :-)).
In the next post, we will focus on a NavigationManager extension based on UserAction Framework Navigation Model.