示例#1
0
    public void Open(IEnumerable <CharacterSnapshot> snaphots)
    {
        ClearChildren();

        foreach (var snapshot in snaphots)
        {
            var stateUI = Instantiate(statePrefab, states).GetComponent <CharacterStateUI>();
            stateUI.SetUI(snapshot, this);
            stateUIs.Add(stateUI);
        }

        mainPanel.SetActive(true);
        PanelOpened?.Invoke();
    }
        private async void BreakdownTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            await Device.InvokeOnMainThreadAsync(() =>
            {
                if (!isDesktop)
                {
                    Grid.SetColumn(BreakdownView, 0);
                }
                else
                {
                    Grid.SetColumn(BreakdownView, 1);
                }

                PanelOpened?.Invoke(this, new EventArgs());
            });
        }
        private async void PBreakdown_Clicked(object sender, EventArgs e)
        {
            var p = BindingContext as PredictionContainer;

            var name = p.Name;

            var parent  = Parent.Parent.Parent as Grid;
            var oldview = BreakdownView;

            if (BreakdownView != null)
            {
                await BreakdownView.FadeTo(0);

                BreakdownView = null;
            }

            BreakdownView = new PredictionBreakdown(p.show, p.network)
            {
                Opacity         = 0,
                BackgroundColor = Content.BackgroundColor
            };

            parent.Children.Add(BreakdownView);

            BreakdownView.Padding = p.IsShowPage ? new Thickness(0, 50, 0, 0) : 0;

            if (isDesktop)
            {
                Grid.SetColumn(BreakdownView, 1);
            }
            PanelOpened?.Invoke(this, new EventArgs());
            await BreakdownView.FadeTo(1);

            if (oldview != null)
            {
                parent.Children.Remove(oldview);
            }
        }
 public void Open()
 {
     gameObject.SetActive(true);
     PanelOpened?.Invoke();
 }