Example #1
0
 public void Show()
 {
     Shown = Visible = true;
     ShowMenu(StartingMenu);
     OnShown?.Invoke();
     UpdateWindow();
 }
Example #2
0
        /// <summary>
        /// 显示当前警告消息框。
        /// </summary>
        public async Task Show()
        {
            IsShown = true;
            await OnShown.InvokeAsync(IsShown);

            StateHasChanged();
        }
Example #3
0
        public static void Show(IInputWrapper input, string title, Dictionary <string, Action> menuItemMap)
        {
            menuView_ = ObjectPoolManager.CreateView <MenuView>(GamePrefabs.Instance.MenuViewPrefab);
            menuView_.Init(input, title, menuItemMap);

            OnShown.Invoke();
        }
Example #4
0
        /// <summary>
        /// 显示遮罩层。
        /// </summary>
        public async Task Show()
        {
            IsShown = true;
            await OnShown.InvokeAsync(true);

            StartCountdownForTimeout();

            StateHasChanged();
        }
Example #5
0
        public static void Show(InputDevice inputDevice, IEnumerable <ScrollableMenuItem> items)
        {
            if (popup_ != null)
            {
                CleanupPopup();
            }

            popup_ = ObjectPoolManager.CreateView <ScrollableMenu>(GamePrefabs.Instance.ScrollableMenuPopupPrefab);
            popup_.Init(new IInputWrapper[] { new InputWrapperDevice(inputDevice) }, items);
            popup_.OnRecycled += HandlePopupRecycled;
            OnShown.Invoke();
        }
        protected override async Task OnAfterRenderAsync(bool firstRender)
        {
            if (firstRender)
            {
                HasRender = true;
                if (Target != null)
                {
                    if (!IsDropdown)
                    {
                        await BlazorStrap.Interop.AddEventAsync(_objectRef, Target, EventType.Click);
                    }
                    if (MouseOver)
                    {
                        await BlazorStrap.Interop.AddEventAsync(_objectRef, Target, EventType.Mouseenter);

                        await BlazorStrap.Interop.AddEventAsync(_objectRef, Target, EventType.Mouseleave);
                    }

                    EventsSet = true;
                }
            }
            else
            {
                if (!_called)
                {
                    return;
                }
                _called = false;
                // Since there is no transition without a we run into a issue where rapid calls break the popover.
                // The delay allows the popover time to clean up
                await Task.Delay(100);

                if (Shown)
                {
                    if (OnShown.HasDelegate)
                    {
                        await OnShown.InvokeAsync(this);
                    }
                }
                else
                {
                    if (OnHidden.HasDelegate)
                    {
                        await OnHidden.InvokeAsync(this);
                    }
                }
            }
        }
Example #7
0
        public void ShowWindow <T>()
            where T : Window
        {
            var window = GetWindow <T>();

            if (!ReferenceEquals(_current, null))
            {
                _current.OnHide();
            }

            window.OnShow();

            OnShown.Invoke(window);

            _current = window;
        }
        public StackViewLayout(Transform layout, IBackgroundView background)
        {
            _background = background;
            Layout      = layout;

            OnClosed.Where(x => x == _activeView).
            Subscribe(HideView).
            AddTo(LifeTime);

            OnHidden.Where(x => x == _activeView).
            Subscribe(HideView).
            AddTo(LifeTime);

            OnShown.Where(x => x != _activeView).
            Subscribe(ActivateView).
            AddTo(LifeTime);
        }
Example #9
0
        public override async Task ShowAsync()
        {
            if (OnShow.HasDelegate)
            {
                await OnShow.InvokeAsync(this);
            }
            Shown = true;
            await BlazorStrap.Interop.SetStyleAsync(MyRef, "display", "block");

            if (Target != null)
            {
                await BlazorStrap.Interop.AddPopoverAsync(MyRef, Placement, Target);
            }
            await BlazorStrap.Interop.UpdatePopoverArrowAsync(MyRef, Placement, true);

            await BlazorStrap.Interop.AddClassAsync(MyRef, "show");

            if (OnShown.HasDelegate)
            {
                _ = Task.Run(() => { _ = OnShown.InvokeAsync(this); });
            }
        }
 public override Sequence Hide()
 {
     OnShown.RemoveAllListeners();
     return(base.Hide());
 }
Example #11
0
 public override void Show()
 {
     Debug.Log($"Popup shown {gameObject.name}");
     OnShown?.Invoke(this);
 }
Example #12
0
 protected virtual void Shown(EventArgs e)
 {
     OnShown?.Invoke(this, e);
 }