我安装了Windows 7.
然后,我从此处使用Web Platform Installer安装了Web Developer 2010 Express .
然后我从这里安装了Silverlight 4 Toolkit 的4月15日版本.
然后我添加了这个参考:
替代文字http://www.deviantsart.com/upload/ijk0lm.png
然后在我的XAML中,我像这样引用它,但它没有给我智能感知并且告诉我我缺少一个程序集引用:
替代文字http://www.deviantsart.com/upload/cd4vrj.png
更新:
xmlns:tk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
Run Code Online (Sandbox Code Playgroud)
即使在重建之后也不起作用
在Web Developer 2010 Express中使用Silverlight 4 Toolkit需要做什么?
所以我在另一台计算机上用Web Developer Express 2008中的Silverlight 3再次测试它,它确实按照我记忆的方式工作,所以为什么它不能在Silverlight 4中以这种方式工作,我需要更改才能获得它上班?:
wrappanel visual-studio-2010 silverlight-toolkit dockpanel silverlight-4.0
我正在尝试使用TiltEffectSilverlight工具包中的一个LongListSelector.这是在XAML中声明元素的方式:
<controls:PivotItem Header="Pivot Item">
<controls:PivotItem.Resources>
<DataTemplate x:Key="LongListSelectorGroupHeaderTemplate">
<Border Background="{StaticResource PhoneAccentBrush}"
Margin="10,20,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Height="{StaticResource PhoneFontSizeExtraExtraLarge}"
Width="{StaticResource PhoneFontSizeExtraExtraLarge}">
<TextBlock Text="{Binding Name}"
Style="{StaticResource PhoneTextExtraLargeStyle}"
Foreground="White"
VerticalAlignment="Bottom"
HorizontalAlignment="Left" />
</Border>
</DataTemplate>
<DataTemplate x:Key="LongListSelectorGroupItemTemplate">
<Border Background="{StaticResource PhoneAccentBrush}"
Margin="10"
Height="{StaticResource PhoneFontSizeExtraExtraLarge}"
Width="{StaticResource PhoneFontSizeExtraExtraLarge}">
<TextBlock Text="{Binding Name}"
Style="{StaticResource PhoneTextExtraLargeStyle}"
Foreground="White"
VerticalAlignment="Bottom"
HorizontalAlignment="Left" />
</Border>
</DataTemplate>
<DataTemplate x:Key="LongListSelectorItemTemplate">
<StackPanel Grid.Column="1"
VerticalAlignment="Top"
Orientation="Horizontal"
toolkit:TiltEffect.IsTiltEnabled="True">
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener Tap="OnLongListSelectorTapped" />
</toolkit:GestureService.GestureListener>
<Image Source="{Binding ImageSource}"
MinHeight="32"
MinWidth="32"
MaxHeight="48"
MaxWidth="48" />
<TextBlock Text="{Binding Name}"
Style="{StaticResource PhoneTextExtraLargeStyle}"
Margin="12,10,12,0" /> …Run Code Online (Sandbox Code Playgroud) 我正在尝试从silverlight工具包LongListSelector创建一个后代类.我们称之为SimpleLonglistSelector.我从"Silverlight for Windows Phone Toolkit Source&Sample - Feb 2011.zip"开始
http://silverlight.codeplex.com/releases/view/60291
我创建了一个新类:
public class SimpleLongListSelector : LongListSelector
{
public SimpleLongListSelector()
{
var itemsPanelTemplate = @"
<ItemsPanelTemplate xmlns='http://schemas.microsoft.com/client/2007'>
<toolkit:WrapPanel xmlns:toolkit='clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit' Orientation=""Horizontal""/>
</ItemsPanelTemplate>";
this.GroupItemsPanel = (ItemsPanelTemplate)XamlReader.Load(itemsPanelTemplate);
var groupItemTemplate = @"
<DataTemplate xmlns='http://schemas.microsoft.com/client/2007'>
<Border Width=""99"" Height=""99"" Background=""{StaticResource PhoneAccentBrush}"" Margin=""6"" IsHitTestVisible=""{Binding HasItems}"">
<TextBlock Text=""{Binding Key}""
FontFamily=""{StaticResource PhoneFontFamilySemiBold}""
FontSize=""36""
Margin=""{StaticResource PhoneTouchTargetOverhang}""
Foreground=""{StaticResource PhoneForegroundBrush}""
VerticalAlignment=""Bottom""/>
</Border>
</DataTemplate>";
this.GroupItemTemplate = (DataTemplate)XamlReader.Load(groupItemTemplate);
var groupHeaderTemplate = @"
<DataTemplate xmlns='http://schemas.microsoft.com/client/2007'>
<Border Background=""Transparent"">
<Border Background=""{StaticResource PhoneAccentBrush}"" Width=""75"" Height=""75"" HorizontalAlignment=""Left"">
<TextBlock Text=""{Binding Path=Key}"" …Run Code Online (Sandbox Code Playgroud) inheritance silverlight-toolkit windows-phone-7 longlistselector
我想在WrapPanel中显示一个图像列表.我怎么能这样做或者我会使用其他控制?
我需要打开一个菜单,因为WP7 not designed要执行这样的操作,我正在使用Toolkit.以下是示例代码:
<Border BorderThickness="3" Padding="6">
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu>
<toolkit:MenuItem Header="item1" Click="Item1_Click" />
<toolkit:MenuItem Header="item2" Click="Item2_Click" />
<toolkit:MenuItem Header="item3" Click="Item3_Click" />
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
<TextBlock Text="Tap" />
</Border>
Run Code Online (Sandbox Code Playgroud)
现在只要用户按下并保持动作,这就可以正常工作.但我不能要求用户采取这样的行动.我需要在单击/点击/触摸/手势(您要调用它的水)上显示菜单.有人可以建议吗?如果您认为工具包不是最佳方式,那么请使用示例代码建议替代方案.我试过弹出窗口,但这比我的应用程序更糟糕
我的主要问题是关于在场景中绑定案例我们有多个控件源(数据网格内的组合框)(或者同时具有datacontext和itemssource).那么我们如何知道绑定将使用哪个源?(任何语法澄清)
假设datagrid有一个itemssource ="玩家列表"datacontext ="Manager",并且有一个组合框作为一种列.我们还假设每个玩家都有一个Inventory属性,它是一个集合类型.
然后在datagrid.columns里面:
谢谢
我有一个主数据网格,然后是一个手风琴控件.在其中一个手风琴项目中,我有另一个数据网格,它绑定到第一个数据网格的选定项目.简单的xaml是:
<sdk:DataGrid Name="dgMain" ItemsSource="{Binding SomeSource}" />
<toolkit:Accordion>
<toolkit:AccordionItem Header="Details">
<sdk:DataGrid ItemsSource="{Binding ElementName=dgMain, Path=SelectedItem.Children}"/>
</toolkit:AccordionItem>
</toolkit:Accordion>
Run Code Online (Sandbox Code Playgroud)
我将第二个网格的VerticalAlignment属性设置为"Stretch",因此当它绑定到不同的集合大小时它会伸展,但问题是它只在AccordionItem大小内延伸,所以如果我在第一个网格中选择一个有更多的新项目"孩子们"然后我必须滚动第二个网格,因为AccordionItem没有改变.
AccordionItem区域仅在我压缩并再次展开时才会改变.将VerticalContentAlignment设置为"Stretch"为accordion项不起作用.我猜是因为它只会在第一次扩展时触发它.
有谁知道我还能尝试什么,或者我错过了什么.我更喜欢坚持使用xaml解决方案,因此我可以保持MVVM友好,但很高兴听到一切.
我试图在新机器上构建Silverlight应用程序时遇到错误.(Silverlight 4,Visual Studio 2010)此应用程序在其他四台计算机上无错误地编译.
错误是:
the tag 'MenuItem' does not exist in XML namespace 'clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit'.
Run Code Online (Sandbox Code Playgroud)
引用似乎是指向正确程序集的指针.还有其他人有过这个问题吗?
在完成了一个只在SL工具包上适度倾斜的小型爱好项目之后,我忍不住发现了很多粗糙的边缘(很多).最新的版本似乎是从2010年4月(!),并且发布错误的论坛似乎被放弃了.也许最后一点是夸张,但只是轻微的.
我(严重)的问题是,SL团队的任何人都说过该工具包的未来是什么?它是否被卷入Silverlight 5?工具包是否已经简单地转换/升级到SL 5,并且当SL5下降时将重新发布(带有一些新的润色)?
任何人都有的任何信息将不胜感激.
编辑
为了完整起见,我想指出微软正在关闭Silverlight.net网站.现在几乎可以肯定的是,正如之前许多人所假设的那样,Silverlight正朝着墓地前进.如果Silverlight Toolkit将来有任何新增功能,我会感到震惊.
silverlight ×5
c# ×2
wpf ×2
wrappanel ×2
xaml ×2
.net ×1
contextmenu ×1
dockpanel ×1
inheritance ×1