/// <summary>
                /// Activates the specified item.
                /// </summary>
                /// <param name="item">The item to activate.</param>
                public override void ActivateItem(T item)
                {
                    if (item != null && ReferenceEquals(item, ActiveItem))
                    {
                        if (IsActive)
                        {
                            ScreenHelper.TryActivate(item);
                            OnActivationProcessed(item, true);
                        }

                        return;
                    }

                    ChangeActiveItem(item, false);
                }
Exemplo n.º 2
0
                /// <summary>
                /// Activates the specified item.
                /// </summary>
                /// <param name="item">The item to activate.</param>
                public override void ActivateItem(T item)
                {
                    if (item == null)
                    {
                        return;
                    }

                    item = EnsureItem(item);

                    if (IsActive)
                    {
                        ScreenHelper.TryActivate(item);
                    }

                    OnActivationProcessed(item, true);
                }
Exemplo n.º 3
0
        /// <summary>
        /// Activates the specified item.
        /// </summary>
        /// <param name="item">The item to activate.</param>
        public override async void ActivateItem(T item)
        {
            if (item != null && ReferenceEquals(item, ActiveItem))
            {
                if (IsActive)
                {
                    ScreenHelper.TryActivate(item);
                    OnActivationProcessed(item, true);
                }
                return;
            }

            var result = await CloseStrategy.ExecuteAsync(new[] { ActiveItem });

            if (result.Item1)
            {
                ChangeActiveItem(item, true);
            }
            else
            {
                OnActivationProcessed(item, false);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Called when activating.
 /// </summary>
 protected override void OnActivate()
 {
     ScreenHelper.TryActivate(ActiveItem);
 }