silverlight

WCF Callback Contract InvalidOperationException: Collection has been modified

We are using a WCF service with a Callback contract. Communication is Asynchronous. The service contract is defined as: [ServiceContract(Namespace = "Silverlight", CallbackContract = typeof(ISessionClient),SessionMode = SessionMode.Allowed)] public interface ISessionService With a method: [OperationContract(IsOneWay = true)] vo...

Is there any version problem in Silverlight 3 beta?

I have deployed website using silverlight 3.0.40307.0. It is working perfectly in Local IIS. But when client will installs the newer version of silverlight like 3.0.40626 or higher, It wan't be able to view website. How to get silverlight 3.0.40307 (old version of 3.0 beta)? What is the possible solution to deploy silverlight website o...

Silverlight - Crud Insert failing unexpectedly?!

Hello! I have a project setup - it is a Silverlight Client Application hosted in an ASP.Net site. It has an ADO.Net Entity Framework to communicate with an SQL Server Database and an ADO.Net Data Service for communication. I am having some trouble getting my Asynchronous CRUD Silverlight Insert to work on my database. The first method fi...

Sending contained object over RIA Services

I have class like this: public class object { [Key] int number; String mystring; OtherObject anotherobject; } WHen i sent this over RIA my silverlight application can see object.number and object.mystring, but not object.anotherobject!!! What should i do?? Please help me. ...

Programmatically show expand arrow on Silverlight TreeView

I have a Silverlight TreeView control that I'm dynamically populating when a specific node is clicked. For example, I load the first generation (level) of nodes, then when the user clicks on one of the nodes, I use the Selected event to populate that node's children, etc, etc. I'm sending back from my database a bool value with each no...

Silverlight Canvas children collection changed

Is there a way to Catch if the childrencollection of a canvas in Silverlight has changed? (when a child is added or removed) I know the ObservableCollection has such an event, how could i rase one for my Canvas? ...

Binding to Transforms in a ControlTemplate

I'm trying to create a custom control in Silverlight that dynamically scales an element in it's ControlTemplate. First attempt of the ControlTemplate looks something like this: <ControlTemplate TargetType="controls:ProgressBar"> <Grid> <Rectangle x:Name="TrackPart" Fill="{TemplateBinding Background}" HorizontalAlignment="Left"...

Is it possible to include Xaml resouces in a ControlTemplate?

I'm working on a Silverlight templated control (i.e. it derives from Control and has its look implemented as a ControlTemplate in generic.xaml) and came across the need for a ValueConverter in one of my bindings. Normally I'd just create an instance of the ValueConverter in the Resources of the control working with but I can't figure ou...

Does ninject-contrib support Silverlight?

I'm building a Silverlight application with Prism, and we'd like to use NInject. I've downloaded ninject-contrib to use their NInject bootstrapper, but it doesn't appear to build a Silverlight assembly. I compiled it myself to Silverlight, but it crashes Visual Studio. Has anyone already ported ninject-contrib to Silverlight success...

Can't get data when adding a public read only member at serverside by linq

I have a entity Person. at server side, take EF as DAL. then I extend this entity by adding a read only member: [DataMember] public decimal AccountBalance { get { using (MyEntities ctx = new MyEntities()) { return 123.45M; } } } Client side get the date by ria service by public IQueryable<Pers...

What's a good way to parameterize a ValueConverter used in a ControlTemplate?

A templated control I'm working on uses a ValueConverter like so: <ListBox> <ListBox.Resources> <Controls:CodeDescriptionValueConverter x:Key="CodeDescriptionValueConverter"/> </ListBox.Resources> <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Converter={StaticResource CodeDescriptionValueC...

RIA Services - Getting DataContext in a List item

I'm looking for a workaround for my RIA Services project, which has a Listbox with the Listitems as a user control defined as an ItemTemplate, like this: <ListBox x:Name="lstMain"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <foo:ListItemDetail /> </StackPanel> </DataT...

In Silverlight 3.0, can I create a data template in an external file that includes a reference to an event handler?

Is it possible to include an event handler reference in a data template that is not associated with the code-behind where the event handler is defined? I'm getting a PARSER-BAD-PROPERTY-VALUE when trying to pull this off. For example, let's say I have this very simple XAML. page.xaml <DataTemplate x:Key="ItemsTemplate"> <Hyperli...

How to do Silverlight Validation in a web service

I am currently trying to implement the built-in Silverlight 3 validation against objects that are accessed via a web service. I have tried to follow the examples listed on SilverLight.net (Jesse Liberty's tutorial) and have had no luck. In fact, I could not get the tutorial to work after I downloaded it unless I started it without debu...

Trouble importing third party modules when hosting IronPython in SL.

I am hosting Python in a SL app. Basically i have an attached property that lets you pass Python script which then gets executed on the lost focus event of the element. The IPY integration works fine as long as I don't need any 3rd party imports. I copied the formencode package to the site-packages folder under Program Files\Iron Python...

.NET RIA Services and Custom Data Model - CRUD Capabilities

I would like to ".NET RIA Service"-enable my custom data model (BLL/DAL). Are there interfaces I have to implement to enable this functionality or all I have to do is create a Domain Service? If so, how can tell my Domain Services about my BLL? For Astoria, one has to implement IQueryable and IUpdatable interfaces for CRUD capabilitie...

Silverlight TreeView

Hi, In silverlight, with Expression blend 3, I have a TreeView in my MainPage.xaml. My TreeView data are Databinding wich came to xml fiel. Expression blend generate this xml fiel by a XAML fiel and a C#. SampleData.xaml and SampleData.C#. I want to every header en RefTitle (data in xml fiel) can call a different method. But In MainPage....

How to have Width and Height reflect ScaleTransform and how to ScaleTransform by setting Height and Width?

I have an issue with regards to using a ScaleTransform on a Canvas in Silverlight, the Canvas scales correctly, however the Height and Width values always remain the same. e.g. a 100x100 Canvas scaled so it appears 200x200 is still 100x100 with regards to the Height and Width values, how can these be updated to reflect the new size. A...

Showing image with javascript

Hi, I am trying to display image, which is dynamically generated on client side with Silverlight, in a new browser window. This is my javascript function: function PrintImage(img) { var newWin = window.open(); var locImg = new Image(); locImg = img; newWin.document.write("<img src=" + ...

Silverlight 3 Datagrid - Temporarily highlight a row

Hello, I'm using the Silverlight 3 datagrid and have a number of custom styles applied - for example, a row style with TargetType data:DataGridRow. However, being very new to Silverlight I'm struggling to figure out how to achieve the following effect: highlight a row (temporarily, say for 2 seconds) when some property of the data item ...