コード例 #1
0
        public override bool EquivalentTo(MenuItemViewModelBase other)
        {
            if (!base.EquivalentTo(other))
            {
                return(false);
            }

            if (!(other is ToggleMenuItemViewModel toggleMenuItem))
            {
                return(false);
            }

            return(BindingSource == toggleMenuItem.BindingSource && BindingPath == toggleMenuItem.BindingPath);
        }
コード例 #2
0
        public override bool EquivalentTo(MenuItemViewModelBase other)
        {
            if (!base.EquivalentTo(other))
            {
                return(false);
            }

            if (!(other is RadioMenuItemViewModel radioMenuItem))
            {
                return(false);
            }

            return(GroupName == radioMenuItem.GroupName && BindingSource == radioMenuItem.BindingSource && BindingPath == radioMenuItem.BindingPath);
        }
コード例 #3
0
        public override bool EquivalentTo(MenuItemViewModelBase other)
        {
            if (!base.EquivalentTo(other))
            {
                return(false);
            }

            if (!(other is ExpandableMenuItemViewModel otherExpandable) ||
                SubItems.Count != otherExpandable.SubItems.Count)
            {
                return(false);
            }

            return(!SubItems.Where((t, i) => !t.EquivalentTo(otherExpandable.SubItems[i])).Any());
        }