silverlight-4.0

String Localisation Problem in Silverlight Application

I have an odd problem in silverlight. I use the following XAML to bind the content of a label to a double property in my viewmodel. Content="{Binding FeePeriodActual, Mode=OneWay,StringFormat=\{0:c\}}" However, the display string always shows the $ Dollar Currency symbol rather than the the £. This is the same on the production serv...

SL 4: Strange behavior with templated control

Hello, We have some xaml: <Style TargetType="local:V_RelLine"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:V_RelLine"> <Grid x:Name="LayoutRoot"> <VisualStateManager.VisualStateGroups> </VisualStateManager.VisualState...

Need to transform a rectangle's color in Windows Phone 7

I have a rectangle, and I have a storyboard: <Storyboard x:Key="PressAndHoldColorBar"> <ColorAnimationUsingKeyFrames Duration="0:0:10" FillBehavior="Stop" Storyboard.TargetName="rectWarning" Storyboard.TargetProperty="Fill"> <LinearColorKeyFrame KeyTime="0:0:0" Value="Green" /> <LinearColorKeyFrame KeyTim...

How to detect MouseLeave on a UIElement that is a Drag source in Silverlight when Dragging?

I have a StackPanel with MouseLeave events. I have run into an issue where MouseLeave events are not occurring for this StackPanel when elements are being dragged from this stack panel to other outside elements. How can I have the MouseLeave event detected when Dragging? Thank you. ...

Is there a way to programmatically cancel editing a text box?

In my windows phone 7 App I have a single line textbox. When the user presses {ENTER} I want to accept the textbox value and switch the textbox back into normal non-edit mode. Basically, is there a way to programmatically cancel editing a textbox? I have tried force the Visual State Manager into Normal mode which does change the v...

IlMerge Silverlight Class Library with Custom Controls

Hi, I am trying to merge all the assemblies of an class library in a single .dll file. I can merge all the assemblies using the Ilmerge but is that when I use the merged dll in a Silverlight application I am having trouble when a template is apply to my control and binding problems if I use a control that inherits with UserControl. is...

Pros / Cons to Different Binding Approaches using MVVM and RIA Services

I have been building an application, which uses the LoadOperation's Entities to return an IEnumerable which becomes the source of a CollectionViewSource in my View Model. I am now discovering the potential pitfall to this approach, when adding Entities in my Silverlight client, I cannot see these entities, unless I either submit the New...

DateTime Convert from int to Month Name in C#, Silverlight

In a nutshell, I am trying to print out the name of the month not the integer value of each month. (for example if the date is 2/2/2002, I would like the "month" to read out "February" instead of "2." I am pulling in the system.DateTime.now to get the current month. When I try to print out the current month on the form, it just puts th...

modal popup effect from silverlight usercontrol

Hi there, I am playing around and trying to learn silverlight4. I have an existing asp.net page with and area of 600 * 400px available for my silverlight form. My silverlight application has 2 usercontrols. The 1st usercontrol contains a listview of some data, when a user clicks on a list item I display the 2nd usercontrol. Is it possi...

Calling WSDL webservice from different domain ( hosted by JBOSS) using Silverlight 4 client 4004 Message

Hi Gurus, I am facing an error here while accessing a webserive WSDL (hosted by JBOSS) using Silverlight 4 client. Here is the message: Message: Unhandled Error in Silverlight Application Code: 4004 Category: ManagedRuntimeError Message: System.Reflection.TargetInvocationException: An exception occurred during the operation, making ...

Setting the xaml of the Silverlight 4 RichTextBox

I can retrieve the xaml with rtb.xaml.ToString() and store it in a database. But how do I set it? As an example, I thought rtb2.Xaml = rtb.Xaml would work. ...

Ria services reference is missing from silverlight 4 on VS2010

I'm walking through a tutorial for Ria services and Silverlight 3 however my coding environment is VS2010 (with .Net 4.0 and SL4). The tutorial references system.web.ria and I can't find that reference at all in the Add References window for VS2010. ...

How do get the current line text to cursor from a Silverlight 4 RichTextBox Control

In the Winforms RichTextBox control I have previously used the GetLineFromCharIndex method and the GetFirstCharIndexOfCurrentLine to work out the start and end points of the typed text on he current line. I am struggling with the new RichTextBox control in Silverlight 4 as there doesn't appear to be equivalent methods. GetPositionFromPo...

How do I find a Silvlerlight object on an Asp.Net page using Microsoft UI Automation testing?

I have an object on my asp.net page hosting a Silverlight xap (in my particular case it is in an IFrame, but I'm curious about regular objects as well). I can find the element in UI Spy, but the name just says "Silverlight Control". Trying to find that AutomationElement in my automated test is unsuccessful (control is null every time). I...

How do I use InputScope PhraseList or EnumString on Windows Phone 7 textbox?

I have found plenty of tutorials demonstrating InputScope values of email, phone number, name, etc. But nothing that addresses my specific problem. I want the user to be able to select a value from an enum or a list of strings. I'm trying to imitate the behavior found in the emulator under Settings > region & language, for either the ...

Client side Excel interop using Silverlight 4

I'm trying to see if it is possible to read an Excel spreadsheet on the client using Silverlight 4 and use Excel interop libraries to read the data. I've seen sample code such as: dynamic excel = AutomationFactory.CreateObject("Excel.Application") but how do I even know what is possible to do here if the dynamic keyword is used? ...

Silverlight4 Element Binding Weirdness.

I'm a bit of a .net newbie and I've been working on my first big silverlight project. So pardon the lack of lingo and the length of the question. But my problem is as follows. The project is being built according to the MVVM pattern ( in this case I'm using LightMVVM ). Most of the views contain ListBoxes. These listboxes need to ha...

How do I change the timeout constraint when calling a WebService from a Silverlight 4.0 app?

How do I change the timeout constraint when calling a WebService from a Silverlight 4.0 app? It doesn't have a Timeout property attached to it like it seems to have had before. Edit: Anyone? ...

ListBox Disabled state in Silverlight 4

So I'm styling a ListBox and I've got to the part where I need to do a greyed out style when the ListBox is disabled. However when I look a the states tab in Blend, there's only Validation States present - no sign of the usual Common States which include the Disabled state. I tried creating a vanilla project with no custom styles and ju...

Bindings in two diferent Datatemplates for the same control

Hi, I'm doing a generic controller, right now is one button from telerik with two direferents datatemplates. Each dataTemplate has an specific key to id and in code-behind i change between them. My problem is i cannot do the binding to my properties. For example: My Xaml looks like: <telerik:RadButton x:Class="Itim.Framework.Silv...