Click here to Skip to main content
12,818,438 members (32,559 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked
Posted 9 Sep 2010

Building OpenPOS: Part 3 – Scaffolding and Navigation

, 9 Sep 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
Scaffolding and Navigation

I started creating the basic PRISM scaffolding using the PRISM project templates! Based on the prototypes I created, I also defined 2 regions…

<!--<span class="code-comment"> Navigation Region --></span>
<Border Margin="8,2,2,8" Grid.Row="1" BorderBrush="#FF929D31" 
	BorderThickness="2,2,2,2" CornerRadius="4,4,4,4">
    <ContentControl x:Name="NavigationRegion" 
                    Style="{StaticResource ContentControlRegionStyle}"

<!--<span class="code-comment"> Content Region --></span>
<Border Margin="2,2,8,8" Grid.Column="2" Grid.Row="1" 
	BorderThickness="2,2,2,2" CornerRadius="4,4,4,4" 
	BorderBrush="#FF929D31" Grid.RowSpan="2">
    <ContentControl x:Name="ContentRegion" 
                    Style="{StaticResource ContentControlRegionStyle}"

Next on the list of things that I wanted to do is implement a very basic navigation service. Modules should be able to “register” multiple navigation points that will show up on the navigation pane! Once the user clicks on these navigation points, the module should be able to change the current view. In my first draft, this is how it works...

Modules can “register” new navigation points:

    new NavigationPoint() 
        Name = "Sales",
        Category = "Main"

Once a navigation point is registered, it will be displayed on the navigation pane. If the user clicks on the navigation point, a “message” gets sent using the event aggregator. Subscribing to these messages is extremely easy:

_eventAggregator.GetEvent<NavigateEvent>().Subscribe(Navigate, true);

Every time one of these “messages” are raised, the following event handle fires:

public void Navigate(NavigationPoint point) 
    var contentRegion = _regionManager.Regions["ContentRegion"];  
    if (point.Name == "Sales" && point.Category == "Main") 
        var view = _container.Resolve<SalesView_Main>(); 
    if (point.Name == "Sales" && point.Category == "Administration") 
        var view = _container.Resolve<SalesView_Administrator>(); 

And that is it, now a module can register navigation points on the navigation pane!

As part of the scaffolding, I also created 3 extra modules (Sales, Customers and Stock).

In the next part, we will start implementing some of the main features of OpenPOS!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

South Africa South Africa
No Biography provided

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170308.1 | Last Updated 9 Sep 2010
Article Copyright 2010 by rudigrobler
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid