Beispiel #1
0
        // 某 PivotItem 准备变成选中项
        private void pivot_PivotItemLoading(Pivot sender, PivotItemEventArgs args)
        {
            // args.Item - 相关的 PivotItem 对象

            lblMsg2.Text += "pivot_PivotItemLoading: " + args.Item.Header.ToString();
            lblMsg2.Text += Environment.NewLine;
        }
Beispiel #2
0
 private void PivotLayout_LoadingPivotItem(object sender, PivotItemEventArgs e)
 {
     if (e.Item.Content != null)
     {
         (e.Item.Content as FrameworkElement).DataContext = this.DataContext;
     }
 }
        private void Pivot_LoadedPivotItem_1(object sender, PivotItemEventArgs e)
        {
            ApplicationBar.Mode = ApplicationBarMode.Default;
            string hdr = e.Item.Header.ToString();

            switch (hdr)
            {
            case "info":
                break;

            case "personal":
                break;

            case "address":
                break;

            case "visits":
                break;

            case "reminders":
                ApplicationBar.Mode = ApplicationBarMode.Minimized;
                break;
            }
            if (App.ViewModel.ReturnVisitData.IsAddressValid)
            {
                MakeGeocodeRequest(App.ViewModel.ReturnVisitData.GeocodeAddress);
            }
        }
        // 直到切换到页面时才只刷新必要的页面
        private void Pivot_LoadedPivotItem(object sender, PivotItemEventArgs e)
        {
            switch ((sender as Pivot).SelectedIndex)
            {
            case 0:
                if (App.ViewModel.Hot.TopicsGroupItems == null)
                {
                    LoadHotTopics();
                }
                break;

            case 1:
                if (App.ViewModel.Hot.HotboardsItems == null)
                {
                    LoadHotBoards();
                }
                break;

            case 2:
                if (App.ViewModel.Hot.SectionItems == null)
                {
                    LoadSections();
                }
                break;
            }
        }
        private void Pivot_OnPivotItemLoading(Pivot sender, PivotItemEventArgs args)
        {
            if (!ViewModel.Initialized)
            {
                return;
            }
            switch (args.Item.Tag as string)
            {
            case "Details":
                ViewModel.LoadDetails();
                break;

            case "Reviews":
                ViewModel.LoadReviews();
                break;

            case "Recomm":
                ViewModel.LoadRecommendations();
                break;

            case "Related":
                ViewModel.LoadRelatedAnime();
                break;
            }
        }
Beispiel #6
0
        private void Pivot_LoadedPivotItem(object sender, PivotItemEventArgs e)
        {
            progress.Visibility  = System.Windows.Visibility.Visible;
            progress2.Visibility = System.Windows.Visibility.Visible;

            WebClient RssClient1 = new WebClient();

            WebClient RssClient2 = new WebClient();

            RssClient2.Encoding = Encoding.GetEncoding("iso-8859-1");

            LstNoticias.ItemsSource = null;
            LstAgenda.ItemsSource   = null;

            RssClient1.DownloadStringCompleted += RssClient_DownloadStringCompleted;
            RssClient2.DownloadStringCompleted += RssClient_DownloadStringCompleted;
            if (e.Item == Noticias)
            {
                RssClient1.DownloadStringAsync(new Uri(@"http://g1.globo.com/dynamo/musica/rss2.xml"));
            }
            else if (e.Item == Agenda)
            {
                RssClient2.DownloadStringAsync(new Uri(@"http://www.territoriodamusica.com/rss/agenda.xml"));
            }
        }
Beispiel #7
0
 private void pivot_LoadingPivotItem(object sender, PivotItemEventArgs e)
 {
     if ((e.Item != null) && (e.Item.Content is FrameBlock) && !((FrameBlock)e.Item.Content).HasInitiatedNavigation)
     {
         ((FrameBlock)e.Item.Content).StartNavigation();
     }
 }
        private void Pivot_LoadingPivotItem_1(object sender, PivotItemEventArgs e)
        {
            if (ApplicationBar != null)
            {
                ApplicationBar.IsVisible = false;
            }

            if (e.Item.Name == "HistoryPivot")
            {
                LoadHistoryList();
            }
            else if (e.Item.Name == "SearchPivot")
            {
                //호스트 내용이 비었으면 기본호스트 설정
                if (string.IsNullOrEmpty(hostTxtBox.Text.Trim()))
                {
                    defaultHostName = NetworkUtils.MulticastIP;
                    hostTxtBox.Text = defaultHostName;
                }

                if (NetworkUtils.IsNetworkAvailable && string.IsNullOrEmpty(hostTxtBox.Text.Trim()))
                {
                    findServerBtn.IsEnabled = false;

                    //포커스 이동 속도가 너무 빠르면 키보드가 텍스트박스를 덮는 현상이 생기므로 시간차 공격!
                    bgWorker                     = new BackgroundWorker();
                    bgWorker.DoWork             += bk_DoWork;
                    bgWorker.RunWorkerCompleted += bk_RunWorkerCompleted;
                    bgWorker.RunWorkerAsync();
                }
            }
        }
Beispiel #9
0
        private void controlPivot_LoadingPivotItem(object sender, PivotItemEventArgs e)
        {
            switch (this.controlPivot.SelectedIndex)
            {
            case 0:
                changeBackground("Images/principal.jpg");
                break;

            case 1:
                changeBackground("Images/elPadrino.jpg");
                break;

            case 2:
                changeBackground("Images/onceUponTime.jpg");
                break;

            case 3:
                changeBackground("Images/scarface.jpg");
                break;

            case 4:
                changeBackground("Images/ciudadDeDios.jpg");
                break;

            case 5:
                changeBackground("Images/carlitosWay.jpg");
                break;

            case 6:
                changeBackground("Images/Goodfellas.jpg");
                break;
            }
        }
        private void OnPivotItemUnloading(Pivot sender, PivotItemEventArgs args)
        {
            DemoModulePivotItem item = (DemoModulePivotItem)args.Item;

            PreferedOptionsVisibility = item.PreferedOptionsVisibility;
            item.ViewModel            = null;
        }
Beispiel #11
0
        private void week_LoadingPivotItem(object sender, PivotItemEventArgs e)
        {
            var pivot = sender as Pivot;
            var today = DateTime.Today;

            App.ViewModel.getTasksForSevenDays(pivot.SelectedIndex);
        }
Beispiel #12
0
 private void Pivoter_LoadingPivotItem(object sender, PivotItemEventArgs e)
 {
     if (e.Item.DataContext is CodeprojectBaseViewModel)
     {
         (e.Item.DataContext as CodeprojectBaseViewModel).OnLoad();
     }
 }
Beispiel #13
0
        static void control_PivotItemLoaded(Pivot sender, PivotItemEventArgs args)
        {
            var pi = sender as Pivot;

            if (pi != null)
            {
                var command = GetLoadedCommand(pi);

                var paramter = GetCommandParameter(pi);

                object obj = null;

                if (paramter != null)
                {
                    obj = paramter;
                }
                else
                {
                    obj = pi;
                }

                if (command != null && command.CanExecute(obj))
                {
                    command.Execute(obj);
                }
            }
        }
Beispiel #14
0
        private void OnLoadingPivotItem(object sender, PivotItemEventArgs e)
        {
            if (e.Item.Content != null)
            {
                // Content loaded already
                return;
            }

            Pivot pivot = (Pivot)sender;

            if (e.Item == pivot.Items[0])
            {
                e.Item.Content = new TimeSpan();
            }
            else if (e.Item == pivot.Items[1])
            {
                e.Item.Content = new CharactorAnalysis();
            }
            else if (e.Item == pivot.Items[2])
            {
                e.Item.Content = new LovePercentage();
            }
            else if (e.Item == pivot.Items[3])
            {
                e.Item.Content = new PotentialEnemy();
            }
        }
Beispiel #15
0
 void pivotControl_LoadedPivotItem(object sender, PivotItemEventArgs e)
 {
     if (!_skipPivotLoad)
     {
         ((ICommutePivotControl)e.Item.Content).Select();
     }
 }
Beispiel #16
0
        // 直到切换到页面时才只刷新必要的页面
        private void Pivot_LoadedPivotItem(object sender, PivotItemEventArgs e)
        {
            int type = (sender as Pivot).SelectedIndex;

            switch (type)
            {
            case 0:
                if (App.ViewModel.Mailbox.InboxItems != null)
                {
                    return;
                }
                break;

            case 1:
                if (App.ViewModel.Mailbox.SentItems != null)
                {
                    return;
                }
                break;

            case 2:
                if (App.ViewModel.Mailbox.DeletedItems != null)
                {
                    return;
                }
                break;
            }
            LoadMailbox(type);
        }
 private void pivot_OnItemLoaded(object sender, PivotItemEventArgs e)
 {
     if (e.Item == this.pivotItemPhotos && !this._photosLoaded)
     {
         this.ViewModel.PhotosVM.LoadData(false, false, null, false);
         this._photosLoaded = true;
     }
     if (e.Item == this.pivotItemVideos && !this._videosLoaded)
     {
         this.ViewModel.VideosVM.LoadData(false, false, null, false);
         this._videosLoaded = true;
     }
     if (e.Item == this.pivotItemAudios && !this._audiosLoaded)
     {
         this.ViewModel.AudiosVM.LoadData(false, false, null, false);
         this._audiosLoaded = true;
     }
     if (e.Item == this.pivotItemDocuments && !this._documentsLoaded)
     {
         this.ViewModel.DocumentsVM.LoadData(false, false, null, false);
         this._documentsLoaded = true;
     }
     if (e.Item != this.pivotItemLinks || this._linksLoaded)
     {
         return;
     }
     this.ViewModel.LinksVM.LoadData(false, false, null, false);
     this._linksLoaded = true;
 }
        private void BookmarkListsPivots_LoadingPivotItem(object sender, PivotItemEventArgs e)
        {
            var pivot = sender as Pivot;
            var listBox = (e.Item.Content as ListBox);

            if (listBox.Items.Count != 0) return;

            Binding binding = new Binding();
            if (e.Item == pivot.Items[0])
            {
                binding = new Binding("ReadingListView.View");
            }
            else if (e.Item == pivot.Items[1])
            {
                binding = new Binding("FavoritesView.View");
            }
            else if (e.Item == pivot.Items[2])
            {
                binding = new Binding("ArchiveView.View");
            }

            listBox.SelectedIndex = -1; //Setting SelectedIndex so that it doesn't navigate to the first article automatically.
            binding.Source = App.MainViewModel;
            listBox.SetBinding(ListBox.ItemsSourceProperty, binding);
            listBox.SelectionChanged += Bookmark_Selected;
            listBox.SelectedIndex = -1; //Setting SelectedIndex so that it doesn't highlight the first article.
        }
Beispiel #19
0
 // ----------------------------------------------------------------------------------------------------------------- //
 private void MainPivot_LoadedPivotItem(object sender, PivotItemEventArgs e)
 {
     if (!AppHelper.IsRate)
     {
         this.Assessment();
     }
 }
Beispiel #20
0
        // ----------------------------------------------------------------------------------------------------------------- //
        //private void AppSave_Click(object sender, EventArgs e)
        //{
        //    if (AppHelper.IsTrial) MessageBox.Show("Данная функция доступна в полной версии программы", "Сохранить совет в виде изображения", MessageBoxButton.OK);
        //    else
        //    {


        //        var streamResourceInfo = Application.GetResourceStream(new Uri("Background.png", UriKind.Relative));
        //        var image = new BitmapImage();
        //        image.SetSource(streamResourceInfo.Stream);
        //        var writeableBitmap = new WriteableBitmap(image);
        //        var bitmap = new BitmapImage(_bitmapImage.UriSource);
        //        var im = new Image() { Width = 480, Height = 350, Source = bitmap, Stretch = Stretch.Fill };

        //        var textBlockTitle = new TextBlock
        //        {
        //            FontSize = 28,
        //            Width = 200,
        //            Height = 60,
        //            FontWeight = FontWeights.Bold,
        //            TextAlignment = TextAlignment.Right,
        //            TextWrapping = TextWrapping.Wrap,
        //            Foreground = new SolidColorBrush(Color.FromArgb(210, 210, 210, 210)),
        //            Text = "СОВЕТ #" + AppHelper.PageIndex,
        //        };

        //        var textBlockText = new TextBlock
        //        {
        //            FontSize = 26,
        //            Width = 470,
        //            Height = 450,
        //            TextAlignment = TextAlignment.Center,
        //            TextWrapping = TextWrapping.Wrap,
        //            FontWeight = FontWeights.Bold,
        //            Foreground = new SolidColorBrush(Color.FromArgb(210, 210, 210, 210)),
        //            Text = BaseLineDB.ResourceManager.GetString("String" + AppHelper.PageIndex),
        //        };

        //        writeableBitmap.Render(textBlockTitle, new TranslateTransform { X = 270, Y = 8, });
        //        writeableBitmap.Render(textBlockText, new TranslateTransform { X = 5, Y = 400, });

        //        MessageBox.Show("Совет сохранен в библиотеку фотографий.", "Выполнено", MessageBoxButton.OK);

        //        writeableBitmap.Render(im, new TranslateTransform { X = 0, Y = 40, });
        //        writeableBitmap.Invalidate();

        //        using (var mediaLibrary = new MediaLibrary())
        //        {
        //            using (var stream = new MemoryStream())
        //            {
        //                writeableBitmap.SaveJpeg(stream, writeableBitmap.PixelWidth, writeableBitmap.PixelHeight, 0, 100);
        //                stream.Seek(0, SeekOrigin.Begin);
        //                mediaLibrary.SavePicture("Cовет_" + AppHelper.PageIndex + ".jpg", stream);
        //            }
        //        }
        //    }
        //}
        private void MainPivot_LoadingPivotItem(object sender, PivotItemEventArgs e)
        {
            if (MainPivot.SelectedIndex == 0 && _lastIndexItem == 1)
            {
                AppHelper.PageIndex--;
            }
            else if (MainPivot.SelectedIndex == 0 && _lastIndexItem == 2)
            {
                AppHelper.PageIndex++;
            }
            else if (MainPivot.SelectedIndex == 1 && _lastIndexItem == 0)
            {
                AppHelper.PageIndex++;
            }
            else if (MainPivot.SelectedIndex == 1 && _lastIndexItem == 2)
            {
                AppHelper.PageIndex--;
            }
            else if (MainPivot.SelectedIndex == 2 && _lastIndexItem == 0)
            {
                AppHelper.PageIndex--;
            }
            else if (MainPivot.SelectedIndex == 2 && _lastIndexItem == 1)
            {
                AppHelper.PageIndex++;
            }
            _lastIndexItem = MainPivot.SelectedIndex;
            SVFirst.ScrollToVerticalOffset(0.0d);
            SVSecond.ScrollToVerticalOffset(0.0d);
            SVThird.ScrollToVerticalOffset(0.0d);
            this.SelectedIndexLogic();
        }
 private void Pivoter_LoadingPivotItem(object sender, PivotItemEventArgs e)
 {
     if (e.Item.DataContext is CodeprojectBaseViewModel)
     {
         (e.Item.DataContext as CodeprojectBaseViewModel).OnLoad();
     }
 }
        private void BookmarkListsPivots_LoadingPivotItem(object sender, PivotItemEventArgs e)
        {
            var pivot   = sender as Pivot;
            var listBox = (e.Item.Content as ListBox);

            if (listBox.Items.Count != 0)
            {
                return;
            }

            Binding binding = new Binding();

            if (e.Item == pivot.Items[0])
            {
                binding = new Binding("ReadingListView.View");
            }
            else if (e.Item == pivot.Items[1])
            {
                binding = new Binding("FavoritesView.View");
            }
            else if (e.Item == pivot.Items[2])
            {
                binding = new Binding("ArchiveView.View");
            }

            listBox.SelectedIndex = -1; //Setting SelectedIndex so that it doesn't navigate to the first article automatically.
            binding.Source        = App.MainViewModel;
            listBox.SetBinding(ListBox.ItemsSourceProperty, binding);
            listBox.SelectionChanged += Bookmark_Selected;
            listBox.SelectedIndex     = -1; //Setting SelectedIndex so that it doesn't highlight the first article.
        }
Beispiel #23
0
        private void Pivot_LoadingPivotItem(object sender, PivotItemEventArgs e)
        {
            switch (e.Item.Name)
            {
            case "PILockscreenSetting":
                if (UpdateIntervalLockscreenPicker.ItemsSource == null)
                {
                    InitializeLockscreenSetting();
                }
                break;

            case "PILivetileSetting":
                if (UpdateIntervalLivetilePicker.ItemsSource == null)
                {
                    InitializeLivetileSetting();
                }
                break;

            case "PIExtraSetting":
                if (SkinColorPicker.ItemsSource == null)
                {
                    InitializeChameleonSetting();
                    InitializeCalendarSetting();
                    InitializeWeatherSetting();
                }
                break;
            }
        }
Beispiel #24
0
 private void pivotMain_LoadingPivotItem(object sender, PivotItemEventArgs e)
 {
     if (e.Item == lst)
         ApplicationBar.IsVisible = true;
     else
         ApplicationBar.IsVisible = false;
 }
 /// <summary>
 /// An event handler for pivot item load
 /// </summary>
 /// <param name="sender">The sender</param>
 /// <param name="args">The event args</param>
 private void Pivot_PivotItemLoaded(Pivot sender, PivotItemEventArgs args)
 {
     if (this.VM != null)
     {
         this.item2.Header = this.VM.Pivot2Title;
     }
 }
Beispiel #26
0
 private void Pivot_LoadingPivotItem(object sender, PivotItemEventArgs e)
 {
     this.data.CurrentFeed = (MainViewModel.CurrentFeedEnum)Enum.Parse(typeof(MainViewModel.CurrentFeedEnum), e.Item.Tag as string, true);
     if (accessToken != null)
     {
         LoadStream();
     }
 }
 private void Pivot_LoadedPivotItem(object sender, PivotItemEventArgs e)
 {
     switch ((String)(((PivotItem)(((Pivot)sender).SelectedItem)).Header))
     {
         case "Latest Posts": App.BlogModel.Items.Clear(); App.BlogModel.LoadData(); break;
         case "Categories": App.CategoryModel.Items.Clear(); App.CategoryModel.LoadData(); break;
         default: break;
     }
 }
        /// <summary>
        /// Lazy loading of pivot tabs for perf.
        /// only load a tab when a user access it
        /// Naturally all pivots are loaded when the control is created (we dont want this)
        /// </summary>
        private void UpdateTabInfoOnPivotLoading(Pivot sender, PivotItemEventArgs args)
        {
            int currentTabIndex = PhoneTabs.SelectedIndex;
            //Set device oritentation based on tab
            switch (currentTabIndex)
            {
                //For the contact and dialer tabs, we should disable landscape
                case 1:
                case 2:
                    DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait;
                    break;
                //Other tabs can be both portrait and landscape
                default:
                    DisplayInformation.AutoRotationPreferences =
                        DisplayOrientations.Portrait | DisplayOrientations.Landscape |
                        DisplayOrientations.PortraitFlipped | DisplayOrientations.LandscapeFlipped;
                    break;
            }

            //Update content as its already loaded
            if (args.Item.Content != null)
            {
                //Content loaded already, perform an update instead and exit
                UpdateTabInfo(currentTabIndex);
                return;
            }

            //Lazy load the tabs. Only load when accessed
            UserControl CurrentPanel;
            switch (currentTabIndex)
            {
                case 0:
                    statusVM = ViewModelDispatcher.StatusViewModel;
                    CurrentPanel = new StatusPanel();
                    CurrentPanel.Height = Double.NaN; //Auto height
                    args.Item.Content = CurrentPanel;
                    break;
                case 1:
                    CurrentPanel = new ContactsPanel();
                    CurrentPanel.Height = Double.NaN; //Auto height
                    args.Item.Content = CurrentPanel;
                    break;
                case 2:
                    CurrentPanel = new DialerPanel();
                    CurrentPanel.Height = Double.NaN; //Auto height
                    args.Item.Content = CurrentPanel;
                    break;
                case 3:
                    voicemailVM = ViewModelDispatcher.VoicemailViewModel;
                    CurrentPanel = new VoicemailPanel();
                    CurrentPanel.Height = Double.NaN; //Auto height
                    args.Item.Content = CurrentPanel;
                    break;
                default:
                    break;
            }
        }
Beispiel #29
0
 private void aq_PivotItemLoading(Pivot sender, PivotItemEventArgs args)
 {
     if (aq.SelectedItem == ra)
         sub.Visibility = Visibility.Visible;
     else
         sub.Visibility = Visibility.Collapsed;
         
         
 }
Beispiel #30
0
        private void Mainpivot_OnLoadingPivotItem(object sender, PivotItemEventArgs e)
        {
            var pivot = (Pivot)sender;

            if (e.Item == pivot.Items[2])
            {
                this.Button_Click_4(sender, new RoutedEventArgs());
            }
        }
Beispiel #31
0
        // When navigating to a pivotitem, reload the main page and hide the back
        // button
        private void MainPivot_PivotItemLoading(Pivot sender, PivotItemEventArgs args)
        {
            NavigationItem navItem        = (NavigationItem)((((PivotItemEventArgs)args).Item).DataContext);
            Frame          pivotItemFrame = (Frame)(((PivotItem)args.Item).ContentTemplateRoot);

            pivotItemFrame.Navigate(navItem.PageType, navItem);

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
        }
Beispiel #32
0
        private void SoundsPivot_PivotItemLoaded(Pivot sender, PivotItemEventArgs args)
        {
            // Deselect all items in both GridViews
            SoundGridView.DeselectRange(new ItemIndexRange(0, (uint)SoundGridView.Items.Count));
            FavouriteSoundGridView.DeselectRange(new ItemIndexRange(0, (uint)FavouriteSoundGridView.Items.Count));

            FileManager.itemViewHolder.SelectedSounds.Clear();
            soundsPivotSelected = (sender.SelectedIndex == 0);
        }
		private void Pivot_PivotItemLoaded(Pivot sender, PivotItemEventArgs args)
		{
			if (args.Item.Header.ToString().Equals("Movies"))
			{
				changeCommandBarButtonsVisibility(true);
			} else
			{
				changeCommandBarButtonsVisibility(false);
			}
		}
Beispiel #34
0
        private void MainPivot_LoadedPivotItem(object sender, PivotItemEventArgs e)
        {
            var loadItem = e.Item;

            if (loadItem == null)
            {
                return;
            }
            ClearItem(loadItem);
        }
        private void PianoRoll_OnUnloadedPivotItem(object sender, PivotItemEventArgs e)
        {
            var pianoRollPage = e.Item.GetFirstLogicalChildByType <PianoRollPage>(true);

            if (pianoRollPage == null)
            {
                return;
            }
            pianoRollPage.SaveOffset();
        }
        private void loadingPivotItem(object sender, PivotItemEventArgs e)
        {
            string     methodName = e.Item.Name + "_Load";
            MethodInfo method     = typeof(MainPage).GetMethod(methodName);

            if (method != null)
            {
                method.Invoke(this, null);
            }
        }
Beispiel #37
0
 private async void Pivot_PivotItemLoading(Pivot sender, PivotItemEventArgs args)
 {
     if (args.Item == PreviewPivotItem)
     {
         await TileManager.GenerateTileImagesAsync(MediumTileHost, WideTileHost, TileSettings);
         
         MediumTileImage.Source = await ReadBitmapAsync(new Uri(Constants.MediumTileImageFileUri));                
         WideTileImage.Source = await ReadBitmapAsync(new Uri(Constants.WideTileImageFileUri));
     }
 }
        // When navigating to a pivotitem, reload the main page and hide the back
        // button
        private void MainPivot_PivotItemLoading(Pivot sender, PivotItemEventArgs args)
        {
            NavigationItem navItem        = (NavigationItem)((((PivotItemEventArgs)args).Item).DataContext);
            Frame          pivotItemFrame = (Frame)(((PivotItem)args.Item).ContentTemplateRoot);

            pivotItemFrame.Navigate(navItem.PageType, navItem);
            pivotItemFrame.BackStack.Clear();

            FireBackStackChangedEvent();
        }
Beispiel #39
0
        private void OnLoadedPivotItem(object sender, PivotItemEventArgs e)
        {
            if (e.Item == _pivotItem)
            {
                _pivot.LoadedPivotItem    -= OnLoadedPivotItem;
                _pivot.UnloadingPivotItem += OnUnloadingPivotItem;

                BringToLife();
            }
        }
        private async void Pivot_LoadingPivotItem(object sender, PivotItemEventArgs e)
        {
            if (e.Item.Content != null)
            {
                return;
            }

            if (e.Item == (sender as Pivot).Items[2])
            {
                await (DataContext as ChallengeViewModel).CommentListViewModel.LoadData();
            }
        }
 private void OnPivotItemLoading(Pivot sender, PivotItemEventArgs args)
 {
     var commandBar = ((CommandBar) this.BottomAppBar);
     var buttons = commandBar
                     .PrimaryCommands
                     .Union(commandBar.SecondaryCommands)
                     .OfType<PivotItemAppBarButton>();
     foreach (var button in buttons)
     {
         button.Visibility = button.PivotItem == args.Item.Name ? Visibility.Visible : Visibility.Collapsed;
     }
 }
 private void MainPivot_LoadingPivotItem(object sender, PivotItemEventArgs e)
 {
     RefreshCurrentPivotItem();
     secondsString = exercise.Time.ToString();
     if (exercise.Machine.Type == MachineType.Cardio)
     {
         cardioPage = currentPivotItem.Content as CardioTrainingPage;
         setTimerRemaining = TimeSpan.FromSeconds(exercise.Time);
         cardioPage.setTimerValue.Text = setTimerRemaining.ToString(@"mm\:ss");
         //MessageBox.Show(exercise.ExerciseName);
     }
 }
 private void pivot_LoadedPivotItem(object sender, PivotItemEventArgs e)
 {
     if (e.Item == allDataItem && allDataList.ItemsSource == null)
     {
         allDataList.ItemsSource = data;
     }
     else if (e.Item == filteredDataItem && filteredDataList.ItemsSource == null)
     {
         filteredDataList.ItemsSource = from d in data
                                        where d.Category == SampleCategory.Even
                                        select d;
     }
 }
 /// <summary>
 /// Code to execute when a Pivot Item is loaded on the page.
 /// </summary>
 private void OnPivotItemLoaded(object sender, PivotItemEventArgs e)
 {
     if (!App.OrdersListViewModel.IsInitialized)
     {
         //Initialize ViewModel and Load Data for PivotItem upon initialization
         App.OrdersListViewModel.Initialize();
     }
     else
     {
         //Load Data for the currently loaded PivotItem
         App.OrdersListViewModel.LoadData(e.Item.Name);
     }
 }
        private void OnLoadingPivotItem(object sender, PivotItemEventArgs e)
        {
            // Do not set the content of the pivot item if the content has already been set
            if (e.Item.Content != null)
            {
                return;
            }

            // Create the user control for the selected pivot item
            var pivotItemContentControl = CreateUserControlForPivotItem(((Pivot)sender).SelectedIndex);

            // Update the content of the pivot item
            e.Item.Content = pivotItemContentControl;
        }
 private void pivot_UnloadedPivotItem(object sender, PivotItemEventArgs e)
 {
     if (!allDataOption.IsChecked.Value)
     {
         if (e.Item == allDataItem)
         {
             allDataList.ItemsSource = null;
         }
         else if (e.Item == filteredDataItem)
         {
             filteredDataList.ItemsSource = null;
         }
     }
 }
Beispiel #47
0
        public void SmartPivot_LoadingPivotItem(object sender, PivotItemEventArgs e)
        {
            //throw new NotImplementedException();

            PivotItem p = e.Item;
            MagicPivotViewModel.ColumnContent cc = p.Content as MagicPivotViewModel.ColumnContent;

            if (cc.ColContent.Count > 0 || cc.TypeRefs.Count > 0)
                return;

            cc.setColumnContent();

            vm.TabIndex = SmartPivot.SelectedIndex;
            Debug.WriteLine("Set content for " + cc.ColumnHeader + ". got " + cc.ColContent.Count + " items");
        }
        private void PivotElement_LoadedPivotItem(object sender, PivotItemEventArgs e)
        {
            // Get current station
            var station = e.Item.DataContext as Models.MeasuringStation;

            // If diagram hasn't been loaded yet, start async call to fetch it
            if (station.Diagram == null)
            {
                // Get diagram request url
                const string url = "{0}{1}/datastreams/{2}.png?width={3}&height={4}&colour=F15A24&duration=24hours&detailed_grid=true&show_axis_labels=true&title=&timezone=UTC+1";
                int width = Convert.ToInt32(PivotElement.ActualWidth - PivotElement.Margin.Left - PivotElement.Margin.Right);
                int height = width/4*3;

                // Create web request
                var wc = new WebClient();
                wc.OpenReadCompleted += new OpenReadCompletedEventHandler((a, b) => wc_LoadingDiagramCompleted(a, b, station));
                wc.OpenReadAsync(new Uri(String.Format(url, API.BaseUrl, API.FeedId, station.Id, width, height)));
            }
        }
        private void LoadPivot(object sender, PivotItemEventArgs e)
        {
            if (e.Item == concursos)
            {
                ApplicationBarIconButton appBarMais_Click = (ApplicationBarIconButton)ApplicationBar.Buttons[0];
                appBarMais_Click.IsEnabled = true;
                ApplicationBarIconButton appBarSobre_Save = (ApplicationBarIconButton)ApplicationBar.Buttons[1];
                appBarSobre_Save.IsEnabled = true;
                CarregaConcurso();
            }

            if (e.Item == agora)
            {
                ApplicationBarIconButton appBarMais_Click = (ApplicationBarIconButton)ApplicationBar.Buttons[0];
                appBarMais_Click.IsEnabled = false;
                ApplicationBarIconButton appBarSobre_Save = (ApplicationBarIconButton)ApplicationBar.Buttons[1];
                appBarSobre_Save.IsEnabled = false;
                try 
                {
                    CarregaAgora();
                }
                catch
                {
                    MessageBox.Show("Espere um pouco, esta carregando.\nPasse A Pagina para recarregar.");
                }

            }
            if (e.Item == PrevisaoPivot)
            {
                ApplicationBarIconButton appBarMais_Click = (ApplicationBarIconButton)ApplicationBar.Buttons[0];
                appBarMais_Click.IsEnabled = false;
                ApplicationBarIconButton appBarSobre_Save = (ApplicationBarIconButton)ApplicationBar.Buttons[1];
                appBarSobre_Save.IsEnabled = false;
                try 
                {
                    CarregaPrevisão();
                }
                catch
                {
                    MessageBox.Show("Espere um pouco, esta carregando.\nPasse A Pagina para recarregar.");
                }
            }
        }
 private void Pivot_OnPivotItemLoading(Pivot sender, PivotItemEventArgs args)
 {
     if (!ViewModel.Initialized)
         return;
     switch (args.Item.Tag as string)
     {
         case "Details":
             ViewModel.LoadDetails();
             break;
         case "Reviews":
             ViewModel.LoadReviews();
             break;
         case "Recomm":
             ViewModel.LoadRecommendations();
             break;
         case "Related":
             ViewModel.LoadRelatedAnime();
             break;
     }
 }
 private void BookmarkListsPivots_LoadedPivotItem(object sender, PivotItemEventArgs e)
 {
     var pivot = sender as Pivot;
     if (e.Item == pivot.Items[0])
     {
         ReadingListSortOrder.Visibility = Visibility.Visible;
         FavoritesSortOrder.Visibility = Visibility.Collapsed;
         ArchiveSortOrder.Visibility = Visibility.Collapsed;
     }
     else if (e.Item == pivot.Items[1])
     {
         ReadingListSortOrder.Visibility = Visibility.Collapsed;
         FavoritesSortOrder.Visibility = Visibility.Visible;
         ArchiveSortOrder.Visibility = Visibility.Collapsed;
     }
     else if (e.Item == pivot.Items[2])
     {
         ReadingListSortOrder.Visibility = Visibility.Collapsed;
         FavoritesSortOrder.Visibility = Visibility.Collapsed;
         ArchiveSortOrder.Visibility = Visibility.Visible;
     }
 }
Beispiel #52
0
        private void OnLoadingPivotItem(object sender, PivotItemEventArgs e)
        {
            if (e.Item.Content != null)
            {
                // Content loaded already
                return;
            }

            Pivot pivot = (Pivot)sender;

            if (e.Item == pivot.Items[0])
            {
                e.Item.Content = new ReportsList();
            }
            else if (e.Item == pivot.Items[1])
            {
                e.Item.Content = new Statistics();
            }
            else if (e.Item == pivot.Items[2])
            {
                e.Item.Content = new ReportsMapping();
            }
        }
Beispiel #53
0
        private void pivot_LoadingPivotItem(object sender, PivotItemEventArgs e)
        {
            if (e.Item == null)
            {
                System.Diagnostics.Debug.WriteLine("pivot_LoadingPivotItem's EventArgs returns null");
                return;
            }
            System.Diagnostics.Debug.WriteLine("pivot loaded, we are good!");

            switch (e.Item.Header.ToString())
            {
                case "sunday":
                    sun.SubjectList.ItemsSource = null;
                    sun.SubjectList.ItemsSource = from x in a.timetable
                                                  where x.day == MyWeekDay.Sunday
                                                  orderby x.time.TimeOfDay
                                                  select new
                                                  {
                                                      time = x.time.Hour.ToString().PadLeft(2, '0') + ":" + x.time.Minute.ToString().PadLeft(2, '0'),
                                                      shortName = x.subject.ShortName,
                                                      to = (x.time.AddTicks(x.subject.Duration)).Hour.ToString().PadLeft(2, '0') + ":" + (x.time.AddTicks(x.subject.Duration)).Minute.ToString().PadLeft(2, '0'),
                                                      //longName = x.subject.LongName,
                                                      tte = x
                                                  };
                    break;
                case "monday":
                    mon.SubjectList.ItemsSource = null;
                    mon.SubjectList.ItemsSource = from x in a.timetable
                                                  where x.day == MyWeekDay.Monday
                                                  orderby x.time.TimeOfDay
                                                  select new
                                                  {
                                                      time = x.time.Hour.ToString().PadLeft(2, '0') + ":" + x.time.Minute.ToString().PadLeft(2, '0'),
                                                      shortName = x.subject.ShortName,
                                                      to = (x.time.AddTicks(x.subject.Duration)).Hour.ToString().PadLeft(2, '0') + ":" + (x.time.AddTicks(x.subject.Duration)).Minute.ToString().PadLeft(2, '0'),
                                                      //longName = x.subject.LongName,
                                                      tte = x
                                                  };
                    break;
                case "tuesday":
                    tue.SubjectList.ItemsSource = null;
                    tue.SubjectList.ItemsSource = from x in a.timetable
                                                  where x.day == MyWeekDay.Tuesday
                                                  orderby x.time.TimeOfDay
                                                  select new
                                                  {
                                                      time = x.time.Hour.ToString().PadLeft(2, '0') + ":" + x.time.Minute.ToString().PadLeft(2, '0'),
                                                      shortName = x.subject.ShortName,
                                                      to = (x.time.AddTicks(x.subject.Duration)).Hour.ToString().PadLeft(2, '0') + ":" + (x.time.AddTicks(x.subject.Duration)).Minute.ToString().PadLeft(2, '0'),
                                                      //longName = x.subject.LongName,
                                                      tte = x
                                                  };
                    break;
                case "wednesday":
                    wed.SubjectList.ItemsSource = null;
                    wed.SubjectList.ItemsSource = from x in a.timetable
                                                  where x.day == MyWeekDay.Wednesday
                                                  orderby x.time.TimeOfDay
                                                  select new
                                                  {
                                                      time = x.time.Hour.ToString().PadLeft(2, '0') + ":" + x.time.Minute.ToString().PadLeft(2, '0'),
                                                      shortName = x.subject.ShortName,
                                                      to = (x.time.AddTicks(x.subject.Duration)).Hour.ToString().PadLeft(2, '0') + ":" + (x.time.AddTicks(x.subject.Duration)).Minute.ToString().PadLeft(2, '0'),
                                                      //longName = x.subject.LongName,
                                                      tte = x
                                                  };
                    break;
                case "thursday":
                    thu.SubjectList.ItemsSource = null;
                    thu.SubjectList.ItemsSource = from x in a.timetable
                                                  where x.day == MyWeekDay.Thursday
                                                  orderby x.time.TimeOfDay
                                                  select new
                                                  {
                                                      time = x.time.Hour.ToString().PadLeft(2, '0') + ":" + x.time.Minute.ToString().PadLeft(2, '0'),
                                                      shortName = x.subject.ShortName,
                                                      to = (x.time.AddTicks(x.subject.Duration)).Hour.ToString().PadLeft(2, '0') + ":" + (x.time.AddTicks(x.subject.Duration)).Minute.ToString().PadLeft(2, '0'),
                                                      //longName = x.subject.LongName,
                                                      tte = x
                                                  };
                    break;
                case "friday":
                    fri.SubjectList.ItemsSource = null;
                    fri.SubjectList.ItemsSource = from x in a.timetable
                                                  where x.day == MyWeekDay.Friday
                                                  orderby x.time.TimeOfDay
                                                  select new
                                                  {
                                                      time = x.time.Hour.ToString().PadLeft(2, '0') + ":" + x.time.Minute.ToString().PadLeft(2, '0'),
                                                      shortName = x.subject.ShortName,
                                                      to = (x.time.AddTicks(x.subject.Duration)).Hour.ToString().PadLeft(2, '0') + ":" + (x.time.AddTicks(x.subject.Duration)).Minute.ToString().PadLeft(2, '0'),
                                                      //longName = x.subject.LongName,
                                                      tte = x
                                                  };
                    break;
                case "saturday":
                    sat.SubjectList.ItemsSource = null;
                    sat.SubjectList.ItemsSource = from x in a.timetable
                                                  where x.day == MyWeekDay.Saturday
                                                  orderby x.time.TimeOfDay
                                                  select new
                                                  {
                                                      time = x.time.Hour.ToString().PadLeft(2, '0') + ":" + x.time.Minute.ToString().PadLeft(2, '0'),
                                                      shortName = x.subject.ShortName,
                                                      to = (x.time.AddTicks(x.subject.Duration)).Hour.ToString().PadLeft(2, '0') + ":" + (x.time.AddTicks(x.subject.Duration)).Minute.ToString().PadLeft(2, '0'),
                                                      //longName = x.subject.LongName,
                                                      tte = x
                                                  };
                    break;
            }
        }
 private void pivot1_LoadedPivotItem_1(object sender, PivotItemEventArgs e)
 {
     
 }
Beispiel #55
0
 void piv_LoadingPivotItem(object sender, PivotItemEventArgs e)
 {
     setContext();
 }
Beispiel #56
0
 private void PivotLayout_LoadingPivotItem(object sender, PivotItemEventArgs e)
 {
     if (e.Item.Content != null)
         (e.Item.Content as FrameworkElement).DataContext = this.DataContext;
 }
 private void Pivoter_UnloadingPivotItem(object sender, PivotItemEventArgs e)
 {
 }
Beispiel #58
0
 private void DayPivot_LoadedPivotItem(object sender, PivotItemEventArgs e)
 {
     //trySelectCurrentDay();
 }
Beispiel #59
0
 private void main_pivot_UnloadedPivotItem(object sender, PivotItemEventArgs e)
 {
 }
Beispiel #60
0
        private void main_pivot_LoadedPivotItem(object sender, PivotItemEventArgs e)
        {
            if (FocusedPivotItem != null)
                App.ReportUsage(FocusedPivotItem.Name);

            FocusedPivotItem = e.Item;

            ResetUnloadTimer();

            if (e.Item == latest_articles_pano
                || e.Item == group_pano)
                return;

            if (e.Item.Content == null)
            {
                if (e.Item == channels_pano)
                    e.Item.Content = new ChannelsUserControl();
                if (e.Item == mrguokr_pano)
                    e.Item.Content = new MrGuokrUserControl();

                e.Item.DataContext = this.DataContext;
            }
        }