From 8fe41b498a62e0dd2c87962b1ecbf66c4a97fc04 Mon Sep 17 00:00:00 2001 From: "nikulina.svetlana" Date: Fri, 18 Jul 2025 00:27:00 +0400 Subject: [PATCH 1/5] update text --- README.md | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 98a30a7..850f9b7 100644 --- a/README.md +++ b/README.md @@ -6,31 +6,36 @@ # 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)). + 1. 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. + 1. 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)). + 1. 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. + 1. 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? From c9de7d1d5b16c2f5545f9b4fc25113445c74d643 Mon Sep 17 00:00:00 2001 From: DevExpressExampleBot Date: Thu, 17 Jul 2025 23:29:00 +0300 Subject: [PATCH 2/5] Created a new file CODEOWNERS [skip ci] --- CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 CODEOWNERS 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 From 91b042d88187a147eb1d836c44c9cf3b4ae196b6 Mon Sep 17 00:00:00 2001 From: DevExpressExampleBot Date: Fri, 18 Jul 2025 00:29:04 +0400 Subject: [PATCH 3/5] README auto update [skip ci] --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 850f9b7..c09280c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -![](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) From 82ae162dee0585a3f0523f764f779ea6dfd4b112 Mon Sep 17 00:00:00 2001 From: "nikulina.svetlana" Date: Fri, 18 Jul 2025 00:30:29 +0400 Subject: [PATCH 4/5] upd --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 850f9b7..dbc2372 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,11 @@ This example displays the number of List View items in the Navigation Control. W Follow the steps below to customize navigation item captions: 1. Create a Window Controller ([NavigationObjectCountController.cs](./CS/EFCore/ItemCountEF/ItemCountEF.Module/Controllers/NavigationObjectCountController.cs)). - 1. 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. - 1. 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). + * 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)). - 1. 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. - 1. Call the [RecreateNavigationItems](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.SystemModule.ShowNavigationItemController.RecreateNavigationItems) method to recreate navigation items whenever the underlying data changes. + * 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. ## Files to Review From e4f3ac12950c9ded8a86281a474dd16df667b3c1 Mon Sep 17 00:00:00 2001 From: Svetlana Nikulina Date: Mon, 11 Aug 2025 12:35:54 +0400 Subject: [PATCH 5/5] Apply suggestions from code review Co-authored-by: arminal --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 897d10a..41bb178 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ # XAF - How to show the number of List View items in the Navigation Control -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. +This example displays the number of List View items in the Navigation Control. When a user adds or deletes List View items, navigation item captions update the record count automatically. ### ASP.NET Core Blazor @@ -20,7 +20,7 @@ Follow the steps below to customize navigation item captions: * 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. + * Call the [RecreateNavigationItems](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.SystemModule.ShowNavigationItemController.RecreateNavigationItems) method to recreate navigation items whenever underlying data changes. ## Files to Review