silverlight

Async actions inside Silverlight Method - returning the value

What is the proper way to call an Async framework component - wait for an answer and then return the value. AKA contain the entire request/response in a single method. Example code: public class Experiment { public Experiment() { } public string GetSomeString() { WebClient wc = new We...

Silverlight 4RC threading - can a new Thread return the UI Thread

Hi all, Let's say I have a situation in Silverlight where there is a background thread (guaranteed to NOT be the UI thread) doing some work and it needs to create a new thread. Something like this: //running in a background thread Thread t = new Thread(new ThreadStart(delegate{}); t.Start(); Lets also say that the UI thread at this p...

Asynchronous Silverlight WCF callback

I've created my own WCF service and I've successfully been able to talk to it via my Silverlight client. I ran into an interesting problem on my asynchronous callbacks though. When my callback is invoked, I can't update any UI controls with the dreaded invalid cross thread access Here's what my callback function looks like private ...

fxcop for silverlight code analysis - .net 3.5

Is there anyway I can run static code analysis using fxcop for silverlight code in .net 3.5 I found this article as well as a tool XAMLToolkit These are targetted towards .net 4.0 though! ...

Is it possible to include external dlls in a silverlight project, that weren't built for silverlight?

We're trying to work out a deployment strategy for an internal tool that we're creating. It's a control that uses a set of 3rd party libraries to communication with a specific type of server. So I have a class library built that uses these libraries. I was looking to deploy a silverlight application that uses our library, which in turn...

How to Disable the up and Down arrow keys for a silverlight listbox?

Hi, I want to disable the navigation on press of UP and Down arrow keys in Silverlight. I tried with a case statement: void lisBox_KeyUp(object sender, System.Windows.Input.KeyEventArgs e) { int numberofItems = lisBox.Items.Count-1; Keys key = (Keys)e.Key; switch (key) { case Keys.LEFT...

c# copy constructor generator

I want to copy values from one object to another object. Something similar to pass by value but with assignment. For example: PushPin newValPushPin = oldPushPin; //I want to break the reference here. I was told to write a copy constructor for this. But this class has a lot of properties, it will probably take an hour to write a copy ...

What's a good resource for learning about the MVVM pattern?

I've recently joined a new team that uses the MVVM pattern with Silverlight 3. Can anyone recommend a good resource for learning about this pattern? Thanks, E ...

Is there any convinient way that i can deepclone 'style' instance in silverlight?

if a style is used, it can not be modified agaign. so i need a clone method. but its hard to implement. what i want to do is implementing a cascading 'style' mechanism. for example, i set two style to the same frameworkelement. the same property of latter style will override the former one, while the different property remain unchanged....

Entity Framework Model with inheritance and RIA Services

Hi, We have an entity framework model with has some inheritance in it. The following example is not the actuall model, but just to make my point... Let's say Base class: Person Child classes: Employee, Customer The database has been generated, the DomainService has been created and we can get to the data: lstCustomers.ItemsSource ...

Is it possible to access a Silverlight control via the COM automation model?

What I'm trying to attempt is to access methods on a Silverlight control via the COM automation model. Theoretically it should be possible, as exposing the Silverlight control's methods as scriptable members exposes them through an IDispatch interface. I have been able to access the IDispatch interface through the automation model corr...

Missing Siverlight templates in Visual Studio 2008

Hello ! I have Visual Studio 2008 (sp1, .NET 3.5). I have installed Silverlight 3 SDK and Silverlight 4 SDK beta + Sivelrlight toolkit. I also have installed Windows Phone Developer Tools CTP that includes Visual Studio 2010 Express for Windows Phone CTP. I have noticed that when i start a new project in VS2008 all the Silverlight temp...

RIA Services versus WCF services: what is a difference

There are a lot of information how to build Silverlight application using .NET RIA services, but it isn't clear what is unique thing in RIA that is absent in WCF? Here are few topics that are talking around this topic: http://stackoverflow.com/questions/1647225/ria-services-versus-wcf-services http://stackoverflow.com/questions/945123/n...

Silverlight getting opened site

Hi Let's say I have a MainPage that has a button. I also have another page(Page2) that has a textbox. I woud like to add a simple text "TEXT" to the textbox in Page2 while navigating by the button from MainPage. I have a problem with getting actually opened Site. In Windows Forms applications it is solved by: Page2 page2 = (Page2)Appl...

Silverlight and RIA Services - The Data sources window does not show anything

Hi, So following some of the examples out there I created a new Silverlight Navigation application with RIA services enabled. Built the entity model, added a domain service and tested whether or not I could get some data to the client. This works fine. But many of the examples show off how they use the Data Sources window to simply drag...

RIA Services: custom autorization

Here is a good example how to create custom autorization for RIA services: http://stackoverflow.com/questions/1195326/ria-services-how-can-i-create-custom-authentication In my case a silverlight-pages will be displayed as a part of HTML-content and user authorisation is already implemented on the server-side (ASP.NET Membership is not u...

Client-side framework for web-app with good audio support

I'm trying to create a client-side web app that generates music procedurally using some user-input parameters, so I'm looking for a framework (e.g. Flash, Silverlight etc.) that has the capability to play audio at a specified pitch. Whether it is playing a WAV/MP3 file, using MIDI output, or just playing beeps doesn't really matter -- I ...

Client WCF DataContract has empty/null values from service

I have a simple WCF service that returns the time from the server. I've confirmed that data is being sent by checking with Fiddler. Here's the result object xml that my service sends. <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; <s:Body> <GetTimeResponse xmlns="http://tempuri.org/"&gt; ...

Passing parameters into ViewModels (Prism)

Hi I can't figure out how to pass parameters to my viewmodels from other views or viewmodels. For instance, I have a View called Customers. There is a grid inside, and if you double-click the grid, a new view is supposed to come up and allow you to edit that customer's data. But how will the View(Model) responsible for editing data kno...

Import and render the contents of a XAML file inline in another XAML file?

I have a XAML file that I exported from Expression Design. I would like to render that XAML content inline in one of my user controls. Can I reference the external XAML file that I want to include as a Resource on the UserControl I want to render it in? Or is there some other markup that I can use to identify the XAML object in my pro...