示例#1
0
        private void CreateLayout()
        {
            this._pvm = new PollViewModel(this._poll, this._topicId);
            this._pvm.PropertyChanged += new PropertyChangedEventHandler(this.pvm_PropertyChanged);
            TextItem textItem = new TextItem(this.Width, new Thickness(16.0, 0.0, 16.0, 0.0), this._pvm.Question, true, 20.0, "Segoe WP Semibold", VKConstants.LineHeight, null, true, null);

            this.VirtualizableChildren.Add((IVirtualizable)textItem);
            this._pollDescriptionTextItem = new TextItem(this.Width, new Thickness(16.0, textItem.FixedHeight, 16.0, 0.0), string.Format("{0}, {1}", this._pvm.PollTypeStr, this._pvm.VotedCountStr), false, 20.0, "Segoe WP", 0.0, Application.Current.Resources["PhoneVKSubtleBrush"] as SolidColorBrush, true, null);
            this.VirtualizableChildren.Add((IVirtualizable)this._pollDescriptionTextItem);
            PollUC pollUc = new PollUC();
            double width  = this.Width;

            ((FrameworkElement)pollUc).Width = width;
            double    num1    = 0.0;
            Thickness margin1 = this._pollDescriptionTextItem.Margin;
            // ISSUE: explicit reference operation
            double    num2      = margin1.Top + this._pollDescriptionTextItem.FixedHeight + 2.0;
            double    num3      = 0.0;
            double    num4      = 0.0;
            Thickness thickness = new Thickness(num1, num2, num3, num4);

            ((FrameworkElement)pollUc).Margin = thickness;
            this._pollUC = pollUc;
            this._pollUC.Initialize(this._poll, this._topicId);
            Thickness margin2 = ((FrameworkElement)this._pollUC).Margin;

            // ISSUE: explicit reference operation
            this._fixedHeight = ((Thickness)@margin2).Top + this._pollUC.CalculateTotalHeight() + 4.0;
        }
示例#2
0
 private double CreatePoll(double topMargin)
 {
     if (this._poll == null)
     {
         return(0.0);
     }
     topMargin += 8.0;
     if (this._pollItem != null)
     {
         this._pollItem.Margin = new Thickness(8.0, topMargin, 8.0, 0.0);
     }
     else
     {
         PollUC tmpUC = new PollUC();
         tmpUC.Initialize(this._poll, 0L);
         this._pollItem = new UCItem(this._verticalWidth - 16.0, new Thickness(8.0, topMargin, 8.0, 0.0), (Func <UserControlVirtualizable>)(() =>
         {
             PollUC pollUc = new PollUC();
             Poll poll     = this._poll;
             long topicId  = 0;
             pollUc.Initialize(poll, topicId);
             return((UserControlVirtualizable)pollUc);
         }), (Func <double>)(() => tmpUC.CalculateTotalHeight()), (Action <UserControlVirtualizable>)null, 0.0, false);
         this.VirtualizableChildren.Add((IVirtualizable)this._pollItem);
     }
     return(this._pollItem.FixedHeight);
 }
示例#3
0
        private void CreateLayout()
        {
            this._pvm = new PollViewModel(this._poll, this._topicId);
            this._pvm.PropertyChanged += new PropertyChangedEventHandler(this.pvm_PropertyChanged);
            TextItem textItem = new TextItem(this.Width, new Thickness(16.0, 0.0, 16.0, 0.0), this._pvm.Question, true, 20.0, "Segoe WP Semibold", VKConstants.LineHeight, (SolidColorBrush)null, true, null);

            this.VirtualizableChildren.Add((IVirtualizable)textItem);
            this._pollDescriptionTextItem = new TextItem(this.Width, new Thickness(16.0, textItem.FixedHeight, 16.0, 0.0), string.Format("{0}, {1}", (object)this._pvm.PollTypeStr, (object)this._pvm.VotedCountStr), false, 20.0, "Segoe WP", 0.0, Application.Current.Resources["PhoneVKSubtleBrush"] as SolidColorBrush, true, null);
            this.VirtualizableChildren.Add((IVirtualizable)this._pollDescriptionTextItem);
            PollUC pollUc = new PollUC();
            double width  = this.Width;

            pollUc.Width = width;
            Thickness thickness = new Thickness(0.0, this._pollDescriptionTextItem.Margin.Top + this._pollDescriptionTextItem.FixedHeight + 2.0, 0.0, 0.0);

            pollUc.Margin = thickness;
            this._pollUC  = pollUc;
            this._pollUC.Initialize(this._poll, this._topicId);
            this._fixedHeight = this._pollUC.Margin.Top + this._pollUC.CalculateTotalHeight() + 4.0;
        }