My name is Edward Tanguay. I'm an American software and web developer living and working in Berlin, Germany.
23 hours ago: How can a silverlight app download and play an mp3 file from a URL? #stackoverflow #question http://is.gd/aRxjK.
24 hours ago: Omg, google docs publishes their documents with embedded font tags: <FONT style=background-color:#ffff00>.
yesterday: Seen on the internet: "we produce hight quolity products".
yesterday: How to consume text from any Google Document, RSS feed, or Twitter feed in your Silverlight application: http://is.gd/aRjO2.
yesterday: WANTED: online service in which I can type some C# code, and it gives me equivalent code in PHP & other languages #googletranslateforcode.
2 days ago: Good article about workarounds for getting data into silverlight from sites that don't support clientaccesspolicy.xml: http://is.gd/aQrL5.
2 days ago: Saddened by the fact that I get a security error when trying to read a google doc URL with Silverlight, workarounds anyone?
2 days ago: When I step in to debug a certain method in my silverlight app, the music in my youtube playlist stops until I stop debugging #feature.
2 days ago: Love Generate Method Stub in Visual Studio, did I have that in Eclipse? I can't remember.
2 days ago: "RealNetworks has been blocked from communicating with your local computer and network", Allow? / No. Thanks Windows 7.
2 days ago: Somebody needs to fix the here's-20-pages-of-incomprehensible-legal-text-Accept? dysfunctional behavior we all engage in daily.
WPF CODE EXAMPLE created on Saturday, February 06, 2010 permalink
How to use a WPF FileDialog to read in a text file
This example shows how you can allow the user to click on a button and choose a text file to view the contents of the file in a scrollable box on the screen.
XAML:
<Window x:Class="TestFileDialog2343.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="350">
    <StackPanel Margin="10" HorizontalAlignment="Left">
        <StackPanel HorizontalAlignment="Left">
            <Button Content="Load File"
                Click="Button_LoadFile_Click"
                Margin="0 0 0 10"/>
        </StackPanel>
        <ScrollViewer
            Width="300"
            Height="200">
            <TextBox x:Name="TextFileContent"
                 TextWrapping="Wrap"/>
        </ScrollViewer>
    </StackPanel>
</Window>

Code Behind:
using System.Windows;
using Microsoft.Win32;
using System.Text;
using System.IO;
using System;

namespace TestFileDialog2343
{
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
        }

        private void Button_LoadFile_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.DefaultExt = ".txt";
            dlg.InitialDirectory = @"C:test";
            dlg.Filter = "Text documents (.txt)|*.txt";

            bool? result = dlg.ShowDialog();

            if (result == true)
            {
                TextFileContent.Text =File.ReadAllText(dlg.FileName);
            }
        }

    }
}
need markup?