diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..a88e69e --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @DevExpressExampleBot \ No newline at end of file diff --git a/README.md b/README.md index 98a30a7..897d10a 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,40 @@ -![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/372624392/24.2.1%2B) [![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T1002750) [![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183) [![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives) # XAF - How to show the number of List View items in the Navigation Control -## Scenario - -In this example, we demonstrate how to show the number of List View items in the Navigation Control. You can add or delete items in List Views. The record count in navigation item captions will be automatically updated. +This example displays the number of List View items in the Navigation Control. When a user adds or deletes List View items, the navigation item captions update the record count automatically. ### ASP.NET Core Blazor -![image](https://user-images.githubusercontent.com/14300209/232799493-cb38bae6-b88f-4e28-b094-74c115ce5524.png) +![ Navigation Control](https://user-images.githubusercontent.com/14300209/232799493-cb38bae6-b88f-4e28-b094-74c115ce5524.png) +## Implementation Details +Follow the steps below to customize navigation item captions: -## Implementation Steps +1. Create a Window Controller ([NavigationObjectCountController.cs](./CS/EFCore/ItemCountEF/ItemCountEF.Module/Controllers/NavigationObjectCountController.cs)). + * In the [FrameAssigned](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.Controller.FrameAssigned) event handler, subscribe to the [NavigationItemCreated](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.SystemModule.ShowNavigationItemController.NavigationItemCreated) event. + * Use the [NavigationItem](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.SystemModule.NavigationItemCreatedEventArgs.NavigationItem).[Caption](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.Actions.ChoiceActionItem.Caption) event argument property to specify the custom caption (add the number of items). +1. Create a View Controller ([RefreshNavigationController.cs](./CS/EFCore/ItemCountEF/ItemCountEF.Module/Controllers/RefreshNavigationController.cs)). + * In the [Activated](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.Controller.Activated) event handler, subscribe to the [IObjectSpace.Committed](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.IObjectSpace.Committed) event. + * Call the [RecreateNavigationItems](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.SystemModule.ShowNavigationItemController.RecreateNavigationItems) method to recreate navigation items whenever the underlying data changes. -1. Create a View Controller. In the overridden **OnActivated** method, handle the [IObjectSpace.Committed](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.IObjectSpace.Committed) event. In this event handler, call the [ShowNavigationItemController.RecreateNavigationItems](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.SystemModule.ShowNavigationItemController.RecreateNavigationItems) method to re-create the Navigation System items after saving changes made in the current Grid List editor. -2. Create a Window Controller. Handle the [ShowNavigationItemController.NavigationItemCreated](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.SystemModule.ShowNavigationItemController.NavigationItemCreated) event in the overridden **OnFrameAssigned** method. In this event handler, specify the item caption via the e.NavigationItem.Caption property. +## Files to Review - -*Files to look at*: -* [RefreshNavigationController.cs](./CS/EFCore/ItemCountEF/ItemCountEF.Module/Controllers/RefreshNavigationController.cs) * [NavigationObjectCountController.cs](./CS/EFCore/ItemCountEF/ItemCountEF.Module/Controllers/NavigationObjectCountController.cs) - +* [RefreshNavigationController.cs](./CS/EFCore/ItemCountEF/ItemCountEF.Module/Controllers/RefreshNavigationController.cs) + +## Documentation + +* [Access Controller's Events and Properties](https://docs.devexpress.com/eXpressAppFramework/112676/ui-construction/controllers-and-actions/customize-controllers-and-actions#access-controllers-events-and-properties) + +## More Examples -## See Also +* [XAF - How to show the number of nested List View items in tab captions](https://github.com/DevExpress-Examples/XAF-How-to-show-the-number-of-nested-list-views-items-in-tab-captions) -- [Access Controller’s Events and Properties](https://docs.devexpress.com/eXpressAppFramework/112676/concepts/controllers-and-actions/customize-controllers-and-actions#access-controllers-events-and-properties) -- [XAF - How to show the number of nested List View items in tab captions](https://github.com/DevExpress-Examples/XAF-How-to-show-the-number-of-nested-list-views-items-in-tab-captions) ## Does this example address your development requirements/objectives?