silverlight

SortedList porting to Silverlight

Dear all It looks SortedList is excluded.. What do you think most appropriate out of existing collections? (to keep the same fast access and changes) Can silverlight Dictionary be permanently sorted? Best regards VLK ...

Race Condition Occuring in ScrollViewer

This might be a design problem on my part but I'm experiencing what I'm calling race conditions when setting the size of a Canvas (let's call it Canvas A) which is a child of a ScrollViewer. I'm using the size of Canvas A to set the visibility of the scrollbars in the ScrollViewer. However, I also use the visibility of the scrollbars t...

Display a line after a TextBlock in Silverlight

Hi, I'm working on a dataform in Silverlight 4 and would like to group elements by section, with a title for each. The title consists of a TextBlock followed by a horizontal line. The line runs until the edge of the form. I've tried the following (from this thread: http://forums.silverlight.net/forums/p/77813/183885.aspx), without succ...

When to use MEF

I tried Unity and MEF and plain old new. And I am a bit confused as to when exactly you need to use any of these "patterns". Why would I choose to use MEF or Unity if using new is simpler and satisfies my needs. In other words, what needs justify the use of MEF or Unity? ...

How to center text around point using xaml

I would like to be able to place the word "hello" centered on a specific point. I need to do this completely in XAML without extra code. Best I can tell, all the text alignment properties/styles in XAML act on text within some bounding canvas or other element. Since I don't know the length of the text I want to center, I can't cente...

How can I read a binary string in C#?

There is a php script which sends a binary string to the client application: $binary_string = pack('i',count($result_matrix)); foreach ($result_matrix as $row) { foreach ($row as $cell) { $binary_string .= pack('d',$cell); } } echo $binary_string; Silverlight application receives $binary_string via POST protocol...

Anybody have anyluck F# Silverlight vs2010?

Has anybody had any luck with the following combination F# 2.0 Silverlight v3 .NET Framework 4.0 VS 2010 I have been trying all night and I just can't seem to adopt any of the existing smaples out there to run... My goal is to have a silverlight application 100% backed by F#; the examples that are referenced as working are mostly C...

Detecting validation errors in Silverlight 4

I'm using the new Silverlight 4 support for IDataErrorInfo. So I have a POCO object that has implemented the interface, and when a validation rule fires the Silverlight UI correctly shows the error. So that is all working fine. The POCO object looks like this: public class SomeDomainClass : IDataErrorInfo { public string SomeStri...

Streaming live video from WCF service to Silverlight

Hi, I need to stream live captured data (from a screen/web cam) from a WCF service to a Silverlight client. Since it's live data I don't mind losing packets... More important that it will be real-time data. Any suggestions how can I do it? How does the WCF service transfer it? How does the Silverlight client should consume the stream? ...

Silverlight4 + C#: Using INotifyPropertyChanged in a UserControl to notify another UserControl is not notifying

I have several User Controls in a project, and one of them retrieves items from an XML, creates objects of the type "ClassItem" and should notify the other UserControl information about those items. I have created a class for my object (the "model" all items will have): public class ClassItem { public int Id { get; set; } publi...

Converting XAML to bitmap in Silverlight

Hi, I want to convert XAML to bitmap in Silverlight (I'm using version 4). I saw that there was a simple solution for WPF but the needed classes do not exist in Silverlight. Has anyone done such a thing? ...

Howto play video with external audio in Silverlight?

Hi all, Is there any proper method to play synchronously video and external audio, other than simply having two MediaElement (one for video source and one for audio) started simultaneously? I need to play video with different soundtracks, but I belive that just two separated MediaElements will be out of sync at some point of time. Maybe...

passing paramter as to webservcie function in wcf

hi, this my datagrid event here i am calling the webservice. private void dgProject_RowDetailsVisibilityChanged(object sender, DataGridRowDetailsEventArgs e) { WSDataServiceClient wsService = new WSDataServiceClient(); wsService.GetProjectCompleted += new EventHandler<GetProjectCompletedEventArgs>(wsService_GetProjectComple...

Is there an MVVM-friendly way to swap views without value converters firing unnecessarily?

I thought what I was doing was right out of the Josh Smith MVVM handbook, but I seem to be having a lot of problems with value converters firing when no data in the view-model has changed. So, I have a ContentControl defined in XAML like this: <ContentControl Grid.Row="0" Content="{Binding CurrentViewModel}" /> The Window containing ...

Windows authetication with Silverlight custom binding.

Hello, I am trying to set up security within a web.config file for a WCF service hosted in IIS but keep getting the error message: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service. I have read Nicholas Allen’s blog (link text) and it ...

PlaneProjection is not working well in silverlight

in silverlight project using name attribute in planeprojection gives Error 1 The type or namespace name 'PlaneProjection' could not be found (are you missing a using directive or an assembly reference?) code i used for that <Image Name="blabla.jpg" Height="200" Width="200" > <Image.Projection> <PlaneProjection Name="pp" /> ...

Simple WCF Webservice Call from Silverlight (Need Help Please!)

Hi, I'm new to Silverlight programming and networking in general and I've been trying to find an answer to this all day. I'm trying to build a very simple Silverlight4 web application in VS2010 that calls a webservice on the ASP.NET website (exact same Solution as the Silverlight client app so there shouldn't be any cross-domain issues?...

Silverlight data binding to parent user control's properties with using MVVM in both controls

Hello! I have two UserControls ("UserControlParentView" and "UserControlChildView") with MVVM pattern implemented in both controls. Parent control is a container for Child control and child control's property should be updated by data binding from Parent control in order to show/hide some check box inside Child control. Parent Control ...

how to clip text of the RichTexBox

hi I have RichTextBox bind to description(html format) from database and it is read only. I just need to show First line from description. How to achieve this ...

Cross Domain Policy

Hi, I am working with a Silvelright App that consumes a WCF service, I have placed a crossdomain and clientaccesspolicy xml's in the wwwroot of the IIS as well as in the application folder! yet when the client communicates with the service, it throws an error saying; An error occurred while trying to make a request to URI ‘http://loc...