silverlight

Good Async pattern for sequential WebClient requests

Most of the code I've written in .NET to make REST calls have been synchronous. Since Silverlight on Windows Phone only supports Async WebClient and HttpWebRequest calls, I was wondering what a good async pattern is for a Class that exposes methods that make REST calls. For example, I have an app that needs to do the following. Login ...

How can I unattach an element from another element in the XAML tree?

In my Silverlight application, I load all the images I need at application start and store them in a dictionary. Then as I need them I pick them out of the dictionary and attach them in XAML trees etc. However, I have the problem that if I attach an Image object to a Grid, then want to use that image again, it tells me: The image e...

Isolated Storage, OOB, and Removing the App

What happens to the files created by Isolated Storage when the OOB app is removed? Do they remain or are the files also deleted? From what I can deduct the files would be maintained so they can be accessed by the same app in browser. Right? ...

Shared WCF client code between .NET and Silverlight apps?

I'm developing a .NET application that will have both a WinForms and a Silverlight client. Although the majority of code will be in the server, I'll need to have quite a bit of logic in the clients as well, and I would like to keep the client library code the same. From what I could figure out so far, I need to have two different proj...

How to handle 30k files in a project which requires them?

Visual Studio 2010 RC -> Silverlight Application We have a library of images that we need to have access to. They are given to us from a vendor (through an installer) and they are not in a database, they are files in a folder (a very large monster of a folder). We do not control when the images change, so the vendor needs to be able t...

Why am I getting ProtocolViolationException when trying to use HttpWebRequest?

I've no idea. I'm trying to get XML from a REST service on an app I'm building for Windows Phone. I always get an exception at the following line: HttpWebResponse response = request.EndGetResponse(ar) as HttpWebResponse; I have the following setup (ignore the bad url, it's just an example .. ) HttpWebRequest request = WebRequest.Crea...

Silverlight performance with a large number of Objects Org Chart.

Hello, I’m working on a org chart project(SL 3) and I’m seeing the UI thread hang when the chart is building around 2,000 nodes and when it renders it takes about a min and then FPS drop to a crawl. Here is the code flow. Page.xaml.cs calls a wcf service that returns a list of AD users. Then we use Linq to build a collection of nodes...

Cannot play local WMV in silverlight MediElement

Hello, I am trying to play a video in WMV format in a silverlight MediaElement. <StackPanel> <Grid x:Name="LayoutRoot"> <MediaElement x:Name="media" Source="Bounce.wmv" Width="300" Height="300" AutoPlay="True" /> </Grid> </StackPanel> This does nothiing.. but if I change the source attribute to point to some W...

How do I base a style on a Silverlight toolkit theme style

I've being trying to add a theme from the Silverlight toolkit to a project. In the project there are a number of existing styles used in the layout. The problem is when any control has an explict style applied to it does not receive any attributes of the style from the theme. In WPF I would use something like BasedOn={StaticResource {x...

Can Silverlight (SLOOB) start a process even with full trust?

I have been tasked with writing an installer with a silverlight out of browser application. I need to. get the version off a local EXE check a web service to see that it is the most recent version download a zip if not unpack the zip overwrite the old EXE start the EXE This installer app is written in .NET WinForms now but the .NET ...

How to get the height of an Image in Silverlight?

I have this code in Silverlight: Image image = new Image(); BitmapImage bitmapImage= TheDatasourceManager.GetBitmapImage("blackPencil"); image.Source = bitmapImage; image.Stretch = Stretch.None; image.HorizontalAlignment = HorizontalAlignment.Left; image.VerticalAlignment = VerticalAlignment.Top; image.Margin = new Thickness(88, 88, 0, ...

What are the security implications of making a clientaccesspolicy proxy workaround?

I wanted to use published GoogleDocs documents and twitter tweets as the datasource of a Silverlight application but ran into clientaccesspolicy issues. I read many articles like this and this about how difficult it is to get around the clientaccesspolicy issue. So I wrote this CURL script and put it on my PHP site and now I can get th...

Silverlight MVVM binding seems not to work

Hi everybody! Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't understand. Having a WPF background i don't know what is going on here: ViewModel has several properties, in which one is called SelectedRecord. This is a get only property and is defined like this: public Culture SelectedRecord { ...

How do you fix the Silverlight application shift that occurs in the Firefox browser?

Hi, Currently I have an Silverlight application that when run on Firefox browser (ver 3.6) the entire contents of the Silverlight application shifts a little, and also the scrollbars on both the bottom and the side appear when I first use it. This does not happen in IE 8. How can I fix this in Firefox so it doesn't happen? The projec...

Windows Phone 7 Connect to SharePoint via SOAP

I am making my second application for the Windows 7 Phone Series platform and I cannot seem to connect to a SharePoint server using https. 99% of the following is not my code. I have borrowed it from http://blog.daisley-harrison.com/blog/post/Practical-Silverlight-and-SharePoint-Integration-Part-Two.aspx untill I can further understand...

Windows Phone - OnNavigatingFrom - problem

I believe this is just a problem for me, due to my lack of programming ability. I am currently exploring transitions between page navigation with Windows Phone apps. I was originally using storyboards, and completed event handlers to have my pages animate on and off screen. These leads to the a problem when you want to navigate to man...

How can a silverlight app download and play an mp3 file from a URL?

I have a small Silverlight app which downloads all of the images and text it needs from a URL, like this: if (dataItem.Kind == DataItemKind.BitmapImage) { WebClient webClientBitmapImageLoader = new WebClient(); webClientBitmapImageLoader.OpenReadCompleted += new OpenReadCompletedEventHandler(webClientBitmapImageLoader_OpenReadCo...

How to customize and reuse a DataGridColumnHeader style?

Hi all, I'm trying to customize the column headers of a DataGrid to show sub-column headers as in the following screenshot: I've made a style for 2 sub-column as in the following XAML: <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:data="clr...

silverlight and spring.net

can i use both silverlight and spring.net in the same web based project ...

Does this MSDN article violate MVVM?

This may be old news but back in March 2009, this article, “Model-View-ViewModel In Silverlight 2 Apps,” has a code sample that includes DataServiceEntityBase: // COPIED FROM SILVERLIGHTCONTRIB Project for simplicity /// <summary> /// Base class for DataService Data Contract classes to implement /// base functionality that is needed l...