gpt4 book ai didi

wpf - 如何将一个 WPF 表单嵌入到另一个表单中?

转载 作者:行者123 更新时间:2023-12-04 09:41:55 25 4
gpt4 key购买 nike

我想拥有带有选项卡控件的主 WPF 表单,其中每个选项卡都包含一个独立的 WPF 表单。这些表格不相互依赖,所以我认为单独开发它们会更容易,然后将它们嵌入到主表格中。

表单数量是已知的,因此不需要动态插件系统。

最佳答案

当您使用 FrameNavigationWindow 时,您可以让它加载不同的 xaml Pages 甚至 html。您还可以让它像浏览器一样具有向前和向后导航。见 http://msdn.microsoft.com/en-us/library/ms750478.aspx

您可以在每个选项卡上放置一个 Frame 并让它加载某个页面。

<Window x:Class="PluginApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<DockPanel>
<Frame Name="frame" NavigationUIVisibility="Visible" Source="SomePage.xaml" />
</DockPanel>
</Window>

<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowTitle="Page Title"
WindowWidth="500"
WindowHeight="200">
Hello world
</Page>

关于wpf - 如何将一个 WPF 表单嵌入到另一个表单中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/549464/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com