Results 1 to 2 of 2

Thread: WPF and FlowDocumentScrollViewer

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2001
    Location
    socal
    Posts
    74

    WPF and FlowDocumentScrollViewer

    Hi all,

    VS 2008 C# and WPF;

    I am try to display, RSS data onto a WPF window using FlowDocumentScrollViewer. I a new to WPF, and have not used C# very long (came from vb.net).

    here is the Xaml;

    <FlowDocumentScrollViewer
    IsSelectionEnabled="False"
    Margin="8,38,8,98.04"
    VerticalScrollBarVisibility="Auto"
    x:Name="RssItemViewer"

    >
    <FlowDocument>
    <Paragraph TextAlignment="Left">
    <Run FontFamily="Microsoft Sans Serif" x:Name="RssItemDate">[Date]</Run>
    </Paragraph>

    <Paragraph TextAlignment="Left">
    <Run FontFamily="Microsoft Sans Serif" x:Name="RssItemtest">[test]</Run>
    </Paragraph>

    </FlowDocument>




    </FlowDocumentScrollViewer>

    and I am using a "button" to test the RSS feeds but, would like the feeds to "scroll" so if there is more then one item in the channel both should display with the newest on on top. I am using agrotic for RSS.

    the c# code:

    RssFeed feed = RssFeed.Create(new Uri("RSS feed here"));
    foreach (RssItem item in feed.Channel.Items)
    {
    if (item.PublicationDate >= DateTime.Today.Subtract(new TimeSpan(0, 0, 0, 0)))
    {

    string test = (item.Author + " | " + item.Title + Environment.NewLine + item.Link);
    //this.RssItemDate.Text = test; //working
    this.RssItemtest.Text = test;

    //later make it clickable
    //RssItemLink.Text = (item.Link);

    // work: RssItemDate.Text = (item.Author + " | " + item.Title + " | " + item.Link);
    //RssItemDate.Text = (" ");

    //works
    //RssItemDate.Text = "test";
    //* works //*
    //MessageBox.Show(item.Author + " | " + item.Title + " | " + item.Link);
    //item.Guid will be the GUID
    }
    }

    // end block



    }



    Thanks

  2. #2

    Thread Starter
    Lively Member
    Join Date
    May 2001
    Location
    socal
    Posts
    74

    Re: WPF and FlowDocumentScrollViewer

    ok, then whats the best to to display dynamic content.? perferably in WPF.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width