public void Show()
 {
     IsVisible = true;
     MainContent.FadeTo(1);
     MainContent.TranslateTo(MainContent.TranslationX, 0);
     ShadowView.IsVisible = true;
 }
 private void ShowSIDConfirmBox()
 {
     PopupContainer.IsVisible = true;
     MainContent.FadeTo(1);
     MainContent.TranslateTo(MainContent.TranslationX, 0);
     ShadowView.IsVisible = true;
 }
Exemplo n.º 3
0
 public void Show(QuaddieGroup quaddie)
 {
     QuaddieLayout.Children.Clear();
     QuaddieLayout.Children.Add(GenerateQuaddieView(quaddie));
     IsVisible = true;
     MainContent.FadeTo(1);
     MainContent.TranslateTo(MainContent.TranslationX, 0);
     ShadowView.IsVisible = true;
 }
Exemplo n.º 4
0
        private void UpdateSelectedSegmentLayout(SegmentControlItem item)
        {
            // Unmark old value
            var oldItem = ItemsSource.FirstOrDefault(x => x.IsSelected);

            if (oldItem != null)
            {
                oldItem.IsSelected = false;

                Grid oldSelectedView = (Grid)segmentControlItems.Children.FirstOrDefault(x => (x as Grid)?.Children?.Any(c => (c as Label)?.Text == oldItem.Text) == true);

                if (oldSelectedView != null)
                {
                    if (UserBorder)
                    {
                        oldSelectedView.Children[0].BackgroundColor      = SegmentBackgroundColor;
                        (oldSelectedView.Children[1] as Label).TextColor = SegmentTextColor;
                    }
                    else
                    {
                        (oldSelectedView.Children[0] as BoxView).Color   = Color.Transparent;
                        (oldSelectedView.Children[1] as Label).TextColor = SegmentTextColor;
                    }
                }
            }

            // Mark new value
            item.IsSelected = true;

            Grid newSelectedView = (Grid)segmentControlItems.Children.FirstOrDefault(x => (x as Grid)?.Children?.Any(c => (c as Label)?.Text == item.Text) == true);

            if (newSelectedView != null)
            {
                if (UserBorder)
                {
                    newSelectedView.Children[0].BackgroundColor      = SelectedBackgroundColor;
                    (newSelectedView.Children[1] as Label).TextColor = SelectedTextColor;
                }
                else
                {
                    (newSelectedView.Children[0] as BoxView).Color   = SelectedBackgroundColor;
                    (newSelectedView.Children[1] as Label).TextColor = SelectedTextColor;
                }
            }

            Device.BeginInvokeOnMainThread(async() =>
            {
                await MainContent.FadeTo(0, length: 150);

                this.MainContent = item.Content;

                await MainContent.FadeTo(1, length: 150);
            });
        }
        private async void OnLoadingChanged()
        {
            if (MainContent == null)
            {
                return;
            }

            if (!m_skeletongrid.Children.Contains(MainContent))
            {
                m_skeletongrid.Children.Add(MainContent);
                MainContent.Opacity = 0;
            }

            if (!IsLoading)
            {
                if (m_skeletonLayout != null)
                {
                    _ = m_skeletonLayout.FadeTo(0, FadeTime);
                    StopAnimation();
                }
                await MainContent.FadeTo(1.0, FadeTime * 2);
            }
            else
            {
                if (m_skeletonLayout == null)
                {
                    m_skeletonLayout         = CreateSkeleton();
                    m_skeletonLayout.Opacity = 0.0;
                    m_skeletongrid.Children.Add(m_skeletonLayout);
                }

                _ = MainContent.FadeTo(0.0, FadeTime);
                _ = m_skeletonLayout.FadeTo(1.0, FadeTime);
                StartAnimation();
            }
        }