XML file source from users/appdata/roaming folder
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: XML file source from users/appdata/roaming folder

  1. #1
    Join Date
    Apr 2011
    Posts
    15

    XML file source from users/appdata/roaming folder

    Code:
    <Window x:Class="MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
        <Grid>
            <Grid.Resources>
                <DataTemplate x:Key="SystemTemplate">
                    <Label Content="{Binding XPath=Name}"/>
                </DataTemplate>
            </Grid.Resources>
            <Grid.DataContext>
                <XmlDataProvider x:Name="SystemData" Source="Systems.xml" XPath="Emulators/System" />
            </Grid.DataContext>
            <ListBox Height="244" HorizontalAlignment="Left" Margin="12,12,0,0" Name="ListBox1" VerticalAlignment="Top" Width="167"
                     ItemsSource="{Binding}"
                     ItemTemplate="{StaticResource SystemTemplate}"
                     IsSynchronizedWithCurrentItem="True"
                     Visibility="Visible" SelectionMode="Single">
             </ListBox>
        </Grid>
    </Window>
    Hello,
    I've bind an XML file to a ListBox.
    Everything's working right..but the XML file is read as a resource for now...what I would like is being able to read it from the users/appdata/roaming folder! (that's where user's data are saved..so I would like to be able to read from there too!)
    So, how should I adapt that 'Source=""' part to reference the users/appdata/roaming folder?

    Hope that I'm clear! Thanks for your help!
    Last edited by Jayme65; September 3rd, 2012 at 09:20 AM.

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center