silverlight-4.0

Why is the dictionary debug visualizer less useful in Visual Studio 2010 for Silverlight debugging?

馋奶兔 提交于 2019-12-18 05:45:12
问题 I was debugging in Visual Studio 2010, which we just installed and trying to look at a dictionary in the quick watch window. I see Keys and Values, but drilling into those shows the Count and Non-Public members, Non-Public members continues the trail and I never see the values in the dictionary. I can run test.Take(10) and see the values, but why should I have to do that. I don't have VS 2008 installed anymore to compare, but it seems that I could debug a dictionary much easier. Why is it

Silverlight 4: how to switch control visibility

浪尽此生 提交于 2019-12-18 04:14:48
问题 I am using MVVM in my Silverlight app. When control visibility is need to be managed by data, I am connecting its 'Visibility' property to object's corresponding property: XAML: <TextBlock Text="Price" Visibility="{Binding PriceVisibility, Mode=OneWay}"/> <TextBox Text="{Binding TicketPrice, Mode=TwoWay}" Visibility="{Binding PriceVisibility, Mode=OneWay}"/> CodeBehind (C#): public string PriceVisibility { get { return PriceVisible ? "Visible" : "Collapsed"; } } But from my perspective,

how to create Multiple user control that pointing single code behind file in silverlight 4

北战南征 提交于 2019-12-17 19:55:00
问题 I am creating a application, in which i have 2 user control, is it possible that, we have 2 xaml user control page and having 1 code behind xaml.cs file? 回答1: Start off by creating three files, first the "code-behind" .cs file is created as a simple class:- public class MyCommonUserControl : UserControl { } Note it has no InitializeComponent call. Now create a new UserControl then modify its xaml to look like this:- <local:MyCommonUserControl x:Class="YourApp.FirstMyCommonUserControl " xmlns=

Simple example of DispatcherHelper

自作多情 提交于 2019-12-17 19:46:16
问题 I'm trying to figure out how can I use DispatcherHelperftom MVVM light toolkit in SL, but I can't find any example. From home page of this framework I know that DispatcherHelper class, a lightweight class helping you to create multithreaded applications. But I don't know how to use it. How and for what I can use it? 回答1: You only need the DispatcherHelper when yo want to make changes to components on your UI thread, from code that runs on a different thread. E.g. in an Silverlight application

Why change from WPF to Silverlight 4?

拈花ヽ惹草 提交于 2019-12-17 18:49:00
问题 I'm working on an application we made WPF instead of Silverlight as we wanted a full blown desktop application with the whole unique feeling and advantages that gives. However, with the announcement of Silverlight 4 I hear there is a buzz about Silverlight mostly being the preferred choice also for desktop applications. So; why should I consider moving my WPF application to Silverlight 4 - given that I still want a desktop application? 回答1: Keep in mind that Silverlight 4 is currently in Beta

Windows Phone 7: Highlight Selected Listbox item

与世无争的帅哥 提交于 2019-12-17 16:27:41
问题 I have the following XAML (simple list box with custom DataTemplate). I'm trying to figure out how to highlight the selected item (maybe background colour change). I figure I need to do something with Styles in Expression Blend but I'm not quite sure where to start... Edit: After a bit of playing around I now have this (which doesn't seem to do anything) <phone:PhoneApplicationPage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx

Best way to read through xml

China☆狼群 提交于 2019-12-17 15:56:10
问题 HI I have a xml document like this: <Students> <student name="A" class="1"/> <student name="B"class="2"/> <student name="c" class="3"/> </Students> I want to use XmlReader to read through this xml and return a list of students as List<student> . I know this can be achieved as follows: List<Student> students = new List<Student>(); XmlReader reader = XmlReader.Create("AppManifest.xml"); while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element && reader.Name == "student") { students

The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range?

余生颓废 提交于 2019-12-17 09:38:41
问题 I am working on application contains a datepicker and if I set the time in that picker to a very old value or far in the future when I try to save this value in the database the server throw this exception, what is the cause of it? The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. The statement has been terminated. 回答1: DateTime has the range: January 1, 1753, through December 31, 9999 DateTime2 has the range: 0001-01-01 through 9999-12-31 So

Silverlight 4 OOB application access HTML DOM of the page in WebBrowser control

我怕爱的太早我们不能终老 提交于 2019-12-14 03:57:22
问题 Does anybody know if it is possible to access and manipulate an element in the html page that is rendered by the Silverlight 4 WebBrowser control. The scenario is like this. The user launches a Silverlight OOB application with elevated trust. The user manipulates some data in the application but must submit part of the data to an external web site. If I open the external site in a WebBrowser control, is there any way I can assist the user by pre filling some information in the external sites'

Multi Room Chat Application using SilverLight 4.0 and PollingDuplex

安稳与你 提交于 2019-12-14 03:16:44
问题 I'm looking for a sample or guidelines to build a multi room chat application using SL 4.0 and PollingDuplex. Any help ? 回答1: Dan Wahlin did a great article on this topic: http://weblogs.asp.net/dwahlin/archive/2008/06/16/pushing-data-to-a-silverlight-client-with-wcf-duplex-service-part-i.aspx http://weblogs.asp.net/dwahlin/archive/2008/06/19/pushing-data-to-a-silverlight-client-with-a-wcf-duplex-service-part-ii.aspx On SilverlightTV you can watch an episode about Silverlight 4.0 and Duplex