我有一个具有以下结构的ListPicker:
toolkit:ListPicker x:Name="mListPicker" HorizontalAlignment="Right" Margin="0,75,43,0" Width="100" VerticalAlignment="Top">
< toolkit:ListPickerItem Content="5"/>
< toolkit:ListPickerItem Content="10"/>
< toolkit:ListPickerItem Content="15"/>
< toolkit:ListPickerItem Content="20"/>
< toolkit:ListPickerItem Content="25"/>
< toolkit:ListPickerItem Content="30"/>
< /toolkit:ListPicker>
Run Code Online (Sandbox Code Playgroud)
每当我尝试运行此命令时,会出现以下消息:
System.Windows.Markup.XamlParseException occurred
Message= [Line: 0 Position: 0]
--- Inner Exception ---
The parameter is incorrect.
LineNumber=0
LinePosition=0
StackTrace:
at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
at MS.Internal.XcpImports.FrameworkElement_ApplyTemplate(FrameworkElement frameworkElement)
at System.Windows.FrameworkElement.ApplyTemplateInternal()
at System.Windows.Controls.ScrollContentPresenter.HookupScrollingComponents()
at System.Windows.Controls.ScrollContentPresenter.OnApplyTemplate()
at System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)
at MS.Internal.XcpImports.MeasureNative(IntPtr element, Single inWidth, Single inHeight)
at MS.Internal.XcpImports.UIElement_Measure(UIElement element, …Run Code Online (Sandbox Code Playgroud) 我将DataForm用于具有大约40个属性的实体.我很满意表单如何显示除3个属性之外的所有属性.这3个属性恰好是项目列表.
我不想编写整个编辑模板,看起来非常适得其反.
<dataFormToolkit:DataForm AutoGenerateFields="True" CurrentItem="{Binding XXX, Mode=TwoWay, Source={StaticResource XXXViewModel}}" >
<dataFormToolkit:DataField Label="Client" >
<ListBox ItemsSource="{Binding Client}"></ListBox>
</dataFormToolkit:DataField>
</dataFormToolkit:DataForm>
Run Code Online (Sandbox Code Playgroud) 我正在尝试在Silverlight DataGrid中实现重新排序行.为此我扩展了默认值DataGridDragDropTarget,我需要覆盖并实现以下方法:
protected override DataGridRow ContainerFromIndex(DataGrid itemsControl, int index)
{
}
Run Code Online (Sandbox Code Playgroud)
如何从DataGrid和索引中获取DataGridRow?
从安装的JetPack主题模板创建新的Silverlight应用程序后,我尝试按照App.xaml文件中提供的有关如何启用silverlight工具包控件的主题的说明,
<!--
<ResourceDictionary Source="Assets/ToolkitStyles.xaml"/>
To extend this theme to include the toolkit controls:
1. Install the Silverlight Toolkit for Silverlight 4
2. Add a Toolkit control to your project from the toolbox. This will add references to toolkit assemblies.
3. Change the "Build Action" for ToolkitStyles.xaml to "Page"
4. Uncomment the resource dictionary include above.
If you do not intend to use toolkit controls, delete this comment and the ToolkitStyles.xaml file.-->
Run Code Online (Sandbox Code Playgroud)
我正确地按照说明进行操作,但项目现在无法编译,这里出现了大约39个错误.
我是Silverlight的新手(来自MVC/jQuery),这可能是我正在做的事情.
错误40查找资源字典"Assets/ToolkitStyles.xaml"时发生错误.X:\ Projects\ISMM\ISMM.SilverlightUI\app.xaml 18 17 ISMM.SilverlightUI
错误20未找到程序集"System.Windows.Controls.DataVisualization.Toolkit".验证您没有错过程序集引用.此外,验证是否已构建项目和所有引用的程序集.X:\ Projects\ISMM\ISMM.SilverlightUI\Assets\ToolkitStyles.xaml …
我将我的Chart代码从visifire迁移到Toolkit.我想知道Visifire to Toolkit的ColorSet属性[样本值Caravan,Picasso ..]的对应部分.
有没有?
TIA
我一直在玩弄新发布的Silverlight 5以及Silverlight的5工具包(2011年12月),我想试试我的部署Silverlight的3D测试应用程序的第三方托管服务器(AppHarbor在我的情况,但我对其他选项开放).
我的测试应用程序只是您在创建新的Silverlight 3D应用程序时获得的默认Silverlight 3D应用程序:
看起来AppHarbor(以及大多数其他托管站点)要求您将所需的Silverlight 5 DLL复制到项目中,因为它们的服务器上没有安装所需的SDK/Toolkits.
理论上似乎很好,但我不知道如何使用Silverlight实际执行此操作.
问题是双重的:
我不确定哪些DLL需要手动复制到我的项目中,我不确定它们应该如何被包含和引用.
(而不是SDK安装和工具包安装DLL)的一些实验用复制几个Silverlight的XNA的DLL到我的项目和引用本地项目的DLL后,当我在浏览器中运行的基本的3D Silverlight应用程序现在崩溃- - 当地.(Silverlight插件崩溃.)在我开始摆弄引用和DLL之前,我没有遇到这个问题; 默认项目工作得很好.所以我甚至没有部署到托管服务器,因为它不再在本地运行.
在上面的后一点(Silverlight插件崩溃),问题似乎与3D Silverlight功能有关,这显然需要提升的信任/权限 - 诚然,我并不完全理解这一切是如何工作的.
一般来说 - 不管这一切的DLL /参考摆弄的 - 好像我需要检查在Silverlight3dApp项目属性"需要提升的信任在浏览器中运行时"来获得纺纱3D立方体的应用程序在浏览器中显示出来.或者,如果我不选中,我需要在浏览器中右键单击Silverlight 5应用程序并在"权限"选项卡上启用3D图形.(附注:我对如何部署这个会影响我的最终用户感兴趣.他们是否必须以同样的方式手动调整权限?无论如何,这是一个不同日子的问题.)
抛开这一点:
有没有人成功地将基本的Silverlight 5 3D应用程序部署到没有安装Silverlight 5(和Silverlight 5 Toolkit)的服务器上?
你是怎么做到的?需要将哪些文件复制到我的项目中并在本地引用?需要删除哪些引用(如果有)?
子问题:如果有人对提升的信任/权限问题有任何见解,我也很乐意听到这些问题.
我遇到了Silverlight Unit Test Framework的一个奇怪问题.每次执行的第一个方法都失败了.我用完全相同的代码进行第二次测试,然后通过.第一次调用它的奇怪之处在于它实际上等待超时然后执行存储库调用(如果你关心的话,它下面是一个HTTP PUT).这是代码 - 第一个代码每次都失败,第二个代码每次都会失败:
[TestMethod]
public void AuthShouldSucceed()
{
var autoResetEvent = new AutoResetEvent(false);
_authRepository.Authenticate(_username, _password, response =>
{
Assert.IsTrue(response);
autoResetEvent.Set();
});
if (!autoResetEvent.WaitOne(Constants.Timeout))
{
Assert.Fail("Test timed out.");
}
}
[TestMethod]
public void AuthShouldSucceed2()
{
var autoResetEvent = new AutoResetEvent(false);
_authRepository.Authenticate(_username, _password, response =>
{
Assert.IsTrue(response);
autoResetEvent.Set();
});
if (!autoResetEvent.WaitOne(Constants.Timeout))
{
Assert.Fail("Test timed out.");
}
}
Run Code Online (Sandbox Code Playgroud)
编辑: 我的最终解决方案是对Vladmir解决方案的修改:
[TestMethod]
[Asynchronous]
public void AuthShouldSucceed()
{
var complete = false;
var result = false;
_authRepository.Authenticate(_username, _password, response …Run Code Online (Sandbox Code Playgroud) silverlight unit-testing silverlight-toolkit silverlight-5.0
我从Nuget安装了Silverlight Toolkit,但是当我尝试运行该项目时,它会抛出一个错误告诉我:
{System.IO.FileNotFoundException:无法加载文件或程序集'System.Windows.Controls.Toolkit.Internals,Version = 4.0.5.0,Culture = neutral,PublicKeyToken = 2c5c654d367bf4a7'或其依赖项之一.该系统找不到指定的文件.文件名:'System.Windows.Controls.Toolkit.Internals,Version = 4.0.5.0,Culture = neutral,PublicKeyToken = 2c5c654d367bf4a7'}
所以,我在我的项目中添加了这个程序集,并且还给我一个错误.
我开始考虑是否必须修改nuget包或类似的东西.
任何建议都是受欢迎的.
如何在WinRT XAML Toolkit图表控件中更改图表控件的调色板颜色?
例如,我想更改饼图切片的颜色.
silverlight-toolkit windows-runtime winrt-xaml windows-store-apps winrt-xaml-toolkit
我想改变ReadOnly Textbox的颜色
可以将默认颜色更改为白色
<Style TargetType="TextBox">
<Setter Property="Background"
Value="White"/>
<Setter Property="Foreground"
Value="Black"/>
</Style>
Run Code Online (Sandbox Code Playgroud)
和文本框为
<TextBox Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" Height="18" Padding="0" IsReadOnly="True" Margin="3,0,3,0"/>
Run Code Online (Sandbox Code Playgroud)
提前致谢
silverlight silverlight-toolkit silverlight-3.0 silverlight-4.0 silverlight-5.0
silverlight ×8
appharbor ×1
c# ×1
charts ×1
dataform ×1
datagrid ×1
deployment ×1
listpicker ×1
nuget ×1
unit-testing ×1
winrt-xaml ×1
xaml ×1