private void OpenSectionsPicker() { this._sections = this.ViewModel.Sections; this._picker = new ListPickerUC2() { ItemsSource = (IList)this._sections, PickerMaxWidth = 408.0, PickerMaxHeight = 768.0, BackgroundColor = (Brush)Application.Current.Resources["PhoneCardOverlayBrush"], PickerMargin = new Thickness(0.0, 0.0, 0.0, 64.0), ItemTemplate = (DataTemplate)base.Resources["FilterItemTemplate"] }; this._picker.ItemTapped += (EventHandler <object>)((sender, item) => { DocumentsSectionViewModel section = item as DocumentsSectionViewModel; if (section == null) { return; } this.SelectSection(section); this.ViewModel.CurrentSection = section; }); Point point = ((UIElement)this.rectSeparator).TransformToVisual((UIElement)this.gridRoot).Transform(new Point(0.0, 0.0)); int num1 = this._sections.IndexOf((DocumentsSectionViewModel)Enumerable.FirstOrDefault <DocumentsSectionViewModel>(this._sections, (Func <DocumentsSectionViewModel, bool>)(section => section.IsSelected))); double num2 = 0.0; if (num1 > -1) { num2 = (double)(num1 * 64); } // ISSUE: explicit reference operation this._picker.Show(new Point(8.0, Math.Max(32.0, ((Point)@point).Y - num2)), (FrameworkElement)FramePageUtils.CurrentPage); }
private void SelectSection(DocumentsSectionViewModel section) { if (this._sections == null || section == null) { return; } using (IEnumerator <DocumentsSectionViewModel> enumerator = this._sections.GetEnumerator()) { while (enumerator.MoveNext()) { DocumentsSectionViewModel current = enumerator.Current; int num = current.SectionId == section.SectionId ? 1 : 0; current.IsSelected = num != 0; } } }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); if (!this._isInitialized) { this._maxAllowedToSelect = int.Parse(((Page)this).NavigationContext.QueryString["MaxAllowedToSelect"]); long loggedInUserId = AppGlobalStateManager.Current.LoggedInUserId; DocumentsViewModel parentPageViewModel = new DocumentsViewModel(loggedInUserId); DocumentsSectionViewModel sectionViewModel = new DocumentsSectionViewModel(parentPageViewModel, loggedInUserId, 0, CommonResources.AllDocuments, false, true) { IsSelected = true }; parentPageViewModel.Sections.Add(sectionViewModel); parentPageViewModel.LoadSection(0); base.DataContext = parentPageViewModel; this._isInitialized = true; } if (e.NavigationMode != NavigationMode.Back || !ParametersRepository.Contains("FilePicked") && !ParametersRepository.Contains("PickedPhotoDocuments")) { return; } this.SkipNextNavigationParametersRepositoryClearing = true; Navigator.Current.GoBack(); }