Esempio n. 1
0
        private void GenerateTextForTags()
        {
            ((PresentationFrameworkCollection <Block>) this.textTags.Blocks).Clear();
            this._tagHyperlinks.Clear();
            this._photoTags.Clear();
            this._photoTags.AddRange((IEnumerable <PhotoVideoTag>) this.PhotoVM.PhotoTags);
            ((UIElement)this.textTags).Visibility = (this._photoTags.Count > 0 ? Visibility.Visible : Visibility.Collapsed);
            if (this._photoTags.Count <= 0)
            {
                return;
            }
            Paragraph paragraph = new Paragraph();
            Run       run1      = new Run();
            string    str1      = PhotoResources.PhotoUC_OnThisPhoto + " ";

            run1.Text = (str1);
            SolidColorBrush solidColorBrush = Application.Current.Resources["PhoneVKSubtleBrush"] as SolidColorBrush;

            ((TextElement)run1).Foreground = ((Brush)solidColorBrush);
            Run run2 = run1;

            ((PresentationFrameworkCollection <Inline>)paragraph.Inlines).Add((Inline)run2);
            for (int index = 0; index < this._photoTags.Count; ++index)
            {
                Hyperlink hyperlink = HyperlinkHelper.GenerateHyperlink(this._photoTags[index].tagged_name ?? "", index.ToString(), (Action <Hyperlink, string>)((h, t) =>
                {
                    int state = (int)HyperlinkHelper.GetState(h);
                    int ind   = int.Parse(t);
                    PhotoVideoTag photoTag = this._photoTags[int.Parse(t)];
                    this.SelectTaggedUser(ind);
                }), (Brush)null, HyperlinkState.Normal);
                HyperlinkHelper.SetState(hyperlink, HyperlinkState.Accent, (Brush)null);
                this._tagHyperlinks.Add(hyperlink);
                ((PresentationFrameworkCollection <Inline>)paragraph.Inlines).Add((Inline)hyperlink);
                if (index < this.PhotoVM.PhotoTags.Count - 1)
                {
                    Run    run3 = new Run();
                    string str2 = ", ";
                    run3.Text = (str2);
                    Run run4 = run3;
                    ((PresentationFrameworkCollection <Inline>)paragraph.Inlines).Add((Inline)run4);
                }
            }
            ((PresentationFrameworkCollection <Block>) this.textTags.Blocks).Add((Block)paragraph);
        }
Esempio n. 2
0
        public static void ShowPhotoIsSavedInSavedPhotos()
        {
            GenericInfoUC genericInfoUc = new GenericInfoUC(3000);

            ((UIElement)genericInfoUc.richTextBox).Visibility   = Visibility.Visible;
            ((UIElement)genericInfoUc.textBlockInfo).Visibility = Visibility.Collapsed;
            RichTextBox richTextBox = genericInfoUc.richTextBox;
            Paragraph   paragraph   = new Paragraph();
            string      text1       = CommonResources.PhotoIsSaved.Replace(".", "") + " ";

            ((PresentationFrameworkCollection <Inline>)paragraph.Inlines).Add((Inline)BrowserNavigationService.GetRunWithStyle(text1, richTextBox));
            Hyperlink hyperlink = HyperlinkHelper.GenerateHyperlink(CommonResources.InTheAlbum, "", (Action <Hyperlink, string>)((hl, str) => Navigator.Current.NavigateToPhotoAlbum(AppGlobalStateManager.Current.LoggedInUserId, false, "SavedPhotos", "", CommonResources.AlbumSavedPictures, 1, "", "", false, 0, false)), ((Control)richTextBox).Foreground, HyperlinkState.Normal);

            ((TextElement)hyperlink).FontSize = (((Control)richTextBox).FontSize);
            ((PresentationFrameworkCollection <Inline>)paragraph.Inlines).Add((Inline)hyperlink);
            ((PresentationFrameworkCollection <Block>)richTextBox.Blocks).Add((Block)paragraph);
            string text2 = "";

            // ISSUE: variable of the null type

            genericInfoUc.ShowAndHideLater(text2, null);
        }