|
|||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionThis control provides a new kind of navigation for your applications. It uses the BackgroundI saw this control in a commercial application, and I liked the look and feel and the possibilities it gives to the programmer. Because I didn't see such a control anywhere else, I decided to develop one on my own and use it in one of my projects. I hope others like my Using the codeWhen using a
Use categories to represent different parts of your application (like 'Customers', 'Manufacturers', 'Stock', an so on), and items to represent topics within a category (like 'customer list', 'search customer', 'new customer'). When a category is selected, its items will be displayed and the category header will be set. When an item is selected, an event will be fired and your app can react on this event (e.g., display the customer list). You can use
At the moment, NavigationCategory c1 = new NavigationCategory("Customers", 0);
c1.Name = "catCustomer";
NavigationItem i = new NavigationItem("Master Data", 0);
i.AddChild(new NavigationItem("Customer List", 1));
i.AddChild(new NavigationItem("Details", 2));
c1.AddItem(i);
c1.AddItem(new NavigationItem("Orders", 3));
c1.AddItem(new NavigationItem("Invoices", 4));
navigationTree1.AddCategory(c1);
Add delegates to be informed when a // NavigationCategory has been selected
navigationTree1.OnCategorySelected += new
CategorySelected(navigationTree1_OnCategorySelected);
// NavigationItem is going to be selected
navigationTree1.OnBeforeItemSelect += new
BeforeItemSelect(navigationTree1_OnBeforeItemSelect);
// NavigationItem has been selected
navigationTree1.OnItemSelected += new
ItemSelected(navigationTree1_OnItemSelected);
You can select // select a NavigationItem and fire
// BeforeItemSelect and ItemSelected events
myNavItem.Select();
// select a NavigationItem without fireing events (silent mode)
myNavItem.Select(false);
You can change the // change the visible text of a NavigationItem...
myNavItem.Text = "a new text";
// ...and update this NavigationItem in the NavigationTree
myNavItem.Refresh();
Points of InterestI improved the History
|
||||||||||||||||||||||||||||||||||||||||