Question

My silverlight app needs to get back to the host from whence it came for its data. How do I get the webclient to connect back to the root of that site.

For example, my silverlight xap is sitting in an Amazon S3 bucket and loaded via an HTML file in that same bucket. I want to do a http://mybucket.s3.amazonaws.com/ and then act on the xml that is returned from that GET.

Was it helpful?

Solution

Use System.Windows.Application.Host - see the documentation, which contains this example:

"The following example shows how to use Host to get the path to the Silverlight application package."

<UserControl x:Class="SilverlightApplication.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Grid>
        <TextBlock Text="{Binding Source}" />
    </Grid>

</UserControl>

OTHER TIPS

Application.Current.Host.Source in C#

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top