使用 Jetpack 主题设计 SL Toolkit 手风琴样式
我正在尝试将新发布的 Jetpack 主题用于 Silverlight 4 应用程序。 TabControl 和按钮的样式很好,但我无法让 Accordion 控件选择 Jetpack 样式。
我创建了一个默认的“Silverlight Navigation(JetPack Theme)”VS 项目,并将以下定义添加到 XAML 文件中
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
,然后添加了手风琴控件,如下所示:
<toolkit:Accordion Grid.Column="0"
SelectionMode="OneOrMore" ExpandDirection="Down" SelectionSequence="Simultaneous">
<toolkit:AccordionItem Header="Stages">
<TextBlock>Stages</TextBlock>
</toolkit:AccordionItem>
<toolkit:AccordionItem Header="Products">
<TextBlock>Products</TextBlock>
</toolkit:AccordionItem>
</toolkit:Accordion>
此控件呈现为页面的一部分,但使用默认工具包样式,而不是像页面上其他控件那样的 JetPack 样式。我使用了错误的工具包命名空间吗?我尝试修改 ToolkitStyles.xaml 以添加手风琴样式的键,并通过 toolkit:Accordion 中的 Style 属性引用样式,但没有成功。
有人成功地使用 JetPack 主题设计了手风琴控件的样式吗?
I am trying to use the newly released Jetpack theme for a Silverlight 4 application. TabControl and buttons style nicely, but I cannot get the Accordion control to pick up the Jetpack style.
I have created a default 'Silverlight Navigation (JetPack Theme)' VS project and added the following definitions to the XAML file
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
And then I've added the accordion control like this:
<toolkit:Accordion Grid.Column="0"
SelectionMode="OneOrMore" ExpandDirection="Down" SelectionSequence="Simultaneous">
<toolkit:AccordionItem Header="Stages">
<TextBlock>Stages</TextBlock>
</toolkit:AccordionItem>
<toolkit:AccordionItem Header="Products">
<TextBlock>Products</TextBlock>
</toolkit:AccordionItem>
</toolkit:Accordion>
This control renders as part of the page, but using the default toolkit style, rather than the JetPack style like the other controls on the page. Am I using the wrong toolkit namespace? I've tried to modify ToolkitStyles.xaml to add a key to the accordion style and reference the style via Style attribute in toolkit:Accordion but without success.
Have anyone successfully styled the accordion control with the JetPack theme?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
按照 App.xaml 中的说明进行操作(取消对 Assets\ToolkitStyles.xaml 的引用的注释并在同一文件上设置生成操作)后,我使用手风琴控件样式成功编译和运行了示例项目。
After following the instruction in App.xaml (uncomment the reference to Assets\ToolkitStyles.xaml and setting the build action on that same file) I got the sample project to compile and run successfully with the accordion control styled.