WPF中有个很好的机制,就是Frame,Frame不仅可以像网页中的Frame一样加载Wpf的page对象,还可以加载WEB,使用方法:

frame1.Source = new Uri("http://localhost:2613/Default.aspx");

当然也可以用Navigate方法设置Source的Uri,还可以通过设置Content,但是稍微麻烦一点,因为需要创建一个WebBrowser对象作为Content

在MainWindows.xaml中引用Fram控件

 <Frame x:Name="frame1" Margin="0,59,0,0" Width="300" Height="300" Source="Page1.xaml" />

在Page1.xaml中随便定义一些内容。

<Grid>
        <TextBlock>ssfsdf</TextBlock>
    </Grid>

Frame 控件

转载于:https://www.cnblogs.com/zhuzhenyu/archive/2013/03/05/2944067.html

相关文章:

  • 2022-12-23
  • 2022-02-21
  • 2021-05-13
  • 2021-05-31
  • 2022-12-23
  • 2021-06-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-29
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案