Use a Frame control to navigate to Web pages and a Extensible Application Markup Language (XAML) page. : Frame « Windows Presentation Foundation « C# / CSharp Tutorial






<Page x:Class="FrameExample.Page1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <StackPanel>
        <RadioButton Name="VisualBasic" Checked="BrowseAHomePage" GroupName="HomePages">
      Visual Basic
        </RadioButton>
        <RadioButton Name="VisualCSharp" Checked="BrowseAHomePage" GroupName="HomePages">
      Visual C# 
        </RadioButton>
        <RadioButton Name="AnotherPage" Checked="BrowseAHomePage" GroupName="HomePages">
      XAML Page
        </RadioButton>
        <Frame Name = "myFrame" Background="LightBlue"/>
    </StackPanel>
</Page>

//File:Window.xaml.cs

using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Input;
using System.IO;
using System.Net;

namespace FrameExample
{
  public partial class Page1 : Page
  {
    private void BrowseAHomePage(object sender, RoutedEventArgs e)
    {
      if ((Boolean)VisualBasic.IsChecked)
        myFrame.Navigate(new System.Uri("http://msdn.microsoft.com/vbasic/")); 
      else if ((Boolean)VisualCSharp.IsChecked)
        myFrame.Navigate(new System.Uri("http://msdn.microsoft.com/vcsharp/")); 
      else if ((Boolean)AnotherPage.IsChecked)
        myFrame.Navigate(new System.Uri("AnotherPage.xaml",UriKind.RelativeOrAbsolute));
     }
  }
}
WPF Use A Frame Control To Navigate To Web Pages And A Extensible Application Markup Language X A M L Page








24.64.Frame
24.64.1.Use Frame to Load another Xaml fileUse Frame to Load another Xaml file
24.64.2.Frame Navigation Demo WindowFrame Navigation Demo Window
24.64.3.Xaml frame on a TabXaml frame on a Tab
24.64.4.Use a Frame control to navigate to Web pages and a Extensible Application Markup Language (XAML) page.Use a Frame control to navigate to Web pages and a Extensible Application Markup Language (XAML) page.
24.64.5.Put a Frame tag onto a Window to host a pagePut a Frame tag onto a Window to host a page
24.64.6.Navigate Frame to a xaml documentNavigate Frame to a xaml document
24.64.7.Navigate Frame to a URLNavigate Frame to a URL
24.64.8.Get the Resize Frame Vertical Border Width
24.64.9.Get the Resize Frame Horizontal Border Height