Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Navigation items in the WMC are identified by Navigation Paths. These case-insensitive paths describe the hierarchy of how the item is arranged with respect to other nodes. The root node of the Navigation Path (called the domain) indicates the type of navigation item.

...

Navigation Paths can have aliases that are used to quickly reference an item without having to know the entire underlying pathimmutable references to navigation paths. By using aliases the underlying navigation path can change and the framework will still be able to find it via its aliasNavInsertItem allows you to specify an alias when you add the item . It must consist of a '{' character followed by the (case sensitive) alias name and then a '}'. e.g {ControlPanel} references the Control Panel node in the navigation tree whose real Navigation Path is NAVIGATIONTREE\ControlPanel

Using aliases makes it easier for developers of other components to use your Navigation Paths without you having to publish the entire hierarchy. You can then change the hierarchy in later versions of your component and so long as you have kept the alias the same, their code will continue to work correctly.

and we recommend using the NavItemHelpers function MakeAliasForName that will create an alias from a name.

If you have a component that needs to allow others to place nodes beneath it, then publish the alias not the full navigation path. So long as you don't rename the alias then you can move/rename the navigation path within the hierarchy and client code will continue to find your item via its alias.

Like Navigation Paths, aliases are case-insensitive.

 

Note

Qbik highly recommends that you use aliases wherever possibleto find parent items when inserting your own navigation items. This ensures that your items continue to operate correctly , even when the underlying navigation paths change. If you hardcode your items, e.g. Insert an item directly with the path NAVIGATIONTREE\ControlPanel\MyComponent, and later on ControlPanel gets renamed or moved in the tree hierarchy, your item will no longer insert correctly.

Note

Make sure your alias is unique. Qbik Well known aliases are undecorated but you should ensure your alias can be differentiated from someone elses. E.g. Don't call your alias {File}, but use something that uniquely identifies your alias such as {MyCompanyScannerComponentFile}. You can also use a string representation of a UUID if you wish. MakeAliasFromName(L"703201E2-6ACF-463D-AA4B-038F99AD9414");