silverlight

Implementing .Net RIA Services with Silverlight3 using only existing code/classes?

As my latest questions have stated, i am in a process of researching on Silverlight 3 and its application as a suitable RIA solution to a pre-built project a client of ours wishes to webify. And my experience in .Net and silverlight is about 3 - 4 weeks. I have now become aware of .Net RIA Services. I require to use an existing VB class...

Silverlight Programmatic Next TabStop

When a TabItem gains focus, I want to intelligently assign Focus to controls inside of it. Basically I just need to hit the Tab key upon the TabItem's GotFocus event. But I can't find any way to do that. Neither the FocusManager or Keyboard classes provides anything. I just want a method I can call that "does whatever Silverlight does wh...

How to get resource from referenced assembly?

Suppose I have following projects for silverlight application: MyApp: reference to MyLib MyLib: reference to MyImage MyImage Following code will give me error(can't find out the object): Application.GetResourceStream(new Uri("MyImage;component/myxml.xml", UriKind.Relative)) I need to add reference to MyImage in MyApp, the I can avoid...

How do I see the value of a DependencyProperty in WinDbg?

Using WinDbg and trying to debug a Silverlight application for memory leaks, I come across properties on my objects that are implemented as a DependencyProperty - and when I dump the object in the debugger (WinDbg) I can see the property - that is, I can see the actual static field. How do I see the actual value of the property? ...

Silverlight XAML Binding -- Decimal to Double

I've got some Columns in a DataGridView that have their Binding property set to something like the following: Binding="{Binding NetPrice}" The problem is that this NetPrice field is a Decimal type and I would like to convert it to Double inside the DataGrid. Is there some way to do this? ...

Accessing a RenderTransform in a DataTemplate in Silverlight

I've got a bunch of ContentControls with a DataTemplate like so: <DataTemplate> <Canvas> <Canvas.RenderTransform> <TransformGroup> <ScaleTransform ScaleX="1.0" ScaleY="1.0"/> </TransformGroup> </Canvas.RenderTransform> </Canvas> ...

RIA Services does not support entities that are decorated by NHibernate mapping attributes?

...

How do you set CacheMode on an element programatically?

Silverlight 3 introduced the CacheMode parameter on elements. Currently the only supported format is BitmapCache. In XAML this value can set as the following: <Image CacheMode="BitmapCache" Source="MyImage.png"></Image> I would like to do the same thing at runtime but have failed so far, neither of the following examples work Image i...

Using Webservice classes in Silverlight when adding service reference instead of web reference

Scenario: I am using Silverlight 3.0 as client for a web service. Design: The server has a class named DeviceInfoService which has the basic functionality of getting the list of devices, getting the properties of devices etc. When I open an ASP.NET project and try to add a web reference, I can find an option to add a "Web Reference"....

Intercept Silverlight DatePicker's convert from text to DateTime

Hi, I want DatePicker to convert the following text pieces to DateTime (shown in international format) so my customers can write a date in DatePickers textbox faster so it is not just DateTime.Parse I will use: "3" to 2009-10-03 "14" to 2009-10-14 "1403" to 2009-03-14 "140310" to 2010-03-14 "14032010" to 2010-03-14 I have tried diffe...

silverlight 3 style composition

I haven't been able to find a simple, straightforward answer regarding this scenario, so I thought I'd try here. In WPF, you can so something like this: <Style x:Key="headerBlock" TargetType="{x:Type StackPanel}"> The idea here is to avoid setting the Style property on every TextBlock inside the Stack...

Binding to ActualWidth does not work

In a Silverlight 3.0 application I'm attempting to create a rectangle in a canvas and have it stretch the whole width of the canvas. I have attempted to do this by binding to the ActualWidth property of a parent container (seem sample below), however while I don't see any binding errors the value is not being bound. The rectangle is no...

Is there a standard or recommended external subtitle format for Silverlight?

I need to load subtitles as external xml/text (representing different language) files for a video. However, I'm trying to decide on a schema/format for my external file, and have come across two options: SAMI: http://msdn.microsoft.com/en-us/library/ms971327.aspx Timed Text: http://www.w3.org/AudioVideo/TT/ Right now I'm leaning tow...

Is there a XAML/WPF/Silverlight style guide?

From .NET Rocks! Show #488: Richard Campbell: "In the GDI world we got a document from Microsoft that said you will build your apps in battleship gray and here's now they should look: File goes here and Help goes here, and we all got that as developers. There's no book like that for WPF. There was this idea I've got ...

ADO.Net Data Service Operation: Array of integers as a parameter

This question is a bit of a two parter for .Net data services. This is the function signature I'm trying to achieve: /// <summary> /// Returns Descriptions for any asset in the given assetIDs. /// </summary> [WebGet] public IQueryable<Description> FindDescriptionForAssets(int[] assetIDs); I'm trying to create a custom service operat...

silverlight gradient

I was wondering if there is a way to programmatically change a stopgradient color specified in XAML. For example: '<'Rectangle Width="1280" Height="1024"> '<'Rectangle.Fill> '<'LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> '<'GradientStop Color="Black" Offset="0.0" /> ...

What is the best practice for committing changes using a LINQ2SQL datacontext in a Silverlight application using RIA?

I've got a Silverlight app using RIA services and LINQ2SQL and have objects in my Silverlight app. I query all the records in a table (via a LINQ query, using a datacontext) in the Silverlight app and create a user control for each object (record) and put that object into the control because I need the information later. Then later,...

How do I load all items in a relationship with RIA Services?

With RIA services, I have a Contract that has a list of Orders (1 to many relationship). Given a Contract, is there an easy way to load all of its orders? Currently, I am creating a method on the service that takes a ContractKey and returns a query that selects all Orders on that ContractKey, and I pass that query to the Context.Load m...

Silverlight 3 security and Authentication mechanism

Hi I am creating a Silverlight 3 application for which i am designing the security block. I already have an existent ASP.NET authentication module that i will reuse in the WCF security service(which will be like a wrapper and this will be called from Silverlight). My goal is to use SSL for the transport security. Also i would want this ...

Silverlight custom control's content in scrollviewer

I have a Silverlight control derived from ContentControl. I use it in following way <local:CustomControl> <local:AnotherControl> </local:CustomControl> I want to have the content (i.e. AnotherControl) in a ScrollViewer. Without changing the above XAML usage, how can I have the content in scrollviewer? What modification do I need to m...