silverlight-2.0

What do I need to do to make property element syntax work for my custom attached property in Silverlight?

I have a class like this: public class Stretcher : Panel { public static readonly DependencyProperty StretchAmountProp = DependencyProperty.RegisterAttached("StretchAmount", typeof(double), typeof(Stretcher), null); public static void SetStretchAmount(DependencyObject obj, double amount) { FrameworkElement elem = o...

silverlight 2 binding data to transforms?

I am working on creating a tag cloud in Silverlight 2 and trying to bind data from a List collection to a Scale transform on a TextBlock. When running this I get an AG_E_PARSER_BAD_PROPERTY_VALUE error. Is it possible to data bind values to transforms in Silverlight 2? If not could I do something to the effect of FontSize={Binding Weigh...

Silverlight Control Template Color Property

I am creating a Control Template for the Button control in Silverlight 2. I started with an empty template and added the visual elements I wanted. The main visual element is just a path (shape) filled with a color. The button control already has a Color property associated with it and I was wondering if it was possible to link the Col...

How to correctly serialize a base class to JSON in silverlight?

I have the following structure: class Base { } class Child : Base { } When I try to do the following: DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(Base)); serializer.WriteObject(stream, data); It fails with the error message: Type 'MyNamespace.Child' with data contract name 'Child:http://...

Getting .png pixel data in Silverlight

Hi all, We have a Silverlight application that needs to load a number of .png files. We can load the images OK, but Silverlight doesn't support reading the pixel data from the Image class. Can anyone suggest a simple solution for getting at this data? Our current best bet would be a third party .png loading library, but we are having...

Can I get the Silverlight mediaplayer to play .Vox files?

I need to play .vox files on my web page. Does anyone have any tips on how to play .vox files using the Silverlight Mediaplayer control? ...

Silverlight DataGrid automatic selection when setting ItemSource/DataContext, sorting, ...

Is there a way to turn off the automatic selection of the first row in the built-in DataGrid in Silverlight? We build a lot of functionality based off the user selecting a row in a data grid. The automatic firing of SelectionChanged when databinding or sorting is really causing us issues. We have tried to put some guards around the se...

Clipping shapes in silverlight2

I am writing a simple application in SilverLight2, which needs to draw an ellipse inside a canvas element - the ellipse position, height and width are computed during runtime. What I need to fix is the clipping of the ellipse. If it gets to big it is drawn partially outside the canvas, above other ui elements. I want the bounding box of...

How can I setup a Right Click context menu in Silverlight?

I want to create a right click context menu for my textboxes to provide the typical copy/paste functionality. Any ideas on how to go about this? ...

Silverlight 2 User Control - Unknown attribute name on element

Update: Screenshot http://farm4.static.flickr.com/3277/3048788466_661e8e5e78_b.jpg To reproduce: Get this sample project from Silveright.net - http://download.microsoft.com/download/5/9/2/5922d533-7ed5-4065-a138-ce3d9ca266e5/4-UserControls_Source_CS.zip Open the UserControlDemo Solution. Then on Line 9 of Page.xaml, you'll see the e...

Pressing Enter on TextBox in Silverlight

I am working on a silverlight app that you need to enter information into a textbox and then just hit enter. Well there is no onclick event, that I could find, so what I did was use the onkeypressup event and check if it was the enter key that was pressed if so do "blah". It just feels like there is a better way to do this. So the que...

Custom Controls with Blend

I'm building custom control for my Silverlight 2 app. It's in one SL class project, and it contains two files: MyControl class, inherited from Control, with few DepedencyProperties themes/generic.xaml, with visual elements (ControlTemplate), states for VSM and transitions I created whole xaml by hand, and it works, but want to ...

Change background color of Datagrid Header in Silverlight 2.0 RTW

I want to change background color of Datagrid header in Silverlight 2.0 RTW ...

HTTP POST XML to REST Singleton Service throws NotSupportedException

I have the following REST Host in a silverlight application. I'm getting a NotSupportedException on the EndGetResponse() call of the Save Method. In this sample I'm using the default config for a REST Singleton Service from the WCF REST Starter Kit, with the exception of some changes to the OnAddItem method to accept updates via a POST...

Silverlight 2.0 - scroll vertically, wrap horizontally

In silverlight 2.0. I have some content that i want to scroll vertically and wrap horizontally. In the controls I have a dock panel. The DockPanel's last child, which fills it, is a ScrollViewer <UserControl x:Class="MyProject.MyControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.m...

Silverlight 2.0 - Can't get the text wrapping behaviour that I want

I am having trouble getting Silverlight 2.0 to lay out text exactly how I want. I want text with line breaks and embedded links, with wrapping, like HTML text in a web page. Here's the closest that I have come: <UserControl x:Class="FlowPanelTest.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x=...

Replacing the decimal point key (from numpad) with correct decimal separator (in silverlight!)

Hi, What I am trying todo when the user is in a textbox (in silverlight 2.0): When user presses the decimal point (.) on the numeric pad, I want to have it replaced by the correct decimal separator (which is comma (,) in a lot of countries) I can track that the user typed a decimal point by checking in the keydown event void Cell_...

Silverlight Verticle Slide Panel

Can anyone recommend a good Silverlight 2.0 slide panel that takes an unknown number of user controls as childen and allows the user to scroll up and down through the child list. Similar to http://www.thejamesbondmovies.com/ but vertical and not just limited to images. ...

Dependency Properties in Silverlight

I'm struggling to understand Dependency Properties in Silverlight 2. Does anybody have a good explanation or link that clearly explains the DependencyObject and/or DependencyProperty? ...

What is missing from Silverlight 2's version of .Net?

I've just started developing in Silverlight 2 and have not run into any "missing parts" of .Net that I was using in the full version. Have you found anything to be missing from Silverlight 2's version of .Net that (1) you missed, (2) really needed, or (3) had to abandon Silverlight 2 because it was missing? ...