silverlight-4.0

Silverlight ValidatesOnException default message localization

烂漫一生 提交于 2019-12-21 11:54:56
问题 In my silverlight 4 MVVM application, i can switch languages during runtime : public void SetLanguage(string language) { var culture = new CultureInfo(language); Thread.CurrentThread.CurrentUICulture = culture; Thread.CurrentThread.CurrentCulture = culture; // ... } For the inputs, i just added "ValidatesOnException=true" in case of conversion problems and it does the job. But the default exception message is in the culture of my OS and not in the manually chosen one. In this thread on

How can I get Silverlight 4 Tools to work in Web Developer 2010 Express?

我只是一个虾纸丫 提交于 2019-12-21 07:11:59
问题 I installed Windows 7 . I then installed Web Developer 2010 Express from here with the Web Platform Installer . I then installed the the April 15 release of Silverlight 4 Toolkit from here. I then added this reference : alt text http://www.deviantsart.com/upload/ijk0lm.png Then in my XAML, I reference it like this but it gives me no intellisense and tells me that I am missing an assembly reference : alt text http://www.deviantsart.com/upload/cd4vrj.png update: xmlns:tk="clr-namespace:System

Silverlight Toolkit ; Pie Chart Colors

不问归期 提交于 2019-12-21 05:22:17
问题 I have a huge problem that I can't figure out. Let's say that I have five different fruits, and I want each of them to be associated with a certain color. Let's say that I have three "baskets" which contain zero or more of said fruits. When I Make Pie charts for my three baskets, Each wedge is just some random color that is presumable picked by the control. How would I say, make the blueberries blue, bannanas yellow, etc. in the chart? I know this is a weird question, but I can't think of a

Attach behaviour to all TextBoxes in Silverlight

时间秒杀一切 提交于 2019-12-21 04:54:15
问题 Is it possible to attach behavior to all TextBoxes in Silverlight application? I need to add simple functionality to all text boxes. (select all text on focus event) void Target_GotFocus(object sender, System.Windows.RoutedEventArgs e) { Target.SelectAll(); } 回答1: You can override the default style for TextBoxes in your app. Then in this style, you can use some approach to apply a behavior with a setter (generally using attached properties). It would something like this: <Application

Calculate distance between two points in bing maps

眉间皱痕 提交于 2019-12-21 03:10:08
问题 Ihave a bing map, and a two points : Point1,Point2 and i want to calculate the distance between these two points? is that possible? and if i want to put a circle on the two third of the path between point1 and point2 and near point2 ...how can i make it? 回答1: See Haversine or even better the Vincenty formula how to solve this problem. The following code uses haversines way to get the distance: public double GetDistanceBetweenPoints(double lat1, double long1, double lat2, double long2) {

Silverlight HttpWebRequest.Create hangs inside async block

可紊 提交于 2019-12-20 21:46:52
问题 I am trying to prototype a Rpc Call to a JBOSS webserver from Silverlight (4). I have written the code and it is working in a console application - so I know that Jboss is responding to the web request. Porting it to silverlight 4, is causing issues: let uri = new Uri(queryUrl) // this is the line that hangs let request : HttpWebRequest = downcast WebRequest.Create(uri) request.Method <- httpMethod; request.ContentType <- contentType It may be a sandbox issue, as my silverlight is being

What are the pitfalls of using .NET RIA Services in Silverlight?

为君一笑 提交于 2019-12-20 19:36:20
问题 Silverlight can use WCF, Web Services, REST based services, .NET RIA Services, but it seems like Silverlight and .NET RIA Services are preferred most. I want to know if there are any common issues [which can be a show stopper if one goes ahead with this combo] that you have seen in practical implementation of SL with .NET RIA Services. Thanks, Rahul 回答1: Working with metadata (and writing it by yourself) is really pain in the ass. Especially when you need to update your model. RIA tutorial

Non breaking space in XAML vs. code

…衆ロ難τιáo~ 提交于 2019-12-20 17:32:30
问题 This works fine, and correctly inserts non-breaking spaces into the string: <TextBlock Text="Non Breaking Text Here"></TextBlock> But what I really need is to replace spaces with non-breaking spaces during data binding. So I wrote a simple value converter that replaces spaces with "   ". It does indeed replace spaces with "   " but "   " is displayed literally instead of showing as a non-breaking space. This is my converter: public class SpaceToNbspConverter : IValueConverter { #region

weird error with RIA Services “code generator encoutered a fatal exception”

牧云@^-^@ 提交于 2019-12-20 14:13:10
问题 This is the second time that I have this really weird problem with WCF RIA Services! the sad thing is that I had to solve the problem twice, going through the different hoops again :(, even though I've left a note to myself pointing to the solution :P Anyways, the "pretty useful" error message is the following: ...\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(304,5): error : The code generator 'Microsoft.ServiceModel.DomainServices.Tools.CSharpCodeDomClientCodeGenerator'

Silverlight 4 Default Button Service

限于喜欢 提交于 2019-12-20 10:54:34
问题 For a few months I have been successfully using David Justices Default Button example in my SL 3 app. This approach is based on an attached property. After upgrading to SL4, the approach no longer works, and I get a XAML exception: Unknown parser error: Scanner 2148474880 Has anyone succesfully used this (or any other) default button attached behaviours in SL4? Is there any other way to achieve default button behaviour in SL4 with the new classes that are available? Thanks, Mark 回答1: I