From 8a7d50fa4e05ad5c7c7c9444394b12f73855d37a Mon Sep 17 00:00:00 2001 From: Aravindhanperiyasamy19 Date: Mon, 23 Jun 2025 18:30:07 +0530 Subject: [PATCH 1/2] 964819-Check and change the code snippet misalignment, mistakes and errors in MenuAdv controls UG --- wpf/Menu/Animation-Support.md | 62 ++-- wpf/Menu/Binding-and-DataTemplate-Support.md | 224 +++++++------ .../Check-Box-and-Radio-Button-Support.md | 74 ++--- ...mand-Binding-and-Command-Target-Support.md | 2 - wpf/Menu/Customizing-Data-Templates.md | 44 +-- wpf/Menu/Data-Binding.md | 302 +++++------------- wpf/Menu/Icon-Support.md | 65 ++-- wpf/Menu/InputGestureText-Support.md | 117 +++---- wpf/Menu/Orientation-Support.md | 127 +++----- wpf/Menu/Scroll-Support.md | 6 +- 10 files changed, 354 insertions(+), 669 deletions(-) diff --git a/wpf/Menu/Animation-Support.md b/wpf/Menu/Animation-Support.md index 2284b0fb61..4d7a54da4a 100644 --- a/wpf/Menu/Animation-Support.md +++ b/wpf/Menu/Animation-Support.md @@ -23,48 +23,27 @@ If the PopUpAnimationType property is set to Fade, the submenu will open with fa {% highlight xaml %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + {% endhighlight %} @@ -73,7 +52,6 @@ If the PopUpAnimationType property is set to Fade, the submenu will open with fa The property for the Animation support is described in the following tabulation: -
diff --git a/wpf/Menu/Binding-and-DataTemplate-Support.md b/wpf/Menu/Binding-and-DataTemplate-Support.md index 84a311fb7c..ba9653ad7c 100644 --- a/wpf/Menu/Binding-and-DataTemplate-Support.md +++ b/wpf/Menu/Binding-and-DataTemplate-Support.md @@ -22,121 +22,139 @@ The data source can be bound to MenuItemAdv by using the ItemsSource property. W {% tabs %} {% highlight xaml %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - < {% endhighlight %} - {% highlight C# %} - public class MenuList -{ - public int MenuID { get; set; } - public string Caption { get; set; } - public MenuList() { } - public MenuList(string capt, int id) - { - Caption = capt; - MenuID = id; - } - } - public class MenuListCollection : ObservableCollection - { - public MenuListCollection() - { - for (int i = 0; i < 5; i++) - { - this.Add(new MenuList() - { - MenuID = i, Caption = "Menu " + (i + 1).ToString() }); - } - } - } - public class ObjectModel - { - public ObjectModel(string myString1, params ObjectModel[] myItems) - { - myString = myString1; - ObservableCollection itemsObservableCollection = new ObservableCollection(); - foreach (var item in myItems) - { - itemsObservableCollection.Add(item); - } - Items = itemsObservableCollection; - } - public string myString { get; set; } - public ObservableCollection Items { get; set; }} - public class CustomItemSource : ObservableCollection - { - public CustomItemSource() - { - this.Add(new ObjectModel("User Interface Edition", - new ObjectModel("ASP.NET", new ObjectModel("Tools", - new ObjectModel("Menu"), new ObjectModel("Toolbar"), - new ObjectModel("RangeSlider")), new ObjectModel("Diagram"), - new ObjectModel("Gauge"), new ObjectModel("Chart")), - new ObjectModel("ASP.NET MVC"), new ObjectModel("Windows Forms"), - new ObjectModel("WPF", new ObjectModel("Tools", new - ObjectModel("Menu"), new ObjectModel("Toolbar"), new - ObjectModel("RangeSlider")), new ObjectModel("Diagram"), new - ObjectModel("Gauge"), new ObjectModel("Chart")), new - ObjectModel("Silverlight", new ObjectModel("Tools", new - ObjectModel("Menu"), new ObjectModel("Toolbar"), new - ObjectModel("RangeSlider")), new ObjectModel("Diagram"), new - ObjectModel("Gauge"), new ObjectModel("Chart")))); - this.Add(new ObjectModel("Reporting Edition", - new ObjectModel("Essential Reports"), new ObjectModel - ("Essential XlsIO"), new ObjectModel("Essential DocIO"), - new ObjectModel("Essential PDF"), new ObjectModel("Essential - Calculate"), new ObjectModel("Essential Grouping"))); - this.Add(new ObjectModel("Business Intelligence", - new ObjectModel("Essential BI Chart"), new ObjectModel - ("Essential BI Client"), new ObjectModel("Essential BI Grid"), - new ObjectModel("Essential BI Gauge"))); - } - } +{ + public int MenuID { get; set; } + public string Caption { get; set; } + + public MenuList() { } + + public MenuList(string capt, int id) + { + Caption = capt; + MenuID = id; + } +} + +public class MenuListCollection : ObservableCollection +{ + public MenuListCollection() + { + for (int i = 0; i < 5; i++) + { + this.Add(new MenuList + { + MenuID = i, + Caption = "Menu " + (i + 1).ToString() + }); + } + } +} + +public class ObjectModel +{ + public ObjectModel(string myString1, params ObjectModel[] myItems) + { + myString = myString1; + ObservableCollection itemsObservableCollection = new ObservableCollection(); + foreach (var item in myItems) + { + itemsObservableCollection.Add(item); + } + Items = itemsObservableCollection; + } + + public string myString { get; set; } + public ObservableCollection Items { get; set; } +} + +public class CustomItemSource : ObservableCollection +{ + public CustomItemSource() + { + this.Add(new ObjectModel("User Interface Edition", + new ObjectModel("ASP.NET", + new ObjectModel("Tools", + new ObjectModel("Menu"), + new ObjectModel("Toolbar"), + new ObjectModel("RangeSlider")), + new ObjectModel("Diagram"), + new ObjectModel("Gauge"), + new ObjectModel("Chart")), + new ObjectModel("ASP.NET MVC"), + new ObjectModel("Windows Forms"), + new ObjectModel("WPF", + new ObjectModel("Tools", + new ObjectModel("Menu"), + new ObjectModel("Toolbar"), + new ObjectModel("RangeSlider")), + new ObjectModel("Diagram"), + new ObjectModel("Gauge"), + new ObjectModel("Chart")), + new ObjectModel("Silverlight", + new ObjectModel("Tools", + new ObjectModel("Menu"), + new ObjectModel("Toolbar"), + new ObjectModel("RangeSlider")), + new ObjectModel("Diagram"), + new ObjectModel("Gauge"), + new ObjectModel("Chart")) + )); + + this.Add(new ObjectModel("Reporting Edition", + new ObjectModel("Essential Reports"), + new ObjectModel("Essential XlsIO"), + new ObjectModel("Essential DocIO"), + new ObjectModel("Essential PDF"), + new ObjectModel("Essential Calculate"), + new ObjectModel("Essential Grouping"))); + + this.Add(new ObjectModel("Business Intelligence", + new ObjectModel("Essential BI Chart"), + new ObjectModel("Essential BI Client"), + new ObjectModel("Essential BI Grid"), + new ObjectModel("Essential BI Gauge"))); + } +} {% endhighlight %} - {% endtabs %} - - ![Adding menu items using data binding in WPF MenuAdv control](Binding-and-DataTemplate-Support_images/Binding-and-DataTemplate-Support_img1.png) - - ![Adding hierarchical menu items using data template in WPF MenuAdv control ](Binding-and-DataTemplate-Support_images/Binding-and-DataTemplate-Support_img2.png) - - ### Sample Link WPF Sample Browser-> Tools -> MenuAdv -> MenuAdv Demo diff --git a/wpf/Menu/Check-Box-and-Radio-Button-Support.md b/wpf/Menu/Check-Box-and-Radio-Button-Support.md index 49962739a8..2311f2cb12 100644 --- a/wpf/Menu/Check-Box-and-Radio-Button-Support.md +++ b/wpf/Menu/Check-Box-and-Radio-Button-Support.md @@ -21,51 +21,37 @@ If you set the CheckIcon property to RadioButton, then MenuItemAdv’s will be g {% highlight xaml %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + {% endhighlight %} diff --git a/wpf/Menu/Command-Binding-and-Command-Target-Support.md b/wpf/Menu/Command-Binding-and-Command-Target-Support.md index 8c6d0b3966..d71731b464 100644 --- a/wpf/Menu/Command-Binding-and-Command-Target-Support.md +++ b/wpf/Menu/Command-Binding-and-Command-Target-Support.md @@ -72,8 +72,6 @@ To use the Command Binding support in an application users have to create a Dele - - {% endhighlight %} {% highlight C# %} diff --git a/wpf/Menu/Customizing-Data-Templates.md b/wpf/Menu/Customizing-Data-Templates.md index d9b25707cb..e643039c1f 100644 --- a/wpf/Menu/Customizing-Data-Templates.md +++ b/wpf/Menu/Customizing-Data-Templates.md @@ -17,44 +17,24 @@ You can customize how a business object is displayed as MenuItemAdv using ItemTe {% highlight xaml %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - {% endhighlight %} - N> [View sample in GitHub](https://github.com/SyncfusionExamples/customizing-data-templates-in-menuadv) - Implementing the above code will generate the following MenuAdv control. ![Image showing the menu with ItemTemplate](Customizing-Data-Templates_images/Customizing-Data-Templates_img1.png) diff --git a/wpf/Menu/Data-Binding.md b/wpf/Menu/Data-Binding.md index 39b6536353..53701e0019 100644 --- a/wpf/Menu/Data-Binding.md +++ b/wpf/Menu/Data-Binding.md @@ -19,189 +19,98 @@ The MenuAdv control also supports binding to objects. The following example show ~~~csharp - public class Model - - { - - public Model() - - { - - SubItems = new ObservableCollection(); - - } - - - - public string Header { get; set; } - - - - public ObservableCollection SubItems { get; set; } - - - - } - + public class Model + { + public Model() + { + SubItems = new ObservableCollection(); + } + public string Header { get; set; } + public ObservableCollection SubItems { get; set; } + } ~~~ - 2. Create a ViewModel class and initialize the items. ~~~csharp - public class ViewModel - - { - - public ViewModel() - - { - + public class ViewModel + { + public ViewModel() + { MenuItems = new ObservableCollection(); - PopulateData(); + } - } - - - - public ObservableCollection MenuItems { get; set; } - - - - private void PopulateData() - - { + public ObservableCollection MenuItems { get; set; } + private void PopulateData() + { Model product = new Model() { Header = "Products" }; - PopulateSubSubItems(product); + MenuItems.Add(product); + } - MenuItems.Add(product); - - } - - - - private void PopulateSubSubItems(Model product) - - { - + private void PopulateSubSubItems(Model product) + { Model bi = new Model() { Header = "Business Intelligence" }; - - - Model ui = new Model() { Header = "User Interface" }; - - - Model wpf = new Model() { Header = "WPF" }; - - - Model tools = new Model() { Header = "Tools" }; - Model chart = new Model() { Header = "Chart" }; - Model grid = new Model() { Header = "Grid" }; - Model diagram = new Model() { Header = "Diagram" }; - Model gauge = new Model() { Header = "Gauge" }; - Model schedule = new Model() { Header = "Schedule" }; - Model edit = new Model() { Header = "Edit" }; - - wpf.SubItems.Add(tools); - wpf.SubItems.Add(chart); - wpf.SubItems.Add(grid); - wpf.SubItems.Add(diagram); - wpf.SubItems.Add(gauge); - wpf.SubItems.Add(schedule); - wpf.SubItems.Add(edit); - - Model sl = new Model() { Header = "Silverlight" }; ui.SubItems.Add(wpf); - ui.SubItems.Add(sl); - - Model reporting = new Model() { Header = "Reporting" }; product.SubItems.Add(bi); - product.SubItems.Add(ui); - product.SubItems.Add(reporting); - - - - } - - } - - - + } + } ~~~ 3. Create a ViewModel instance and use it as DataContext for the root window. - ~~~xaml - - + - - + ~~~ 4. Now configure the ItemsSource and ItemTemplate of MenuAdv. - ~~~xaml - - - - + - - - - - - - - - - - + + + - - - - - - + + ~~~ @@ -220,94 +129,51 @@ An XML file can also be used as _ItemsSource_ for the MenuAdv control. The follo ~~~xaml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + ~~~ 2. Add XmlDataProvider for the above XML document. - - ~~~xaml - - + ~~~ @@ -316,36 +182,16 @@ An XML file can also be used as _ItemsSource_ for the MenuAdv control. The follo ~~~xaml - - - - + - - - - - - - - - - - - - - - + + + - - - - - - + + ~~~ - This will create the following MenuAdv control. ![Data-Binding_images2](Data-Binding_images/Data-Binding_img2.png) diff --git a/wpf/Menu/Icon-Support.md b/wpf/Menu/Icon-Support.md index 2bf29f56c2..412996a609 100644 --- a/wpf/Menu/Icon-Support.md +++ b/wpf/Menu/Icon-Support.md @@ -21,52 +21,28 @@ The Icon support can be added to an application by using the Icon property of Me {% highlight xaml %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + -{% endhighlight %} +{% endhighlight %} ![Icon-Support_img1](Icon-Support_images/Icon-Support_img1.png) @@ -76,7 +52,6 @@ The Icon support can be added to an application by using the Icon property of Me The property for the Icon support is described in the following tabulation: -
diff --git a/wpf/Menu/InputGestureText-Support.md b/wpf/Menu/InputGestureText-Support.md index 2855f11b37..b35bb21bae 100644 --- a/wpf/Menu/InputGestureText-Support.md +++ b/wpf/Menu/InputGestureText-Support.md @@ -21,85 +21,44 @@ The value assigned by using the InputGestureText property will be displayed in M {% highlight xaml %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% endhighlight %} @@ -107,13 +66,11 @@ The value assigned by using the InputGestureText property will be displayed in M ![InputGestureText-Support_img1](InputGestureText-Support_images/InputGestureText-Support_img1.png) - ### Properties The property for the InputGestureText support is described in the following tabulation: -
diff --git a/wpf/Menu/Orientation-Support.md b/wpf/Menu/Orientation-Support.md index ec5e3f79c9..6d48a20f45 100644 --- a/wpf/Menu/Orientation-Support.md +++ b/wpf/Menu/Orientation-Support.md @@ -33,50 +33,28 @@ Users can add the Orientation support to MenuAdv used in the application as ment {% highlight xaml %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + -{% endhighlight %} +{% endhighlight %} ### Properties @@ -118,61 +96,34 @@ When the ExpandMode property is set to ExpandOnClick, you can open the submenu o {% highlight xaml %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + {% endhighlight %} - - ### Properties The property for the Expand Modes support is described in the following tabulation: -
diff --git a/wpf/Menu/Scroll-Support.md b/wpf/Menu/Scroll-Support.md index 560848c4c2..267763cab1 100644 --- a/wpf/Menu/Scroll-Support.md +++ b/wpf/Menu/Scroll-Support.md @@ -11,9 +11,7 @@ documentation: ug MenuAdv allows users to scroll through the submenu items so that all the items of the submenu are visible even if the submenu crosses the vertical boundary. The Scroll support can be enabled by setting the IsScrollEnabled property to true. If the IsScrollEnabled property is set to false, users will not be able to scroll through the submenu items and the items that cross the vertical boundary will not be visible. -![Scroll-Support_img1](Scroll-Support_images/Scroll-Support_img1.png)} - - +![Scroll-Support_img1](Scroll-Support_images/Scroll-Support_img1.png) ### Use Case Scenarios @@ -28,7 +26,6 @@ If the value of the IsScrollEnabled property is set to true, users can scroll th The property for the Scroll support is described in the following tabulation: -
@@ -44,7 +41,6 @@ DependencyProperty bool(true)
- ### Sample Link WPF Sample Browser-> Tools -> MenuAdv -> MenuAdv Demo From d8853e3028e1f452ab41c5a05d6f00b8e50717e8 Mon Sep 17 00:00:00 2001 From: Manivannan-E <92844213+Manivannan-E@users.noreply.github.com> Date: Tue, 24 Jun 2025 13:11:08 +0530 Subject: [PATCH 2/2] Update Data-Binding.md --- wpf/Menu/Data-Binding.md | 190 +++++++++++++++++++-------------------- 1 file changed, 94 insertions(+), 96 deletions(-) diff --git a/wpf/Menu/Data-Binding.md b/wpf/Menu/Data-Binding.md index 53701e0019..f8d9509377 100644 --- a/wpf/Menu/Data-Binding.md +++ b/wpf/Menu/Data-Binding.md @@ -19,15 +19,15 @@ The MenuAdv control also supports binding to objects. The following example show ~~~csharp - public class Model - { - public Model() - { - SubItems = new ObservableCollection(); - } - public string Header { get; set; } - public ObservableCollection SubItems { get; set; } - } +public class Model +{ + public Model() + { + SubItems = new ObservableCollection(); + } + public string Header { get; set; } + public ObservableCollection SubItems { get; set; } +} ~~~ @@ -36,56 +36,57 @@ The MenuAdv control also supports binding to objects. The following example show ~~~csharp - public class ViewModel - { - public ViewModel() - { - MenuItems = new ObservableCollection(); - PopulateData(); - } - - public ObservableCollection MenuItems { get; set; } - - private void PopulateData() - { - Model product = new Model() { Header = "Products" }; - PopulateSubSubItems(product); - MenuItems.Add(product); - } - - private void PopulateSubSubItems(Model product) - { - Model bi = new Model() { Header = "Business Intelligence" }; - Model ui = new Model() { Header = "User Interface" }; - Model wpf = new Model() { Header = "WPF" }; - Model tools = new Model() { Header = "Tools" }; - Model chart = new Model() { Header = "Chart" }; - Model grid = new Model() { Header = "Grid" }; - Model diagram = new Model() { Header = "Diagram" }; - Model gauge = new Model() { Header = "Gauge" }; - Model schedule = new Model() { Header = "Schedule" }; - Model edit = new Model() { Header = "Edit" }; - - wpf.SubItems.Add(tools); - wpf.SubItems.Add(chart); - wpf.SubItems.Add(grid); - wpf.SubItems.Add(diagram); - wpf.SubItems.Add(gauge); - wpf.SubItems.Add(schedule); - wpf.SubItems.Add(edit); - - Model sl = new Model() { Header = "Silverlight" }; - - ui.SubItems.Add(wpf); - ui.SubItems.Add(sl); - - Model reporting = new Model() { Header = "Reporting" }; - - product.SubItems.Add(bi); - product.SubItems.Add(ui); - product.SubItems.Add(reporting); - } - } +public class ViewModel +{ + public ViewModel() + { + MenuItems = new ObservableCollection(); + PopulateData(); + } + + public ObservableCollection MenuItems { get; set; } + + private void PopulateData() + { + Model product = new Model() { Header = "Products" }; + PopulateSubSubItems(product); + MenuItems.Add(product); + } + + private void PopulateSubSubItems(Model product) + { + Model bi = new Model() { Header = "Business Intelligence" }; + Model ui = new Model() { Header = "User Interface" }; + Model wpf = new Model() { Header = "WPF" }; + Model tools = new Model() { Header = "Tools" }; + Model chart = new Model() { Header = "Chart" }; + Model grid = new Model() { Header = "Grid" }; + Model diagram = new Model() { Header = "Diagram" }; + Model gauge = new Model() { Header = "Gauge" }; + Model schedule = new Model() { Header = "Schedule" }; + Model edit = new Model() { Header = "Edit" }; + + wpf.SubItems.Add(tools); + wpf.SubItems.Add(chart); + wpf.SubItems.Add(grid); + wpf.SubItems.Add(diagram); + wpf.SubItems.Add(gauge); + wpf.SubItems.Add(schedule); + wpf.SubItems.Add(edit); + + Model sl = new Model() { Header = "Silverlight" }; + + ui.SubItems.Add(wpf); + ui.SubItems.Add(sl); + + Model reporting = new Model() { Header = "Reporting" }; + + product.SubItems.Add(bi); + product.SubItems.Add(ui); + product.SubItems.Add(reporting); + } +} + ~~~ @@ -129,43 +130,40 @@ An XML file can also be used as _ItemsSource_ for the MenuAdv control. The follo ~~~xaml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ~~~ 2. Add XmlDataProvider for the above XML document.