silverlight

Cannot find DataContractJsonSerializer in VS2010

自作多情 提交于 2019-12-22 06:26:20
问题 I am working on a demo Silverlight app and I'd like to do some simple JSON. I found the System.Runtime.Serialization.Json.DataContractJsonSerializer class on MSDN, but I can't seem to reference it successfully in Visual Studio 2010. I have added a reference to System.Runtime.Serialization , but I still get a compile error if I have a DataContractJsonSerializer (even with a fully qualified class name. My project is configured to Silverlight 4. The assembly does have a 2.0 version number when I

Cannot find DataContractJsonSerializer in VS2010

情到浓时终转凉″ 提交于 2019-12-22 06:26:07
问题 I am working on a demo Silverlight app and I'd like to do some simple JSON. I found the System.Runtime.Serialization.Json.DataContractJsonSerializer class on MSDN, but I can't seem to reference it successfully in Visual Studio 2010. I have added a reference to System.Runtime.Serialization , but I still get a compile error if I have a DataContractJsonSerializer (even with a fully qualified class name. My project is configured to Silverlight 4. The assembly does have a 2.0 version number when I

Silverlight Toolkit - Create a chart like Google realtime

这一生的挚爱 提交于 2019-12-22 05:41:10
问题 I want to create a chart that looks as much as possible like Google Realtime Timeline ideally it should support pan & zoom with dynamic labels for axes instead of clicking on links. Is there any way to do it? Thanks. 回答1: Sometimes it seems to me that writing blog posts take more time than writing the code. Here is the link to my implementation of this timeline control: http://vortexwolf.wordpress.com/2011/04/20/silverlight-timeline-chart/ Screenshot: Download the code at my post and write

Silverlight Toolkit - Create a chart like Google realtime

风流意气都作罢 提交于 2019-12-22 05:41:06
问题 I want to create a chart that looks as much as possible like Google Realtime Timeline ideally it should support pan & zoom with dynamic labels for axes instead of clicking on links. Is there any way to do it? Thanks. 回答1: Sometimes it seems to me that writing blog posts take more time than writing the code. Here is the link to my implementation of this timeline control: http://vortexwolf.wordpress.com/2011/04/20/silverlight-timeline-chart/ Screenshot: Download the code at my post and write

Can I get a byte[] from a BitmapImage in Silverlight?

a 夏天 提交于 2019-12-22 05:32:02
问题 I'm trying to pass some representation of an image back and forth between Silverlight and a WCF service. If possible I'd like to pass a System.Windows.Media.Imaging.BitmapImage , since that would mean the client doesn't have to do any conversion. However, at some point I need to store this image in a database, meaning the image representation must be able to convert to and from byte[] . I can create a BitmapImage from a byte[] by reading the array into a MemoryStream and using BitmapImage

Can I get a byte[] from a BitmapImage in Silverlight?

偶尔善良 提交于 2019-12-22 05:31:39
问题 I'm trying to pass some representation of an image back and forth between Silverlight and a WCF service. If possible I'd like to pass a System.Windows.Media.Imaging.BitmapImage , since that would mean the client doesn't have to do any conversion. However, at some point I need to store this image in a database, meaning the image representation must be able to convert to and from byte[] . I can create a BitmapImage from a byte[] by reading the array into a MemoryStream and using BitmapImage

Logging out of Facebook C# SDK on WP7

我的未来我决定 提交于 2019-12-22 05:18:25
问题 I am trying to add a feature for logging out, which is called in the click event of a ApplicationBarMenuItem, following the instructions on this blog This is what my code looks like: var oauth = new FacebookOAuthClient(); var logoutParameters = new Dictionary<string, object> { { "next", "http://www.facebook.com" } }; var logoutUrl = oauth.GetLogoutUrl(logoutParameters); LayoutRoot.Children.Add(FacebookLoginBrowser); FacebookLoginBrowser.Navigate(new Uri(logoutUrl.AbsoluteUri, UriKind.Absolute

How to make a dotted border on a Border element in Silverlight?

↘锁芯ラ 提交于 2019-12-22 04:54:05
问题 How can I make the bottom border of this Border Silverlight element have a red dotted inside of a red solid line? Border border = new Border(); border.CornerRadius = new CornerRadius(5); border.BorderThickness = new Thickness(0, 0, 0, 1); border.BorderBrush = new SolidColorBrush(Colors.Red); 回答1: Can you replace the border with a Grid and give it a Rectangle that fills the whole area? <Rectangle Stretch="Fill" RadiusX="10" RadiusY="10" StrokeDashArray="10, 2" Stroke="Black" Fill="White" />

Timer in Silverlight

青春壹個敷衍的年華 提交于 2019-12-22 04:45:29
问题 Is there another Timer object that can be used in Silverlight except for the System.Threading.Timer object? 回答1: Check out the DispatcherTimer: http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer(VS.95).aspx 回答2: storyboard is a timer too 来源: https://stackoverflow.com/questions/839875/timer-in-silverlight

Setting initial control focus in Silverlight

核能气质少年 提交于 2019-12-22 04:25:13
问题 I'm looking for a way to automatically set the initial focus on a Silverlight UserControl to a specific control. I have a login page with a user name textbox and I'd like to have it so that as soon as the user goes to the page their cursor is already positioned and waiting in the username textbox instead of having to make them click the box. I tried calling .Focus in the UserControl's Loaded event but with no success. Anyone know how to do this? 回答1: I whipped up a quick SL3 app and it is