Silverlight 4中:自由拆分按钮 [英] Silverlight 4: Free Split Button
问题描述
我在找Silverlight的免费splitbutton控制。
I'm looking for free splitbutton control for silverlight.
我已经看到了这个<一个href=\"http://blogs.msdn.com/b/delay/archive/2010/06/11/splitbuttoning-hairs-two-fixes-for-my-silverlight-splitbutton-menubutton-implementation-and-true-wpf-support.aspx\"相对=nofollow>博客但是我不能下载它。其挡在我的防火墙。
I've seen this blog however I cannot download it. Its blocked in my firewall.
你知道Silverlight的任何免费splitbutton?
Do you know any free splitbutton for silverlight?
感谢您
推荐答案
它可用于在Silverlight工具包免费的。
It is available for free in the Silverlight Toolkit.
-
从$下载最新的Silverlight工具包C $ CPLEX。
Download the latest Silverlight Toolkit from CodePlex.
http://silverlight.codeplex.com/
下载SplitButton样品和项目。您可以使用SplitButton项目自己编译的SplitButton.dll的版本或使用示例程序来学习。 (可选)
Download the SplitButton Samples and Project. You may use the SplitButton project to compile your own version of the SplitButton.dll or use the Sample programs to study. (optional)
http://cesso.org/Samples/SplitButton/SplitButton.zip
添加引用(右击参考资料)到Silverlight工具包和SplitButton.dll在你的Silverlight项目。
Add references (right click References) to the Silverlight toolkit and the SplitButton.dll in your Silverlight project.
SplitButton.dll
System.Windows.Controls.Input.Toolkit.dll
两个命名空间添加到您的XAML,为Silverlight工具包和新SplitButton。
Add both namespaces to your XAML, for the Silverlight toolkit and the new SplitButton.
xmlns:splitButton="clr-namespace:Delay;assembly=SLTKSplitButton"
xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
添加拆分按钮code。这使得一键即下降到三个选项。
Add the Split Button code. This makes one button that drops to three options.
<splitButton:SplitButton x:Name='Button1' Content="Open" Click="Button1_Clicked">
<splitButton:SplitButton.ButtonMenuItemsSource>
<toolkit:MenuItem Header="Open" Click="Button1_Clicked" />
<toolkit:MenuItem Header="Open read-only" Click="Button1_ClickedRO" />
<toolkit:MenuItem Header="Open as copy" Click="Button1_ClickedAC" />
</splitButton:SplitButton.ButtonMenuItemsSource>
</splitButton:SplitButton>
添加Csharp的code的点击处理程序主按钮点击或任何三个子选项点击。
Add Csharp code for click handlers for main button click or any of the three sub-option clicks.
private void Button1_Clicked(object sender, RoutedEventArgs e)
{
MessageBox.Show("Opening document normally...");
}
private void Button1_ClickedRO(object sender, RoutedEventArgs e)
{
MessageBox.Show("Opening document read-only...");
}
private void Button1_ClickedAC(object sender, RoutedEventArgs e)
{
MessageBox.Show("Opening document as a copy...");
}
称谢大卫安生,微软开发谁与Silverlight的,Windows Phone和WPF平台的作品。微博:@DavidAns
Give thanks to David Anson, a Microsoft developer who works with the Silverlight, Windows Phone, and WPF platforms. Twitter: @DavidAns
这篇关于Silverlight 4中:自由拆分按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!