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

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » Windows Presentation Foundation » FrameScreenshots 
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.
  


<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));
     }
  }
}

   
    
  
Related examples in the same category
1.Use Frame to Load another Xaml file
2.Frame Navigation Demo Window
3.Xaml frame on a TabXaml frame on a Tab
4.Put a Frame tag onto a Window to host a page
5.Navigate Frame to a xaml document
6.Navigate Frame to a URLNavigate Frame to a URL
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.