Пример #1
0
        public ProductPage()
        {
            this.InitializeComponent();
            this.ucHeader.TextBlockTitle.Text = CommonResources.Product.ToUpperInvariant();
            this.ucHeader.OnHeaderTap         = new Action(this.Header_OnTap);
            this.ucMoreActions.SetBlue();
            this.ucMoreActions.TapCallback = new Action(this.ShowContextMenu);
            this._adapter = new ViewportScrollableAreaAdapter(this.viewportControl);
            this.ucCommentGeneric.InitializeWithScrollViewer((IScrollableArea)this._adapter);
            this.ucCommentGeneric.UCNewComment              = this.ucNewMessage;
            this.ucNewMessage.PanelControl.IsOpenedChanged += new EventHandler <bool>(this.Panel_OnIsOpenedChanged);
            this.ucNewMessage.OnAddAttachTap                        = new Action(this.AddAttach);
            this.ucNewMessage.OnSendTap                             = new Action(this.Send);
            this.ucNewMessage.UCNewPost.OnImageDeleteTap            = new Action <object>(this.DeleteImage);
            this.ucNewMessage.UCNewPost.TextBlockWatermarkText.Text = CommonResources.Comment;
            Binding binding = new Binding("OutboundAttachments");

            this.ucNewMessage.UCNewPost.ItemsControlAttachments.SetBinding(ItemsControl.ItemsSourceProperty, binding);
            this.viewportControl.BindViewportBoundsTo((FrameworkElement)this.stackPanelContent);
            this.viewportControl.ViewportChanged += new EventHandler <ViewportChangedEventArgs>(this.ViewportControl_OnViewportChanged);
            this.RegisterForCleanup((IMyVirtualizingPanel)this.ucCommentGeneric.Panel);
            this._photoChooserTask.Completed += new EventHandler <PhotoResult>(ProductPage.PhotoChooserTask_OnCompleted);
            this.ucCommentGeneric.UCNewComment.TextBoxNewComment.TextChanged += new TextChangedEventHandler(this.TextBoxNewComment_OnTextChanged);
            EventAggregator.Current.Subscribe((object)this);
        }
Пример #2
0
        public ProductPage()
        {
            PhotoChooserTask photoChooserTask = new PhotoChooserTask();
            int num = 1;

            photoChooserTask.ShowCamera = (num != 0);
            this._photoChooserTask      = photoChooserTask;
            this._ds = new DialogService();
            // ISSUE: explicit constructor call
            //base.\u002Ector();
            this.InitializeComponent();
            this.ucHeader.TextBlockTitle.Text = (CommonResources.Product.ToUpperInvariant());
            this.ucHeader.OnHeaderTap         = new Action(this.Header_OnTap);
            this.ucMoreActions.SetBlue();
            this.ucMoreActions.TapCallback = new Action(this.ShowContextMenu);
            this._adapter = new ViewportScrollableAreaAdapter(this.viewportControl);
            this.ucCommentGeneric.InitializeWithScrollViewer((IScrollableArea)this._adapter);
            this.ucCommentGeneric.UCNewComment              = this.ucNewMessage;
            this.ucNewMessage.PanelControl.IsOpenedChanged += new EventHandler <bool>(this.Panel_OnIsOpenedChanged);
            this.ucNewMessage.OnAddAttachTap                        = new Action(this.AddAttach);
            this.ucNewMessage.OnSendTap                             = new Action(this.Send);
            this.ucNewMessage.UCNewPost.OnImageDeleteTap            = new Action <object>(this.DeleteImage);
            this.ucNewMessage.UCNewPost.TextBlockWatermarkText.Text = CommonResources.Comment;
            Binding binding = new Binding("OutboundAttachments");

            ((FrameworkElement)this.ucNewMessage.UCNewPost.ItemsControlAttachments).SetBinding((DependencyProperty)ItemsControl.ItemsSourceProperty, binding);
            this.viewportControl.BindViewportBoundsTo((FrameworkElement)this.stackPanelContent);
            this.viewportControl.ViewportChanged += (new EventHandler <ViewportChangedEventArgs>(this.ViewportControl_OnViewportChanged));
            this.RegisterForCleanup((IMyVirtualizingPanel)this.ucCommentGeneric.Panel);
            ((ChooserBase <PhotoResult>) this._photoChooserTask).Completed += (new EventHandler <PhotoResult>(ProductPage.PhotoChooserTask_OnCompleted));
            // ISSUE: method pointer
            this.ucCommentGeneric.UCNewComment.TextBoxNewComment.TextChanged += (new TextChangedEventHandler(this.TextBoxNewComment_OnTextChanged));
            EventAggregator.Current.Subscribe(this);
        }
Пример #3
0
        public GroupDiscussionPage()
        {
            PhotoChooserTask photoChooserTask = new PhotoChooserTask();
            int num = 1;

            photoChooserTask.ShowCamera = (num != 0);
            this._photoChooserTask      = photoChooserTask;
            ApplicationBarIconButton applicationBarIconButton1 = new ApplicationBarIconButton();
            Uri uri1 = new Uri("Resources/appbar.send.text.rest.png", UriKind.Relative);

            applicationBarIconButton1.IconUri = (uri1);
            string commentsPageAppBarSend = CommonResources.PostCommentsPage_AppBar_Send;

            applicationBarIconButton1.Text = (commentsPageAppBarSend);
            this._appBarButtonAddComment   = applicationBarIconButton1;
            ApplicationBarIconButton applicationBarIconButton2 = new ApplicationBarIconButton();
            Uri uri2 = new Uri("Resources/appbar.smile.png", UriKind.Relative);

            applicationBarIconButton2.IconUri = (uri2);
            string str = "emoji";

            applicationBarIconButton2.Text = (str);
            this._appBarButtonEmojiToggle  = applicationBarIconButton2;
            ApplicationBarIconButton applicationBarIconButton3 = new ApplicationBarIconButton();
            Uri uri3 = new Uri("Resources/attach.png", UriKind.Relative);

            applicationBarIconButton3.IconUri = (uri3);
            string barAddAttachment = CommonResources.NewPost_AppBar_AddAttachment;

            applicationBarIconButton3.Text = (barAddAttachment);
            this._appBarButtonAttachments  = applicationBarIconButton3;
            ApplicationBarIconButton applicationBarIconButton4 = new ApplicationBarIconButton();
            Uri uri4 = new Uri("Resources/appbar.refresh.rest.png", UriKind.Relative);

            applicationBarIconButton4.IconUri = (uri4);
            string appBarRefresh = CommonResources.AppBar_Refresh;

            applicationBarIconButton4.Text = (appBarRefresh);
            this._appBarButtonRefresh      = applicationBarIconButton4;
            ApplicationBar applicationBar = new ApplicationBar();
            Color          appBarBgColor  = VKConstants.AppBarBGColor;

            applicationBar.BackgroundColor = (appBarBgColor);
            Color appBarFgColor = VKConstants.AppBarFGColor;

            applicationBar.ForegroundColor = (appBarFgColor);
            this._defaultAppBar            = applicationBar;
            // ISSUE: explicit constructor call
            //    base.\u002Ector();
            this.InitializeComponent();
            this._adapter = new ViewportScrollableAreaAdapter(this.scroll);
            this.panel.InitializeWithScrollViewer((IScrollableArea)this._adapter, false);
            this.newCommentUC.PanelControl.IsOpenedChanged += new EventHandler <bool>(this.PanelIsOpenedChanged);
            this.scroll.BindViewportBoundsTo((FrameworkElement)this.scrollablePanel);
            this.RegisterForCleanup((IMyVirtualizingPanel)this.panel);
            this.BuildAppBar();
            // ISSUE: method pointer
            ((UIElement)this.newCommentUC.TextBoxNewComment).GotFocus += (new RoutedEventHandler(this.textBoxGotFocus));
            // ISSUE: method pointer
            ((UIElement)this.newCommentUC.TextBoxNewComment).LostFocus += (new RoutedEventHandler(this.textBoxLostFocus));
            // ISSUE: method pointer
            this.newCommentUC.TextBoxNewComment.TextChanged += (new TextChangedEventHandler(this.TextBoxNewComment_TextChanged));
            this.panel.ScrollPositionChanged += new EventHandler <MyVirtualizingPanel2.ScrollPositionChangedEventAgrs>(this.panel_ScrollPositionChanged);
            this.panel.ManuallyLoadMore       = true;
            // ISSUE: method pointer
            base.Loaded += (new RoutedEventHandler(this.GroupDiscussionPage_Loaded));
            ((ChooserBase <PhotoResult>) this._photoChooserTask).Completed += (new EventHandler <PhotoResult>(this._photoChooserTask_Completed));
            EventAggregator.Current.Subscribe((object)this);
            this.ucPullToRefresh.TrackListBox((ISupportPullToRefresh)this.panel);
            this.panel.OnRefresh = (Action)(() => this.GroupDiscussionVM.LoadData(true, (Action <bool>)null));
            this.newCommentUC.UCNewPost.TextBlockWatermarkText.Text = (CommonResources.Comment);
            this.newCommentUC.OnAddAttachTap             = (Action)(() => this.AddAttachTap());
            this.newCommentUC.OnSendTap                  = (Action)(() => this._appBarButtonAddComment_Click((object)null, (EventArgs)null));
            this.newCommentUC.UCNewPost.OnImageDeleteTap = (Action <object>)(sender =>
            {
                FrameworkElement frameworkElement = sender as FrameworkElement;
                if (frameworkElement != null)
                {
                    this._commentVM.OutboundAttachments.Remove(frameworkElement.DataContext as IOutboundAttachment);
                }
                this.UpdateAppBar();
            });
            Binding binding = new Binding("OutboundAttachments");

            ((FrameworkElement)this.newCommentUC.UCNewPost.ItemsControlAttachments).SetBinding((DependencyProperty)ItemsControl.ItemsSourceProperty, binding);
        }
Пример #4
0
        public PhotoCommentsPage()
        {
            PhotoChooserTask photoChooserTask = new PhotoChooserTask();
            int num = 1;

            photoChooserTask.ShowCamera = (num != 0);
            this._photoChooserTask      = photoChooserTask;
            ApplicationBar applicationBar = new ApplicationBar();
            Color          appBarBgColor  = VKConstants.AppBarBGColor;

            applicationBar.BackgroundColor = (appBarBgColor);
            Color appBarFgColor = VKConstants.AppBarFGColor;

            applicationBar.ForegroundColor = (appBarFgColor);
            this._appBar = applicationBar;
            ApplicationBarIconButton applicationBarIconButton1 = new ApplicationBarIconButton();
            Uri uri1 = new Uri("Resources/attach.png", UriKind.Relative);

            applicationBarIconButton1.IconUri = (uri1);
            string barAddAttachment = CommonResources.NewPost_AppBar_AddAttachment;

            applicationBarIconButton1.Text = (barAddAttachment);
            this._appBarButtonAttachments  = applicationBarIconButton1;
            ApplicationBarIconButton applicationBarIconButton2 = new ApplicationBarIconButton();
            Uri uri2 = new Uri("Resources/appbar.send.text.rest.png", UriKind.Relative);

            applicationBarIconButton2.IconUri = (uri2);
            string commentsPageAppBarSend = CommonResources.PostCommentsPage_AppBar_Send;

            applicationBarIconButton2.Text = (commentsPageAppBarSend);
            this._appBarButtonComment      = applicationBarIconButton2;
            ApplicationBarIconButton applicationBarIconButton3 = new ApplicationBarIconButton();
            Uri uri3 = new Uri("Resources/appbar.smile.png", UriKind.Relative);

            applicationBarIconButton3.IconUri = (uri3);
            string str1 = "emoji";

            applicationBarIconButton3.Text = (str1);
            this._appBarButtonEmojiToggle  = applicationBarIconButton3;
            ApplicationBarIconButton applicationBarIconButton4 = new ApplicationBarIconButton();
            Uri uri4 = new Uri(PhotoCommentsPage.LikeHeartImagePath, UriKind.Relative);

            applicationBarIconButton4.IconUri = (uri4);
            string commentsPageAppBarLike = CommonResources.PostCommentsPage_AppBar_Like;

            applicationBarIconButton4.Text = (commentsPageAppBarLike);
            this._appBarButtonLikeUnlike   = applicationBarIconButton4;
            ApplicationBarMenuItem applicationBarMenuItem1 = new ApplicationBarMenuItem();
            string viewerAppBarSave = PhotoResources.ImageViewer_AppBar_Save;

            applicationBarMenuItem1.Text = (viewerAppBarSave);
            this._appBarMenuItemSave     = applicationBarMenuItem1;
            ApplicationBarMenuItem applicationBarMenuItem2 = new ApplicationBarMenuItem();
            string str2 = CommonResources.Report.ToLowerInvariant() + "...";

            applicationBarMenuItem2.Text = (str2);
            this._appBarMenuItemReport   = applicationBarMenuItem2;
            ApplicationBarMenuItem applicationBarMenuItem3 = new ApplicationBarMenuItem();
            string commentsPageAppBarShare = CommonResources.PostCommentsPage_AppBar_Share;

            applicationBarMenuItem3.Text = (commentsPageAppBarShare);
            this._appBarMenuItemShare    = applicationBarMenuItem3;
            this._ds             = new DialogService();
            this._selectedTagInd = -1;
            // ISSUE: explicit constructor call
            //base.\u002Ector();
            this.InitializeComponent();
            this.Header.TextBlockTitle.Text = (PhotoResources.PhotoCommentsPage_PHOTO);
            this.Header.OnHeaderTap         = new Action(this.HandleOnHeaderTap);
            this.scroll.BindViewportBoundsTo((FrameworkElement)this.stackPanel);
            this.CreateAppBar();
            this._adapter = new ViewportScrollableAreaAdapter(this.scroll);
            this.ucCommentGeneric.InitializeWithScrollViewer((IScrollableArea)this._adapter);
            this.ucCommentGeneric.UCNewComment              = this.ucNewMessage;
            this.ucNewMessage.PanelControl.IsOpenedChanged += new EventHandler <bool>(this.PanelIsOpenedChanged);
            this.ucMoreActions.SetBlue();
            this.ucMoreActions.TapCallback               = new Action(this.ShowContextMenu);
            this.ucNewMessage.OnAddAttachTap             = (Action)(() => this.AddAttachTap());
            this.ucNewMessage.OnSendTap                  = (Action)(() => this._appBarButtonSend_Click(null, null));
            this.ucNewMessage.UCNewPost.OnImageDeleteTap = (Action <object>)(sender =>
            {
                FrameworkElement frameworkElement = sender as FrameworkElement;
                if (frameworkElement != null)
                {
                    this._commentVM.OutboundAttachments.Remove(frameworkElement.DataContext as IOutboundAttachment);
                }
                this.UpdateAppBar();
            });
            this.ucNewMessage.UCNewPost.TextBlockWatermarkText.Text = (CommonResources.Comment);
            Binding binding = new Binding("OutboundAttachments");

            ((FrameworkElement)this.ucNewMessage.UCNewPost.ItemsControlAttachments).SetBinding((DependencyProperty)ItemsControl.ItemsSourceProperty, binding);
            this.RegisterForCleanup((IMyVirtualizingPanel)this.ucCommentGeneric.Panel);
            ((ChooserBase <PhotoResult>) this._photoChooserTask).Completed += (new EventHandler <PhotoResult>(this._photoChooserTask_Completed));
            // ISSUE: method pointer
            this.ucCommentGeneric.UCNewComment.TextBoxNewComment.TextChanged += (new TextChangedEventHandler(this.TextBoxNewComment_TextChanged));
            // ISSUE: method pointer
            ((UIElement)this.ucCommentGeneric.UCNewComment.TextBoxNewComment).GotFocus += (new RoutedEventHandler(this.textBoxGotFocus));
            // ISSUE: method pointer
            ((UIElement)this.ucCommentGeneric.UCNewComment.TextBoxNewComment).LostFocus += (new RoutedEventHandler(this.textBoxLostFocus));
            EventAggregator.Current.Subscribe(this);
        }
Пример #5
0
        public PostCommentsPage()
        {
            PhotoChooserTask photoChooserTask = new PhotoChooserTask();
            int num = 1;

            photoChooserTask.ShowCamera = (num != 0);
            this._photoChooserTask      = photoChooserTask;
            ApplicationBarMenuItem applicationBarMenuItem1 = new ApplicationBarMenuItem();
            string goToOriginal = CommonResources.GoToOriginal;

            applicationBarMenuItem1.Text     = goToOriginal;
            this._appBarMenuItemGoToOriginal = applicationBarMenuItem1;
            ApplicationBarMenuItem applicationBarMenuItem2 = new ApplicationBarMenuItem();
            string pinPost = CommonResources.PinPost;

            applicationBarMenuItem2.Text = pinPost;
            this._appBarMenuItemPin      = applicationBarMenuItem2;
            ApplicationBarMenuItem applicationBarMenuItem3 = new ApplicationBarMenuItem();
            string unpinPost = CommonResources.UnpinPost;

            applicationBarMenuItem3.Text = unpinPost;
            this._appBarMenuItemUnpin    = applicationBarMenuItem3;
            ApplicationBarIconButton applicationBarIconButton1 = new ApplicationBarIconButton();
            Uri uri1 = new Uri("Resources/appbar.send.text.rest.png", UriKind.Relative);

            applicationBarIconButton1.IconUri = uri1;
            string commentsPageAppBarSend = CommonResources.PostCommentsPage_AppBar_Send;

            applicationBarIconButton1.Text = commentsPageAppBarSend;
            this._appBarButtonSend         = applicationBarIconButton1;
            ApplicationBarIconButton applicationBarIconButton2 = new ApplicationBarIconButton();
            Uri uri2 = new Uri("Resources/appbar.heart2.rest.png", UriKind.Relative);

            applicationBarIconButton2.IconUri = uri2;
            string commentsPageAppBarLike = CommonResources.PostCommentsPage_AppBar_Like;

            applicationBarIconButton2.Text = commentsPageAppBarLike;
            this._appBarButtonLike         = applicationBarIconButton2;
            ApplicationBarIconButton applicationBarIconButton3 = new ApplicationBarIconButton();
            Uri uri3 = new Uri("Resources/appbar.heart2.broken.rest.png", UriKind.Relative);

            applicationBarIconButton3.IconUri = uri3;
            string pageAppBarUnlike = CommonResources.PostCommentsPage_AppBar_Unlike;

            applicationBarIconButton3.Text = pageAppBarUnlike;
            this._appBarButtonUnlike       = applicationBarIconButton3;
            ApplicationBarIconButton applicationBarIconButton4 = new ApplicationBarIconButton();
            Uri uri4 = new Uri("Resources/appbar.smile.png", UriKind.Relative);

            applicationBarIconButton4.IconUri = uri4;
            string str = "emoji";

            applicationBarIconButton4.Text = str;
            this._appBarButtonEmojiToggle  = applicationBarIconButton4;
            ApplicationBarMenuItem applicationBarMenuItem4 = new ApplicationBarMenuItem();
            string commentsPageAppBarShare = CommonResources.PostCommentsPage_AppBar_Share;

            applicationBarMenuItem4.Text = commentsPageAppBarShare;
            this._appBarMenuItemShare    = applicationBarMenuItem4;
            ApplicationBarIconButton applicationBarIconButton5 = new ApplicationBarIconButton();
            Uri uri5 = new Uri("Resources/attach.png", UriKind.Relative);

            applicationBarIconButton5.IconUri = uri5;
            string barAddAttachment = CommonResources.NewPost_AppBar_AddAttachment;

            applicationBarIconButton5.Text = barAddAttachment;
            this._appBarButtonAttachments  = applicationBarIconButton5;
            ApplicationBarMenuItem applicationBarMenuItem5 = new ApplicationBarMenuItem();
            string pageAppBarRefresh = CommonResources.PostCommentsPage_AppBar_Refresh;

            applicationBarMenuItem5.Text = pageAppBarRefresh;
            this._appBarMenuItemRefresh  = applicationBarMenuItem5;
            ApplicationBarMenuItem applicationBarMenuItem6 = new ApplicationBarMenuItem();
            string edit = CommonResources.Edit;

            applicationBarMenuItem6.Text = edit;
            this._appBarMenuItemEdit     = applicationBarMenuItem6;
            ApplicationBarMenuItem applicationBarMenuItem7 = new ApplicationBarMenuItem();
            string delete = CommonResources.Delete;

            applicationBarMenuItem7.Text = delete;
            this._appBarMenuItemDelete   = applicationBarMenuItem7;
            ApplicationBarMenuItem applicationBarMenuItem8 = new ApplicationBarMenuItem();
            string report = CommonResources.Report;

            applicationBarMenuItem8.Text = report;
            this._appBarMenuItemReport   = applicationBarMenuItem8;
            this._dc  = new DialogService();
            this._de  = new DelayedExecutor(200);
            this._de2 = new DelayedExecutor(550);
            // ISSUE: explicit constructor call
            //base.\u002Ector();
            this.InitializeComponent();
            this.Header.OnHeaderTap = (Action)(() => this.panel.ScrollToBottom(false));
            this._adapter           = new ViewportScrollableAreaAdapter(this.scroll);
            this.panel.InitializeWithScrollViewer((IScrollableArea)this._adapter, false);
            TextBoxPanelControl panelControl = this.ucNewMessage.PanelControl;
            EventHandler <bool> eventHandler = (EventHandler <bool>)Delegate.Combine((Delegate)panelControl.IsOpenedChanged, (Delegate) new EventHandler <bool>(this.PanelIsOpenedChanged));

            panelControl.IsOpenedChanged = eventHandler;
            this.RegisterForCleanup((IMyVirtualizingPanel)this.panel);
            this.panel.LoadedHeightDownwards = this.panel.LoadedHeightDownwardsNotScrolling = 1600.0;
            this.BuildAppBar();
            ((UIElement)this.ucNewMessage.ReplyUserUC).Tap += (new EventHandler <System.Windows.Input.GestureEventArgs>(this.Button_Click_1));
            this.ucMoreActions.SetBlue();
            this.ucMoreActions.TapCallback = (Action)(() =>
            {
                WallPostItem wallPostItem = this.PostCommentsVM.WallPostItem;
                if (wallPostItem == null)
                {
                    return;
                }
                ContextMenu menu = ContextMenuHelper.CreateMenu(wallPostItem.GenerateMenuItems());
                ContextMenuService.SetContextMenu((DependencyObject)this.ucMoreActions, menu);
                menu.IsOpen = true;
            });
            this.ucNewMessage.OnAddAttachTap             = new Action(this.AddAttachTap);
            this.ucNewMessage.OnSendTap                  = (Action)(() => this._appBarButtonSend_Click(null, null));
            this.ucNewMessage.UCNewPost.OnImageDeleteTap = (Action <object>)(sender =>
            {
                FrameworkElement frameworkElement = sender as FrameworkElement;
                if (frameworkElement != null)
                {
                    this._commentVM.OutboundAttachments.Remove(frameworkElement.DataContext as IOutboundAttachment);
                }
                this.UpdateAppBar();
            });
            this.ucNewMessage.UCNewPost.TextBlockWatermarkText.Text = CommonResources.Comment;
            // ISSUE: method pointer
            this.ucNewMessage.TextBoxNewComment.TextChanged += (new TextChangedEventHandler(this.TextBoxNewComment_TextChanged));
            Binding binding = new Binding("OutboundAttachments");

            ((FrameworkElement)this.ucNewMessage.ucNewPost.ItemsControlAttachments).SetBinding((DependencyProperty)ItemsControl.ItemsSourceProperty, binding);
            this.scroll.BindViewportBoundsTo((FrameworkElement)this.scrollableGrid);
            ((ChooserBase <PhotoResult>) this._photoChooserTask).Completed += (new EventHandler <PhotoResult>(this._photoChooserTask_Completed));
            EventAggregator.Current.Subscribe(this);
        }