Is it possible to load multiple levels of menu into the radial menu via a ViewModel?
Although I can see how to load items manually:
radialMenu.Items[n].Items.Add(colorSubMenuItem);
If I construct a ViewModel to take advantage of the ItemSource feature and MVVM, I cannot see how to create a structure to support nested menu
Hi Jeya, thank-you for your response.
I don't seem to be able to download the sample? It says 'Access Denied'? I am logged in, as I would not be able to post this reply?
Can you please provide the sample again or update the link so that I can download it.
Thank-you Jeya, I will have a look at the sample
Hi Jeya, the sample has been very useful.
In my use-case, the menu could be n-levels deep. I have modified the sample to load a SfRadialMenuItem that displays a View (SfAvatar in this case), but only one level deep (there would be an indeterminate number of levels). I have attached an ItemTapped event to the SfRadialMenuItem, in order to load a second level for the item placed in the 'East' position (Alexander). This clears the EmployeeCollection, and loads with a new set of Employees. Although I can see that the EmployeeCollection as been refreshed, the display remains unaltered - the 'Items' binding is not working.
I would have expected the SfRadialMenu to refresh if Items is bound to the EmployeeCollection, which is Observable?
private void RMI_ItemTapped(object sender, Syncfusion.SfRadialMenu.XForms.ItemTappedEventArgs e)
{
SfRadialMenuItem RMI = (SfRadialMenuItem)sender;
if (RMI.Text == "Alex")
{
RMI.Items = DisplayAlexLevel2Items();
}
private ObservableCollection<SfRadialMenuItem> DisplayAlexLevel2Items() {
EmployeeCollection.Clear();
AddRadialMenuItem("Ellie", "Ellie.png");
AddRadialMenuItem("Finley", "Finley.png");
AddRadialMenuItem("Gabriella", "Gabriella.png");
AddRadialMenuItem("Jackson", "Jackson.png");
AddRadialMenuItem("Jayden", "Jayden.png");
return EmployeeCollection; } |
Hi Jeya, thank-you for the update. I have looked at the updated sample. I have further modified it to explore my use-case of n-levels by adding the following:
private ObservableCollection<SfRadialMenuItem> DisplayAlexLevel3Items()
{
EmployeeCollection.Clear();
AddRadialMenuItem("Kaylee", "Kaylee.png");
AddRadialMenuItem("Leila", "Leila.png");
AddRadialMenuItem("Lucy", "Lucy.png");
AddRadialMenuItem("Mckenna", "Mckenna.png");
AddRadialMenuItem("Michael", "Michael.png");
return EmployeeCollection;
}
private void RMI_ItemTapped(object sender, Syncfusion.SfRadialMenu.XForms.ItemTappedEventArgs e)
{
SfRadialMenuItem RMI = (SfRadialMenuItem)sender;
if (RMI.Text == "Alex")
{
RMI.Items = DisplayAlexLevel2Items();
}
else if (RMI.Text == "Ellie")
RMI.Items = DisplayAlexLevel3Items();
}
Unfortunately clicking on the 'level 2' menu item does not refresh to display 'level 3' items?
Thank-you Jeya.
Hi Jeya,
Is the patch available to test please?
Hi Jeya,
Thank-you for the custom assemblies, I have applied them to my test program. I can see that the images are now refreshed when the underlying collection is changed.
Is there a way of preventing the refresh when the bound collection is not modified? For instance at the top level, if you select 'Aiden' rather than 'Alex', there is no change to the underlying collection, but the menu collapses and refreshes anyway? This will be distracting to a user if an action is to be applied when there is no collection change?
Hi Peter Mortley,
Thanks for your patience. We have fixed the reported issue and find the assembly from the link below.
Assembly Version: 19.1.0.69
Disclaimer: Please note that we have created this patch for the version v19.1.0.69 specifically to resolve the issue reported in this incident.
Assembly: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SubMenuItem_Assembly1858797492
Note: Please refer the below link to apply the custom assembly
Note: We have created this patch only for resolving this issue, based on your confirmation we will proceed further on our next release.
When using the same collection for SfRadialMenu Items and SfRadialMenuItem Items, the whole radial menu items are cleared when setting the SfRadialMenuItem items collection. So we have modified the sample. Check the sample from the below link:
Regards,
Ruba Shanmugam
Hi Ruba,
Thank-you for the update, I am in the process of evaluation.
Best Regards,
Peter.
Hi Ruba,
I have evaluated the solution, and can confirm that I am satisfied that it will now allow my intended use case.
Please continue to release the patch, and thank-you for your effort in resolving this issue,
With Best Regards,
Peter.