コード例 #1
0
        private void SaveTap(object sender, EventArgs e)
        {
            // this works but the on blur event is called by leaving the page
            // and will manipulate the current object so locking is required for
            // credentials
            (sender as ApplicationBarIconButton).UpdateBindingSource();

            Account account = (DataContext as AccountDataContext).CurrentAccount;

            if (!account.CanSave())
            {
                return;
            }

            // show overlay
            if (_overlay == null)
            {
                _overlay = new ProgressOverlayPopup("EditAccountPage_CheckingConnection".Translate());
                _overlay.ShowCompleted += new EventHandler(OverlayFadeIn);
            }
            _overlay.Show();
        }
コード例 #2
0
        /// <summary>
        /// Tries to fetch a given path and refreshes the views.
        /// </summary>
        /// <param name="path"></param>
        private void FetchStructure(string path)
        {
            string viewMode = _views[_viewIndex];

            _workingPath = path;

            if (_overlay == null)
            {
                _overlay = new ProgressOverlayPopup()
                {
                    BackgroundColor = Colors.Transparent
                };
            }

            switch (viewMode)
            {
            case "tile":
                DetailList.Hide();
                DetailList.Items.Clear();
                TileViewContainer.Show();

                // fadeout existig from tile view
                if (TileView.Children.Count == 0)
                {
                    _overlay.Show();
                    StartRequest();
                }
                else
                {
                    int itemsLeft = TileView.Children.Count;
                    foreach (FrameworkElement item in TileView.Children)
                    {
                        item.FadeOut(100, () =>
                        {
                            --itemsLeft;
                            if (itemsLeft <= 0)
                            {
                                _overlay.Show();
                                TileView.Children.Clear();
                                StartRequest();
                            }
                        });
                    }
                }
                break;

            case "detail":
                TileViewContainer.Hide();
                DetailList.Show();
                // fadeout existing from detail view
                if (DetailList.Items.Count == 0)
                {
                    _overlay.Show();
                    StartRequest();
                }
                else
                {
                    int detailItemsLeft = DetailList.Items.Count;
                    foreach (FrameworkElement item in DetailList.Items)
                    {
                        item.FadeOut(100, () =>
                        {
                            --detailItemsLeft;
                            if (detailItemsLeft <= 0)
                            {
                                _overlay.Show();
                                DetailList.Items.Clear();
                                StartRequest();
                            }
                        });
                    }
                }
                break;
            }

            // start overlay
        }