silverlight-2.0

Custom Rendering in Bing Silverlight Control

你说的曾经没有我的故事 提交于 2019-12-01 09:22:49
问题 I'm ramping up on a Silverlight 2 project that leverages the Bing Maps control. One thing our UX guys are wondering is whether it is possible to customize the look of the map completely. For example, draw countries as simple outlines with different color interiors. Or draw the ocean as white and countries as black dotted shapes. Does anyone know whether it is possible to achieve this level of customization? The MapMode class looked promising, but it doesn't seem to quite give me what I need.

Is there a notification mechanism for when a dependency property has changed?

。_饼干妹妹 提交于 2019-12-01 09:15:18
问题 In a Silverlight application I'm trying to find out when a property on a usercontrol has changed. I'm interested in one particular DependencyProperty, but unfortunately the control itself doesn't implement INotifyPropertyChanged. Is there any other way of determining if the value has changed? 回答1: In WPF you have DependencyPropertyDescriptor.AddValueChanged, but unfortunately in Silverlight there's no such thing. So the answer is no. Maybe if you explain what are you trying to do you can

How to convert DateTime from JSON to C#? [duplicate]

被刻印的时光 ゝ 提交于 2019-11-30 03:19:24
Possible Duplicate: How to convert UNIX timestamp to DateTime and vice versa? I've got the following class: [DataContractAttribute] public class TestClass { [DataMemberAttribute] public DateTime MyDateTime { get; set; } } Here's the JSON: { "MyDateTime":"1221818565" } The JSON is being returned from a PHP webservice. What I need to do, is convert that epoch string into a valid C# DateTime. What's the best way of doing this? I can do this: [IgnoreDataMemberAttribute] public DateTime MyDateTime { get; set; } [DataMemberAttribute(Name = "MyDateTime")] public Int32 MyDateTimeTicks { get { return

Start Storyboard When Text Changes

那年仲夏 提交于 2019-11-30 00:09:57
问题 I have a TextBlock bound to a property on my view model. I have a StoryBoard with fades the text in and out using the Opacity property. I am using this text to give the user feedback after they have performed an operation(success, error etc). How can I start the StoryBoard when the property changes from my view model? Is there a better way to do this sort of effect? 回答1: Sorry, I hate to tell it to you - but you're thinking about it wrong. Don't think in storyboards, Opacity and Visiblity

Highlight entire rows only in Silverlight DataGrid

筅森魡賤 提交于 2019-11-29 12:25:31
问题 When the user clicks on a row in the datagrid (or uses the keyboard), that row is selected, but the specific cell they clicked on is also given its own special focus. This is fine for a data editing grid, but I am trying to create something more like an open dialog that shows properties for each item in the list, so... Is it possible to configure a (readonly) DataGrid so that the user can only select or focus on entire rows, not individual fields. If that is not possible, is there a elegant

How to convert DateTime from JSON to C#? [duplicate]

淺唱寂寞╮ 提交于 2019-11-28 22:47:25
问题 Possible Duplicate: How to convert UNIX timestamp to DateTime and vice versa? I've got the following class: [DataContractAttribute] public class TestClass { [DataMemberAttribute] public DateTime MyDateTime { get; set; } } Here's the JSON: { "MyDateTime":"1221818565" } The JSON is being returned from a PHP webservice. What I need to do, is convert that epoch string into a valid C# DateTime. What's the best way of doing this? I can do this: [IgnoreDataMemberAttribute] public DateTime MyDateTime

How can I use non-Silverlight assemblies in a Silverlight app?

旧街凉风 提交于 2019-11-28 09:13:42
I'm working an project (pure hobby, "Sharping my skills") which has one unified back-end and multiple front-ends (ASP.NET MVC 1.0/JQuery and Silverlight 2). When I try to add reference to my business layer assembly in the Silverlight 2 project (VS2008); It gets rejected, because it's not a Silverlight assembly. Is their a way to include and reference a non-Silverlight assembly in a Silverlight app? No there is not. Silverlight runs on a completely different CLR which is incompatible with the normal (desktop) CLR. It has an underlying different set of APIs in the BCL and most importantly a

Convert WPF Application to SilverLight

浪子不回头ぞ 提交于 2019-11-28 06:27:48
Is it possible to convert an existing WPF Application to SilverLight automatically/with minimal effort? Bogdan Maxim Not really. I have found some articles regarding the multi-targeting option for WPF and Silverlight at the same time. At this moment, if you are not using PRISM , it is quite a challenge to target both of them, fortunately achievable. What do you need to have in mind is that Silverlight uses a smaller (thus more limited) library than WPF. In response to the comments: Actually, there is already support for silverlight in PRISM ( v2 ). The idea of PRISM is to provide guidance to

Silverlight 3 - Data Binding Position of a rectangle on a canvas

天涯浪子 提交于 2019-11-28 04:44:56
问题 I am currently trying to bind a collection of objects to a Canvas in Silverlight 3 using an ItemsControl as below: <ItemsControl x:Name="ctrl" ItemsSource="{Binding myObjectsCollection}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas></Canvas> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Rectangle Stroke="LightGray" Fill="Black" StrokeThickness="2" RadiusX="15" RadiusY="15" Canvas.Left="{Binding XAxis}" Height="25" Width="25"> <

Can Silverlight initiate Page Refreshes?

佐手、 提交于 2019-11-27 22:01:18
UPDATE: An alternative title for this could be: How do I call javascript from my silverlight 2.0 application. Here is a quick question for all you Silverlight gurus. I have a Silverlight app that displays a stopwatch countdown. The app is hosted in an ASP.Net web application, What I want it to do is when the stopwatch hits zero, the app forces a server page refresh of the hosting page. Is this possible? If so, any chance of a code snippet? Patrick McDonald Apparently you can call a JS script from Silverlight using HtmlPage.Window.CreateInstance or HtmlPage.Window.Invoke The JavaScript to