I’m using Silverlight 5 with mvvm pattern.
In xaml page I have one hyperlinkbutton and image. If I click that button named “Preview” means the image or anyfile has to be open in new tab browser.
XAML CODE:
<Image Source="{Binding Image}"/>
<HyperlinkButton Content="Preview" Width="60" Height="26"
HorizontalAlignment="Center"
VerticalAlignment="Center"
TargetName="_blank"
Name="HyperlinkButton"
Background="Transparent"
Click="HyperlinkButton_Click">
</HyperlinkButton>
VIEWMODEL CODE:
void ChooseHyperExecute(object param)
{
WebBrowser br = new WebBrowser();
SampleViewModel dt = param as SampleViewModel;
string ma = dt.String_Value;
br.Navigate(new Uri(Application.Current.Host.Source, string.Format("./Images/{0}", ma)));
}
But it’s not working.
You need to use
HtmlWindow.Navigatemethod: