C# 有没有办法显示WPF扩展工具包';VS设计器中的控件?

C# 有没有办法显示WPF扩展工具包';VS设计器中的控件?,c#,wpf,xaml,wpftoolkit,visual-studio-designer,C#,Wpf,Xaml,Wpftoolkit,Visual Studio Designer,我习惯于使用设计器创建表单,并仅在需要时手动修改XAML 尽管扩展工具包是一个很棒的库,但它仍然缺乏与VisualStudio的设计器的集成。工具箱的控件是否可以像标准控件一样显示在设计器(而不是工具箱)中?如果没有,有什么解释吗 目前,工具箱的控件只是空白的,只需简单的点击就无法选择 注意:问题似乎只发生在容器组件(如BusyIndicator和Wizard/WizardPage)上 编辑:这是我的一些XAML。有了它,我可以看到向导的第一页,但看不到其他页面的明显方式。如果我把我的向导放在B

我习惯于使用设计器创建表单,并仅在需要时手动修改XAML

尽管扩展工具包是一个很棒的库,但它仍然缺乏与VisualStudio的设计器的集成。工具箱的控件是否可以像标准控件一样显示在设计器(而不是工具箱)中?如果没有,有什么解释吗

目前,工具箱的控件只是空白的,只需简单的点击就无法选择

注意:问题似乎只发生在容器组件(如BusyIndicator和Wizard/WizardPage)上

编辑:这是我的一些XAML。有了它,我可以看到向导的第一页,但看不到其他页面的明显方式。如果我把我的向导放在BusyIndicator中,什么也看不见

<Window x:Class="MyProgram.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:MyProgram"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        Title="My Program" Height="477" Width="688" MinWidth="688" MinHeight="478">
    <xctk:Wizard x:Name="wizard" FinishButtonClosesWindow="True" Next="wizard_Next">
        <xctk:WizardPage Name="Intro_Page"  Title="ABC" Description="abc" NextPage="{Binding ElementName=Second_Page}" Enter="disallowNext">
            <xctk:WizardPage.Content>
                <Grid>
                    <Label Content="abc" HorizontalAlignment="Center" Margin="0,54,0,87" Name="intro_lbl" VerticalAlignment="Center" Grid.Column="1" Padding="5" HorizontalContentAlignment="Center" Height="28" IsEnabled="False" />
                 </Grid>
            </xctk:WizardPage.Content>
        </xctk:WizardPage>
        <xctk:WizardPage Name="Second_Page" Title="DFG" Description="dfg" NextPage="{Binding ElementName=Last_Page}">
            <xctk:WizardPage.Content>
                <Grid Name="grid">
                    <TextBox Grid.Column="1" Height="23" HorizontalAlignment="Stretch" Name="txt_second" VerticalAlignment="Center" />
                </Grid>
            </xctk:WizardPage.Content>
        </xctk:WizardPage>
        <xctk:WizardPage Name="Last_Page" PageType="Interior"
                         Title="Last Page"
                         Description="This is the last page in the process"
                         CanFinish="True" />
    </xctk:Wizard>
</Window>

我知道这个答案来得晚,但昨天我在这个问题上绊倒了自己,也许它对其他登陆这里的人有用

我通过创建一个自己的控件解决了这个问题,该控件派生自
WizardPage
。 只需创建一个新的
UserControl
,包括Xceed.Wpf.Toolkit名称空间,并在xaml文件和代码隐藏文件中将类型从
UserControl
更改为
xctk:WizardPage

<xctk:WizardPage x:Class="WizardTest.MyWizardPage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:xctk="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
             xmlns:local="clr-namespace:WizardTest"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
  <Grid>
    <TextBlock>Hello World!</TextBlock>
  </Grid>
</xctk:WizardPage>

你好,世界!
现在,您可以使用VisualStudio设计器创建UI。 要在向导中放置页面,只需将派生页面的对象放入其项目中:

<xctk:Wizard>
  <local:MyWizardPage Title="My Wizard Page"/>
</xctk:Wizard>


您可以在您的Costam页面中开箱即用地使用
Bindungs
,因为
MyWizardPage
对象的
DataContext
自动设置为向导
DataContext
(如果没有明确指定,则继承自窗口
DataContext

我知道我以前看到过它们为我显示,但我对您的设置了解不够,无法解释为什么它们不会显示给您。如果我理解正确,您希望通过设计器将控件添加到表单中吗?所有控件,甚至来自其他库的控件都必须在工具箱中。@Vitaliy不,我知道如何使控件显示在工具箱中。我希望它们在designer窗口中有一个真正的显示,而不是完全空白,单击时不可选择。@Kilazur-hmm,它们必须显示而不执行某些操作。。。我认为这个库有一些问题,你可以试试wpf工具包