示例#1
0
        internal void Dettach(Microsoft.Phone.Shell.IApplicationBar appBar)
        {
            if (_isAttached)
            {
                IsEnabled = false;
                RemoveItemFromAppBarCore();

                InitialIndex = -1;
                Items        = null;
                AppBar       = null;

                _isAttached = false;
            }
        }
示例#2
0
        internal void Attach(Microsoft.Phone.Shell.IApplicationBar appBar, int initialIndex, IEnumerable <ApplicationBarMenuItem> items)
        {
            if (!_isAttached)
            {
                AppBar       = appBar;
                InitialIndex = initialIndex;
                Items        = items;
                AddItemToAppBarCore();

                if (Command != null)
                {
                    IsEnabled = Command.CanExecute(CommandParameter);
                }

                _isAttached = true;
            }
        }