WPF 中是否有向导控件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/287193/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:47:32  来源:igfitidea点击:

Is there a wizard control in WPF?

wpfwizard

提问by azamsharp

Are there any wizard type controls in WPF? I need functionality where I can go forward and back and use tabs to select a particular item which will show the details of the nested items. I can use the TabControl control but the tab items are dynamic so I cannot nest the region inside the tab item.

WPF 中是否有任何向导类型控件?我需要可以前进和后退并使用选项卡选择特定项目的功能,该项目将显示嵌套项目的详细信息。我可以使用 TabControl 控件,但选项卡项是动态的,因此我无法将区域嵌套在选项卡项内。

采纳答案by Pop Catalin

WPF has a navigation infrastructure built in:

WPF 内置了导航基础设施:

WPF Navigation Overview

WPF 导航概述

Also check out the wizard sample

另请查看向导示例

回答by MattP

Another simple way I have used for a basic Wizard is to use multiple Grids and change the Visibility properties when the buttons are clicked, using an int to keep track of the 'step number'

我用于基本向导的另一种简单方法是使用多个网格并在单击按钮时更改可见性属性,使用 int 来跟踪“步骤编号”

    <Grid Name="Page1">
        <TextBlock>Page 1</TextBlock>
    </Grid>

    <Grid Name="Page2" Visibility="Hidden">
        <TextBlock>Page 2</TextBlock>
    </Grid>

回答by Pavel

You may try open source Avalon Wizard.

您可以尝试开源Avalon Wizard

回答by Rashad Annara

Check This link. you can create wonderful wizard using extended wpf toolkit.

检查此链接。您可以使用扩展的 wpf 工具包创建精彩的向导。

Wizard

向导

回答by evoneutron

Found this great example on codeproject that should give you everything that you need:

在 codeproject 上找到了这个很好的例子,它应该给你你需要的一切:

http://www.codeproject.com/Articles/31837/Creating-an-Internationalized-Wizard-in-WPF

http://www.codeproject.com/Articles/31837/Creating-an-Internationalized-Wizard-in-WPF

回答by lezhkin11

MVVM Wizard- Usage like this (Requires DI container, views are created on first navigation)

MVVM 向导- 像这样的用法(需要 DI 容器,在第一次导航时创建视图)

<controls:Wizard>
    <controls:WizardStep ViewType="{x:Type test:View1}"  />
    <controls:WizardStep ViewType="{x:Type test:View2}" />
    <controls:WizardStep ViewType="{x:Type test:View3}" />
</controls:Wizard>

or like this (no DI is required, but creates all views straight away)

或像这样(不需要 DI,但会立即创建所有视图)

<controls:Wizard>

    <controls:WizardStep>
        <test:View1 />
    </controls:WizardStep>

    <controls:WizardStep>
        <test:View2 />
    </controls:WizardStep>

    <controls:WizardStep>
        <test:View3 />
    </controls:WizardStep>

</controls:Wizard>