set
{
+ if (Content == null)
+ {
+ Content = CreateDefaultContent();
+ if (styleApplied && (menuStyle != null))
+ {
+ Content.ApplyStyle(menuStyle.Content);
+ }
+ }
+
if (menuItems != null)
{
foreach (var oldItem in menuItems)
{
- if (content.Children?.Contains(oldItem) == true)
+ if (Content.Children?.Contains(oldItem) == true)
{
- content.Remove(oldItem);
+ Content.Remove(oldItem);
}
}
}
if (menuItems == null)
{
+ Content.SetVisible(false);
return;
}
+ if (Content.Visibility == false)
+ {
+ Content.SetVisible(true);
+ }
+
foreach (var item in menuItems)
{
- content.Add(item);
+ Content.Add(item);
menuItemGroup.Add(item);
}
}
// if Anchor has Layout, then Menu is displayed at an incorrect position.
ExcludeLayouting = true;
- Content = CreateDefaultContent();
- if (styleApplied && (menuStyle != null))
- {
- Content.ApplyStyle(menuStyle.Content);
- }
-
Scrim = CreateDefaultScrim();
menuItemGroup = new MenuItemGroup();
// If there is not enought space, then menu's size can be also resized.
private void CalculateMenuPosition()
{
- if ((Anchor == null) || (Content == null))
- {
- return;
- }
-
- if (Items == null)
+ if (Anchor == null)
{
return;
}