Tag: silverlight

在Windows phone Silverlight 8.1上接收WNS推送通知

我有windows phone 8.1 silverlight应用程序,我希望使用新框架WNS接收Notfications。 我在package.appxmanifest: 并将其添加到移动服务中心。 为此,我删除了对MPNS使用的旧引用,并为WNS添加了以下内容: 使用Windows.UI.Notifications; 使用Windows.Networking.PushNotifications; 使用Windows.UI.StartScreen; 这导致了获得channelURI的新方法: public static PushNotificationChannel CurrentChannel { get; private set; } public async static Task UploadChannel() { bool newChannel = false; var channel = await Windows.Networking.PushNotifications.PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); var settings = Windows.Storage.ApplicationData.Current.LocalSettings.Values; object oldChannel; settings.TryGetValue(“channelURI”, out oldChannel); if ((oldChannel as PushNotificationChannel).Uri != CurrentChannel.Uri) { settings.Add(“channelURI”, CurrentChannel); newChannel = […]

Silverlight Toolkit – 创建Google实时图表

我想创建一个尽可能像Google Realtime Timeline一样的图表,理想情况下它应该支持使用动态标签进行平移和缩放,而不是点击链接。 有什么办法吗? 谢谢。

我可以从Silverlight中的BitmapImage获取byte 吗?

我试图在Silverlight和WCF服务之间来回传递一些图像。 如果可能的话,我想传递一个System.Windows.Media.Imaging.BitmapImage ,因为这意味着客户端不必进行任何转换。 但是,在某些时候我需要将此图像存储在数据库中,这意味着图像表示必须能够转换为byte[]和从byte[]转换。 我可以通过将数组读入MemoryStream并使用BitmapImage.SetSource()从byte[]创建BitmapImage 。 但我似乎无法找到另一种方式转换 – 从BitmapImage到byte[] 。 我错过了一些明显的东西吗? 如果它有帮助,转换代码可以在服务器上运行,即它不需要是Silverlight安全的。

滚动X轴绘图区域 – Silverlight柱系列

我有一个柱系列图表,工作正常。 我有一个function,我需要添加到那,我希望horizo​​ntall滚动启用到绘图区域是x轴。 这是屏幕截图: 如果你看到屏幕截图我有六个项目,并且由于更多的项目,条形图非常薄,所以假设我有20个项目,那么条形图将根本不可见。 那么我们可以使X轴条水平滚动吗? 编辑 ResourceDictionary.xaml 在XAMl文件中:

c#using + XmlWriter.Create =“无法访问已关闭的流。”

为何如此有效: using (var ms = new MemoryStream()) { using (var dummy = new StreamWriter(ms)) { var sw = new StreamWriter(ms); sw.WriteLine(“Hello World”); sw.Flush(); using (StreamReader rdr = new StreamReader(ms)) { ms.Position = 0; textBoxExc.Text = rdr.ReadToEnd(); } } } 但这不起作用(“无法访问封闭的流。”):唯一的区别是var dummy = XmlWriter.Create(ms)而不是var dummy = new StreamWriter(ms) using (var ms = new MemoryStream()) { using […]

如何在Silverlight中为组单选按钮设置数据绑定?

Sliverlight提供了带有GroupName的单选按钮,可以将radiobutton与多个选项中的一个选项组合在一起。 就像是: 然后在VM中,我只有一个属性用于此选项,比如它是MyChoice public int MyChoice {get; set;} 那么如何在UI和VM之间为这种情况设置数据绑定?

可以举个例子,说明什么时候应该使用UIElement.UpdateLayout()?

我正在阅读MSDN中的这个UpdateLayout()方法 。 它说: 确保为布局正确更新此元素的所有可视子元素。 但我不明白布局没有正确更新是什么意思。 我已经使用Silverlight / WPF超过一年了,但我还没有使用过这种方法一次。 那么有人可以给我一个需要使用这种方法的例子吗? 所以我真的能理解它的作用以及何时使用它?

为Silverlight 5应用程序添加Coded UI支持时为什么无法加载System.Core?

我遇到以下问题: 尝试添加对Silverlight 5应用程序([MSDN] [1])的编码UI测试的支持。 第一步是在Silverlight 5项目中引用程序集Microsoft.VisualStudio.TestTools.UITest.Extension.SilverlightUIAutomationHelper.dll。 不幸的是,在添加引用之后,项目停止编译时出现了许多类似的错误: > Error 25 Cannot resolve reference assemblies. Please check the reference assemblies. Could not load file or assembly ‘System.Core, Version=5.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ….\ErrorReportDialog.xaml Looks like System.Core 5.0.5.0 fails […]

在C#/ Silverlight中,System.out.println()的等价物是什么?

我正在用C#和Silverlight开发一些项目。 我试图打印代码行以便调试,但Console.Write()似乎不起作用。 我创建了一个Silverlight应用程序,而不是Console.Write()确实有效的控制台应用程序。 如何在控制台或Silverlight应用程序项目的输出窗口中打印?

Windows Phone 7上的HashSet

Windows Phone 7上没有System.Collections.Generic.HashSet吗?