Пример #1
0
 private void ShowAttachmentSubPickerFor(List <NamedAttachmentType> attachmentTypes)
 {
     if (this._subPickerUC != null)
     {
         this._subPickerUC.ItemSelected -= new AttachmentSubItemSelectedEventHandler(this.HandleAttachmentSelection);
     }
     this._subPickerUC = new AttachmentSubpickerUC();
     this._subPickerUC.ItemSelected            += new AttachmentSubItemSelectedEventHandler(this.HandleAttachmentSelection);
     this._subPickerUC.itemsControl.ItemsSource = ((IEnumerable)AttachmentPickerUC.Convert((IEnumerable <NamedAttachmentType>)attachmentTypes, true));
     this._ds.ChangeChild((FrameworkElement)this._subPickerUC, null);
 }
Пример #2
0
        public static AttachmentPickerUC Show(List <NamedAttachmentType> attachmentTypes, int maxCount, Action quickPhotoPickCallback, bool excludeLocation, long ownerId = 0, int adminLevel = 0, ConversationInfo conversationInfo = null)
        {
            AttachmentPickerUC attachmentPickerUc = new AttachmentPickerUC()
            {
                OwnerId           = ownerId,
                _adminLevel       = adminLevel,
                _conversationInfo = conversationInfo
            };

            if (maxCount > 0)
            {
                attachmentPickerUc.DoShow((IEnumerable <NamedAttachmentType>)attachmentTypes, maxCount, quickPhotoPickCallback, excludeLocation);
            }
            return(attachmentPickerUc);
        }
Пример #3
0
        private void DoShow(IEnumerable <NamedAttachmentType> attachmentTypes, int maxCount, Action quickPhotoPickCallback, bool excludeLocation)
        {
            IEnumerable <NamedAttachmentType> namedAttachmentTypes = attachmentTypes;
            Func <NamedAttachmentType, bool>  func1 = (Func <NamedAttachmentType, bool>)(t => t.AttachmentType == AttachmentType.Timer);

            if (Enumerable.All <NamedAttachmentType>(namedAttachmentTypes, (Func <NamedAttachmentType, bool>)func1))
            {
                --maxCount;
            }
            this._viewModel              = new AttachmentPickerViewModel(AttachmentPickerUC.Convert(attachmentTypes, excludeLocation), maxCount);
            base.DataContext             = this._viewModel;
            this._quickPhotoPickCallback = quickPhotoPickCallback;
            this._ds = new DialogService()
            {
                AnimationType      = DialogService.AnimationTypes.None,
                AnimationTypeChild = DialogService.AnimationTypes.Swivel,
                Child            = (FrameworkElement)this,
                HideOnNavigation = true
            };
            // ISSUE: method pointer
            base.SizeChanged += (delegate(object sender, SizeChangedEventArgs args)
            {
                Execute.ExecuteOnUIThread(new Action(this.UpdateListBoxPhotosSize));
            });
            PageBase currentPage = FramePageUtils.CurrentPage;

            if (currentPage != null)
            {
                currentPage.OrientationChanged += (new EventHandler <OrientationChangedEventArgs>(this.Page_OnOrientationChanged));
                this.UpdateScrollViewer(currentPage.Orientation);
            }
            this._viewModel.PhotosVM.LoadData(true, (Action)(() => Execute.ExecuteOnUIThread(new Action(this.UpdateListBoxPhotosSize))));
            this._ds.Closed += (EventHandler)((s, e) =>
            {
                this._viewModel.PhotosVM.CleanupSession();
                this.IsShown = false;
            });
            this._ds.Show(null);
            this.IsShown = true;
        }