silverlight

Binding Observable collection

I have a collection in the main window and I want to show it on a grid in a user Control, What is the right MVVM way to do that ? I've done an observableCollection in the MainWindow And bounded it to an observableCollection in the usercontrol. and in the user control the grid is bounded to the collection. it doesn't work :( /// <su...

Locking an OData DataServiceContext when calling from multiple BackgroundWorkers

I have a Silverlight 4 application that connects to an OData service. My model is submitting multiple queries to the service in parallel and in the query callback I am processing the results using a backgroundworker. This works great if I am making one call, but as soon as I make more than one call in parallel - sometimes it works - bu...

What kind of problems upgrading Silverlight from v3 to v4

We are contemplating building an upcoming project in Silverlight. We would be developing this in SL 4, not 3, but another developer in our organization had the experience of upgrading from v2 to v3 in the middle of a project, and losing features and functionality that MS didn't include in v3. This was some headache for him, working aro...

Make Visual Studio ignore exceptions?

I'm using exceptions to validate a control's input in Silverlight 4. When I throw an invalid input exception, VS 2010 displays the popup and stops the program. I ignore this and resume the program, and everything continues fine (since the exception is used to signal a validation error.) Is there a way to mark that one exception as ignore...

User-friendly way to enter a list in Silverlight 4?

I have an app where users will enter lists of names. (There is some collection of valid names.) I'm not sure what the most user-friendly way to do this is. One idea: Make a text box. If the text box loses focus, and the contents are a valid name, add it to a list box. If the user selects an entry in the list box and hits delete, remove ...

How to make a Silverlight app take up the entire browser width/height?

I have a page that is just an ASP-hosted Silverlight 4 object. I would like it to take up the full width and height of the browser, but it is not - it is too small, in a corner. Where can I adjust this? I'm new to Silverlight. Thanks for the help. Edit: Here is the .xaml: <UserControl x:Class="ExpenseCalc_SilverLight.MainPage" xml...

Silverlight Data Binding

I'm writing an app where users enter records. I have a class that represents a record. Binding it to text fields works. MainPage.xaml.cs: public MainPage() { InitializeComponent(); // newExpense is of type ExpenseInfo LayoutRoot.DataContext = newExpense; } ExpenseInfo.cs: public class ExpenseInfo...

Given a VS solution, how can I add the Silverlight control it implements to my project?

I'm trying to add this Silverlight 4 control to my project. I went to the downloads page, and it's full of VS solutions/projects/.cs files. I'm new to Silverlight, and I don't really know how to get the control from that. Help? Update: I tried following roufamatic's instructions. At this point, I was still unsure how to use the control,...

Wait for the response to be fully received

I have a Windows Phone 7 application (Silverlight-based) that sends a web request and receives a web response. It works fine - I am using BeginGetReponse and an AsyncCallback to call EndGetResponse. However, I need to wait for the response to be fully received, so that I can fill a collection with the data from the response. What woul...

Silverlight 4 WCF or RIA services

Hello I'm very new to silverlight and I'm thikning which way to go. I'm in planning phase of my new project which should be built on silverlight. The problem is that I want to have my own DAL -> BLL on server side, and WCF service, which will talk to Silverlight should be consumable by other applications too, including other technologie...

Silverlight/WPF parenthetical value syntax in a Storyboard animation

Somehow in my WPF studies, this detail has escaped me. I've seen syntax of this sort: <UserControl.Resources> <Storyboard x:Name="myStoryboard"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" ... > ... Why is the StoryBoard.TargetProperty value surrounded by parentheses? What does that mea...

Background buffer music in Silverlight

I'm making a game in Silverlight, and I'd like to give it some background music. And in particular I'd like to avoid including the MP3 in the initial download (the XAP) - so that the user can start playing before the music has finished downloading. How do I: Dynamically start playing an MP3 file from a given URL Have the MP3 file star...

Finding the Bound property, from a UIelement, after it has been bound.

Case: public class customer { public string Adress { get; set; } } Xaml: <Grid x:Name="LayoutRoot" Background="White" > <StackPanel> <TextBox Text="{Binding Adress}"/> </StackPanel> </Grid> .cs public MainPage() { InitializeComponent(); LayoutRoot.DataContext = new customer() { Adress = "So...

Silverlight 4: Trouble with Value Converters

I'm trying to use a value converter. However, VS is complaining about this XAML: <Grid x:Name="LayoutRoot" Background="White" Height="Auto" Width="Auto"> <Grid.Resources> <local:DateFormatter x:Key="FormatConverter" /> </Grid.Resources> The error: The type 'local:DateFormatter' was not found. Verify that you are not ...

Animating same property from mutually exclusive VisualStateGroups

My question is simply: is it even possible? Suppose I want to style a ListBoxItem such that it has a black foreground by default, blue when selected, and red when the mouse is over it. I ended up with something like this: <!-- assume the default foreground color is black --> <ControlTemplate TargetType="ListBoxItem"> <Grid Backgrou...

Silverlight or browser losing cookies on hyperlinked windows?

Am using Silverlight 4 hosted in an ASP.NET MVC page, e.g. ht tp://test.mysite.com/main. I make a call to the server from Silverlight using WCF and get some values back. One of these values I write as a cookie using: HtmlPage.Document.SetProperty("cookie", newCookie); I can then view the cookie text using: MessageBox.Show(HtmlPage.Do...

How do you make a Sketchflow app stretch to fit the PlayerWindow?

In normal Silverlight apps if the root element is stretched (horizontally ad vertically) it will take up the entire Silverlight browser object. With a Sketchflow application the root visual is a Microsoft.Expression.Prototyping.Workspace.PlayerWindow and your screens are dynamically displayed within a frame on the right side. As sho...

InvalidCastException from windows phone 7 talking to a .asmx web service

I have a .NET 2.0 .asmx web service that looks something like this: [WebMethod] [return: XmlArray("FileInformations"), XmlArrayItem("FileInformation")] public FileInformation[] GetFileInformation( [XmlElement("Path")] string path) When I try to call this web service from a silverlight windows phone 7 app (beta). I get an Inva...

Deployment of Silverlight RIA Services Application

Testing on local Web Development Server and running the application in shared hosting environment differs a lot. What are the best steps to deploy a Silverlight RIA Services Application on a shared hosting environment? ...

Error Handling in Silverlight Applications

How is the best way to handle any occuring errors in a Sivlerlight application? I am not talking about error handling in a development environment. But what would be the best way to log errors and look them up for fute reference? ...