How should I to add property to Button in XAML file for refreshing WebView2 Window

Viewed 37

I'm pretty new at development of apps with WebView2. Please help. I have some XAML which represents the window with image derived from another PC. So sometimes there is a need to refresh this image. Now I have this part of XAML file

<Grid >
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="25"/>
    </Grid.ColumnDefinitions>
    <TextBlock Text="{Binding RmoName}" FontSize="14" TextAlignment="Center"           
    Grid.ColumnSpan="2" HorizontalAlignment="Center" FontWeight="Bold"></TextBlock>
    <Button Grid.Column="1" Content="Refresh" CommandTarget="{Binding ElementName=WebBrowser, Path=ReloadCommand}"/>
</Grid>

<!--<Rectangle Width="1920" Height="1200" IsEnabled="False"/>-->
<wpf:WebView2 Source="{Binding HostName}" Width="320" Height="180" IsEnabled="False" x:Name="WebBrowser"/>

Button references to element WebView2 with name called "WebBrowser", but what property for binding have I to use instead of ReloadCommand to invoke refreshing the page with this Button?

1 Answers
Related