public HideHeaderHelper(NewsfeedHeaderUC ucHeader, ViewportControl viewportControl, PhoneApplicationPage page)
        {
            this._ucHeader        = ucHeader;
            this._viewportControl = viewportControl;
            this._page            = page;
            TranslateTransform translateTransform1 = this._ucHeader.RenderTransform as TranslateTransform;

            if (translateTransform1 == null)
            {
                TranslateTransform translateTransform2 = new TranslateTransform();
                this._ucHeader.RenderTransform = (Transform)translateTransform2;
                this._translateHeader          = translateTransform2;
            }
            else
            {
                this._translateHeader = translateTransform1;
            }
            this._minOffsetHeader    = -this._ucHeader.Height + 32.0;
            this._maxOffsetHeader    = 0.0;
            this._minOffsetFreshNews = 0.0;
            this._ucHeader.borderFreshNews.Visibility = Visibility.Visible;
            this._translateFreshNews                        = this._ucHeader.translateFreshNews;
            this._translateFreshNews.Y                      = this._minOffsetFreshNews;
            this._viewportControl.ViewportChanged          += new EventHandler <ViewportChangedEventArgs>(this.ViewportControl_OnViewportControlChanged);
            this._viewportControl.ManipulationStateChanged += new EventHandler <ManipulationStateChangedEventArgs>(this.ViewportControl_OnManipulationStateChanged);
        }
        public HideHeaderHelper(NewsfeedHeaderUC ucHeader, ViewportControl viewportControl, PhoneApplicationPage page)
        {
            this._ucHeader        = ucHeader;
            this._viewportControl = viewportControl;
            this._page            = page;
            TranslateTransform renderTransform = this._ucHeader.RenderTransform as TranslateTransform;

            if (renderTransform == null)
            {
                TranslateTransform translateTransform = new TranslateTransform();
                this._ucHeader.RenderTransform = translateTransform;
                this._translateHeader          = translateTransform;
            }
            else
            {
                this._translateHeader = renderTransform;
            }
            //this._minOffsetHeader = (-this._ucHeader.Height) + 32.0;
            //
            this._minOffsetHeader = (-this._ucHeader.Height);
            if (!VKClient.Common.Library.AppGlobalStateManager.Current.GlobalState.HideSystemTray)
            {
                this._minOffsetHeader += 32;
            }
            //
            this._maxOffsetHeader    = 0.0;
            this._minOffsetFreshNews = 0.0;
            this._ucHeader.borderFreshNews.Visibility = Visibility.Visible;
            this._translateFreshNews                        = this._ucHeader.translateFreshNews;
            this._translateFreshNews.Y                      = this._minOffsetFreshNews;
            this._viewportControl.ViewportChanged          += (new EventHandler <ViewportChangedEventArgs>(this.ViewportControl_OnViewportControlChanged));
            this._viewportControl.ManipulationStateChanged += (new EventHandler <ManipulationStateChangedEventArgs>(this.ViewportControl_OnManipulationStateChanged));
        }
 public void InitializeComponent()
 {
     if (this._contentLoaded)
     {
         return;
     }
     this._contentLoaded = true;
     Application.LoadComponent(this, new Uri("/VKClient.Common;component/NewsPage.xaml", UriKind.Relative));
     this.LayoutRoot   = (Grid)base.FindName("LayoutRoot");
     this.ContentPanel = (Grid)base.FindName("ContentPanel");
     this.scrollNews   = (ViewportControl)base.FindName("scrollNews");
     this.stackPanel   = (MyVirtualizingStackPanel)base.FindName("stackPanel");
     //this.ucNewPost = (NewsfeedNewPostUC)base.FindName("ucNewPost");
     this.panelNews = (MyVirtualizingPanel2)base.FindName("panelNews");
     this.Header    = (NewsfeedHeaderUC)base.FindName("Header");
     this.rectSystemTrayPlaceholder = (Rectangle)base.FindName("rectSystemTrayPlaceholder");
     this.ucPullToRefresh           = (PullToRefreshUC)base.FindName("ucPullToRefresh");
 }