【发布时间】:2014-08-26 13:35:42
【问题描述】:
我习惯于使用设计器创建表单,并且仅在需要时手动修改 XAML。
尽管扩展工具包是一个很棒的库,但它仍然缺乏与 Visual Studio 设计器的集成。无论如何,工具包的控件是否可以像标准控件一样显示在设计器(而不是工具箱)中?如果没有,是否有解释?
目前,该工具包的控件只是空白且无法通过简单的点击来选择。
注意:问题似乎只发生在容器组件(如 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>
【问题讨论】:
-
我知道我过去曾看到它们为我显示,但我对您的设置了解得不够多,无法评论为什么它们不会为您显示。
-
如果我理解正确,您想通过设计器向表单添加控件吗?所有控件,甚至来自其他库的控件都必须在工具箱中。
-
@Vitaliy 不,我知道如何让控件显示在工具箱中。我希望它们实际上在设计器窗口中显示,而不是完全空白且无法通过单击选择。
-
@Kilazur 嗯,他们必须在没有一些动作的情况下显示......我认为这个库有问题
-
你可以试试wpf工具包
标签: c# wpf xaml wpftoolkit visual-studio-designer