コード例 #1
0
 public void InitializeComponent()
 {
     if (this._contentLoaded)
     {
         return;
     }
     this._contentLoaded = true;
     Application.LoadComponent(this, new Uri("/VKClient.Common;component/UC/ImageViewerDecoratorUC.xaml", UriKind.Relative));
     this.imageViewer             = (VKClient.Common.ImageViewer.ImageViewer)base.FindName("imageViewer");
     this.gridTop                 = (Canvas)base.FindName("gridTop");
     this.rectBlackTop            = (Image)base.FindName("rectBlackTop");
     this.textBlockCounter        = (TextBlock)base.FindName("textBlockCounter");
     this.borderActions           = (Border)base.FindName("borderActions");
     this.borderOrientationLock   = (Border)base.FindName("borderOrientationLock");
     this.contextMenu             = (ContextMenu)base.FindName("contextMenu");
     this.menuItemSaveInAlbum     = (MenuItem)base.FindName("menuItemSaveInAlbum");
     this.borderMore              = (Border)base.FindName("borderMore");
     this.gridBottom              = (Canvas)base.FindName("gridBottom");
     this.rectBlackBottom         = (Image)base.FindName("rectBlackBottom");
     this.textBoxText             = (ScrollableTextBlock)base.FindName("textBoxText");
     this.stackPanelLikesComments = (StackPanel)base.FindName("stackPanelLikesComments");
     this.borderLikes             = (Border)base.FindName("borderLikes");
     this.borderComments          = (Border)base.FindName("borderComments");
     this.gridGifs                = (Grid)base.FindName("gridGifs");
     this.borderShare             = (Border)base.FindName("borderShare");
     this.borderMarks             = (Border)base.FindName("borderMarks");
 }
コード例 #2
0
 public void InitializeComponent()
 {
     if (this._contentLoaded)
     {
         return;
     }
     this._contentLoaded = true;
     Application.LoadComponent(this, new Uri("/VKClient.Common;component/UC/OccupationInfoUC.xaml", UriKind.Relative));
     this.textBlockDescription = (ScrollableTextBlock)base.FindName("textBlockDescription");
     this.imageGroup           = (Image)base.FindName("imageGroup");
 }
コード例 #3
0
 public void InitializeComponent()
 {
     if (this._contentLoaded)
     {
         return;
     }
     this._contentLoaded = true;
     Application.LoadComponent(this, new Uri("/VKClient.Audio;component/UserControls/LyricsUC.xaml", UriKind.Relative));
     this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
     this.textBlockNowPlayingTitle = (TextBlock)base.FindName("textBlockNowPlayingTitle");
     this.textBlockLyrics          = (ScrollableTextBlock)base.FindName("textBlockLyrics");
 }
コード例 #4
0
ファイル: GenericInfoUC.cs プロジェクト: Makzz90/VKClient_re
 public void InitializeComponent()
 {
     if (this._contentLoaded)
     {
         return;
     }
     this._contentLoaded = true;
     Application.LoadComponent(this, new Uri("/VKClient.Common;component/UC/GenericInfoUC.xaml", UriKind.Relative));
     this.LayoutRoot    = (Grid)base.FindName("LayoutRoot");
     this.textBlockInfo = (ScrollableTextBlock)base.FindName("textBlockInfo");
     this.richTextBox   = (RichTextBox)base.FindName("richTextBox");
 }
コード例 #5
0
 public void InitializeComponent()
 {
     if (this._contentLoaded)
     {
         return;
     }
     this._contentLoaded = true;
     Application.LoadComponent(this, new Uri("/VKClient.Common;component/Profiles/Shared/Views/InfoListItemUC.xaml", UriKind.Relative));
     this.gridRoot             = (Grid)base.FindName("gridRoot");
     this.borderIcon           = (Border)base.FindName("borderIcon");
     this.textBlockContent     = (TextBlock)base.FindName("textBlockContent");
     this.textBlockContentFull = (ScrollableTextBlock)base.FindName("textBlockContentFull");
     this.gridPreview1         = (Grid)base.FindName("gridPreview1");
     this.imagePreview1        = (Image)base.FindName("imagePreview1");
     this.gridPreview2         = (Grid)base.FindName("gridPreview2");
     this.imagePreview2        = (Image)base.FindName("imagePreview2");
     this.gridPreview3         = (Grid)base.FindName("gridPreview3");
     this.imagePreview3        = (Image)base.FindName("imagePreview3");
 }
コード例 #6
0
        private void MeasureText()
        {
            string text = this._text;

            if (this._preview)
            {
                ScrollableTextBlock scrollableTextBlock = this._textBlockFull;
                if ((scrollableTextBlock != null ? scrollableTextBlock.Parent : (DependencyObject)null) != null)
                {
                    return;
                }
                int length = text.Length;
                if (length > 300)
                {
                    text = BrowserNavigationService.CutTextGently(text, 300);
                    if (!this._supportExpandText)
                    {
                        text = text.Trim() + "...";
                    }
                    this._showReadFull = text.Length != length;
                }
                this._textBlockPreview.TextId       = this._textId;
                this._textBlockPreview.Text         = "";
                this._textBlockPreview.FontSize     = this._fontSize == 0.0 ? 20.0 : this._fontSize;
                this._textBlockPreview.FontFamily   = this._fontFamily ?? new FontFamily("Segoe WP");
                this._textBlockPreview.Foreground   = this._foreground ?? Application.Current.Resources["PhoneAlmostBlackBrush"] as Brush;
                this._textBlockPreview.TextWrapping = TextWrapping.Wrap;
                this._textBlockPreview.Width        = this.Width;
                if (this._lineHeight > 0.0)
                {
                    this._textBlockPreview.LineHeight = this._lineHeight;
                }
                this._textBlockPreview.Text = text;
                Grid   grid   = (Grid)((UserControl)((ContentControl)Application.Current.RootVisual).Content).Content;
                Canvas canvas = new Canvas();
                grid.Children.Add((UIElement)canvas);
                canvas.Children.Add((UIElement)this._textBlockPreview);
                canvas.UpdateLayout();
                if (this._horizontalWidth > 0.1)
                {
                    this._horizontalHeight = this._textBlockPreview.ActualHeight;
                }
                this._textBlockPreview.Width = this._verticalWidth;
                canvas.UpdateLayout();
                this._verticalHeight = this._textBlockPreview.ActualHeight;
                canvas.Children.Remove((UIElement)this._textBlockPreview);
                grid.Children.Remove((UIElement)canvas);
                if (!this._showReadFull || !this._supportExpandText)
                {
                    return;
                }
                this._verticalHeight = this._verticalHeight + 31.6;
            }
            else
            {
                ScrollableTextBlock scrollableTextBlock1 = this._textBlockFull;
                if ((scrollableTextBlock1 != null ? scrollableTextBlock1.Parent : (DependencyObject)null) != null)
                {
                    return;
                }
                ScrollableTextBlock scrollableTextBlock2 = new ScrollableTextBlock();
                scrollableTextBlock2.TextId = this._textId;
                int num1 = 0;
                scrollableTextBlock2.VerticalAlignment = (VerticalAlignment)num1;
                int num2 = (int)this._horizontalContentAlignment;
                scrollableTextBlock2.HorizontalContentAlignment = (HorizontalAlignment)num2;
                int num3 = (int)this._textAlignment;
                scrollableTextBlock2.TextAlignment = (TextAlignment)num3;
                string str = text;
                scrollableTextBlock2.Text = str;
                double num4 = this._fontSize == 0.0 ? 20.0 : this._fontSize;
                scrollableTextBlock2.FontSize = num4;
                FontFamily fontFamily = this._fontFamily ?? new FontFamily("Segoe WP");
                scrollableTextBlock2.FontFamily = fontFamily;
                Brush brush = this._foreground ?? Application.Current.Resources["PhoneAlmostBlackBrush"] as Brush;
                scrollableTextBlock2.Foreground = brush;
                this._textBlockFull             = scrollableTextBlock2;
                if (this._lineHeight > 0.0)
                {
                    this._textBlockFull.LineHeight = this._lineHeight;
                }
                if (this._horizontalWidth > 0.1)
                {
                    this._textBlockFull.Width = this._horizontalWidth;
                }
                Grid   grid   = (Grid)((UserControl)((ContentControl)Application.Current.RootVisual).Content).Content;
                Canvas canvas = new Canvas();
                grid.Children.Add((UIElement)canvas);
                canvas.Children.Add((UIElement)this._textBlockFull);
                canvas.UpdateLayout();
                if (this._horizontalWidth > 0.1)
                {
                    this._horizontalHeight = this._textBlockFull.ActualHeight;
                }
                this._textBlockFull.Width = this._verticalWidth;
                canvas.UpdateLayout();
                this._verticalHeight = this._textBlockFull.ActualHeight;
                canvas.Children.Remove((UIElement)this._textBlockFull);
                grid.Children.Remove((UIElement)canvas);
            }
        }
コード例 #7
0
        private void MeasureText()
        {
            string text = this._text;

            if (this._preview)
            {
                ScrollableTextBlock textBlockFull = this._textBlockFull;
                if ((textBlockFull != null ? textBlockFull.Parent :  null) != null)
                {
                    return;
                }
                this._textBlockPreview.TextId                   = this._textId;
                this._textBlockPreview.FontSize                 = (this._fontSize == 0.0 ? 20.0 : this._fontSize);
                this._textBlockPreview.FontFamily               = (this._fontFamily ?? new FontFamily("Segoe WP"));
                this._textBlockPreview.Foreground               = (this._foreground ?? Application.Current.Resources["PhoneAlmostBlackBrush"] as Brush);
                this._textBlockPreview.TextWrapping             = TextWrapping.Wrap;
                this._textBlockPreview.Width                    = this._verticalWidth;
                this._textBlockPreview.Text                     = this._text;
                this._textBlockPreview.DisableHyperlinks        = this._disableHyperlinks;
                this._textBlockPreview.HideHyperlinksForeground = this._hideHyperlinksForeground;
                if (this._lineHeight > 0.0)
                {
                    this._textBlockPreview.LineHeight = this._lineHeight;
                }
                Grid   content = (Grid)((UserControl)((ContentControl)Application.Current.RootVisual).Content).Content;
                Canvas canvas  = new Canvas();
                content.Children.Add(canvas);
                canvas.Children.Add(this._textBlockPreview);
                canvas.UpdateLayout();
                int int32 = Convert.ToInt32((this._textBlockPreview).ActualHeight / 28.0);
                if (int32 > 15)
                {
                    string str = BrowserNavigationService.CutTextGently(text, 399);
                    if (str != text)
                    {
                        this._textBlockPreview.Text = str.Trim() + "...";
                        this._showReadFull          = true;
                        canvas.UpdateLayout();
                    }
                    if (int32 > 150)
                    {
                        this._expandOnNewPageOnly = true;
                    }
                }
                if (this._horizontalWidth > 0.1)
                {
                    this._horizontalHeight = this._textBlockPreview.ActualHeight;
                }
                ((UIElement)canvas).UpdateLayout();
                this._verticalHeight = ((FrameworkElement)this._textBlockPreview).ActualHeight;
                canvas.Children.Remove((UIElement)this._textBlockPreview);
                content.Children.Remove((UIElement)canvas);
                if (!this._showReadFull || !this._supportExpandText)
                {
                    return;
                }
                this._verticalHeight = this._verticalHeight + 31.6;
            }
            else
            {
                ScrollableTextBlock textBlockFull = this._textBlockFull;
                if ((textBlockFull != null ? ((FrameworkElement)textBlockFull).Parent :  null) != null)
                {
                    return;
                }
                ScrollableTextBlock scrollableTextBlock = new ScrollableTextBlock();
                scrollableTextBlock.TextId = this._textId;
                int num1 = 0;
                ((FrameworkElement)scrollableTextBlock).VerticalAlignment = ((VerticalAlignment)num1);
                HorizontalAlignment contentAlignment = this._horizontalContentAlignment;
                scrollableTextBlock.HorizontalContentAlignment = contentAlignment;
                TextAlignment textAlignment = this._textAlignment;
                scrollableTextBlock.TextAlignment = textAlignment;
                string str = text;
                scrollableTextBlock.Text = str;
                double num2 = this._fontSize == 0.0 ? 20.0 : this._fontSize;
                scrollableTextBlock.FontSize = num2;
                FontFamily fontFamily = this._fontFamily ?? new FontFamily("Segoe WP");
                scrollableTextBlock.FontFamily = fontFamily;
                Brush brush = this._foreground ?? Application.Current.Resources["PhoneAlmostBlackBrush"] as Brush;
                scrollableTextBlock.Foreground               = brush;
                this._textBlockFull                          = scrollableTextBlock;
                this._textBlockFull.DisableHyperlinks        = this._disableHyperlinks;
                this._textBlockFull.HideHyperlinksForeground = this._hideHyperlinksForeground;
                if (this._lineHeight > 0.0)
                {
                    this._textBlockFull.LineHeight = this._lineHeight;
                }
                if (this._horizontalWidth > 0.1)
                {
                    ((FrameworkElement)this._textBlockFull).Width = this._horizontalWidth;
                }
                Grid   content = (Grid)((UserControl)((ContentControl)Application.Current.RootVisual).Content).Content;
                Canvas canvas  = new Canvas();
                content.Children.Add((UIElement)canvas);
                canvas.Children.Add((UIElement)this._textBlockFull);
                ((UIElement)canvas).UpdateLayout();
                if (this._horizontalWidth > 0.1)
                {
                    this._horizontalHeight = ((FrameworkElement)this._textBlockFull).ActualHeight;
                }
                ((FrameworkElement)this._textBlockFull).Width = this._verticalWidth;
                ((UIElement)canvas).UpdateLayout();
                this._verticalHeight = ((FrameworkElement)this._textBlockFull).ActualHeight;
                ((PresentationFrameworkCollection <UIElement>)((Panel)canvas).Children).Remove((UIElement)this._textBlockFull);
                ((PresentationFrameworkCollection <UIElement>)((Panel)content).Children).Remove((UIElement)canvas);
            }
        }