silverlight

Updating a tooltip in Silverlight 2

I have a control in Silverlight 2 that changes state during the application. When its state changes, I want to update the tooltip that goes with it. I'm using the ToolTipService: ToolTipService.SetToolTip(ent.LayoutRoot, "FooBar"); which works fine the first time I set a tooltip, but fails the second time time around I get: "Object...

Resources for animations in WPF/Silverlight?

Hi all, I'm looking for some good resources to ramp up on the animation/storyboard concepts used in WPF/Silverlight. Any pointers? ...

Where best to instantiate and close a Silverlight-enabled WCF Service from the Silverlight app?

When using a Silverlight-enabled WCF service, where is the best place to instantiate the service and to call the CloseAsync() method? Should you say, instantiate an instance each time you need to make a call to the service, or is it better to just instantiate an instance as a variable of the UserControl that will be making the calls? T...

Silverlight/Flash webcast software, similar to Channel 9 PDC 2008

Anyone have recommendations for webcast software, similar to the Silverlight app here: http://channel9.msdn.com/pdc2008/TL57/ I looked at a couple other questions posted here, but I don't want a hosted solution. ...

Empty HttpContext when calling WCF webservice

I recently wrote a webservice to be used with Silverlight which uses the ASP.net membership and roles. To validate the client in the service I look at the HTTPContext.Current.User (Which works when the service is called from Silverlight) However, I've been trying to call the same service from an asp.net postback. But when I step-thru t...

XmlNode not supported in Silverlight: re-implement or use string parsing?

I have written a WPF application that I want to port to Silverlight 2. My business logic and model (for the M-V-VM design pattern) are packaged into a separate assembly which I am trying to recast as a Silverlight class library. Unfortunately, the XmlNode class which I use to parse an XML file with model data is not supported by Silve...

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 - Data binding not listening for PropertyChanged event

Could somebody please explain to me what happens here? I am creating a binding in code. The target object is a UserControl The target property is a boolean DependencyProperty The source object is a FrameworkElement and implements INotifyPropertyChanged The source property is of type ObservableCollection What happens: The binding ...

Find UI element corresponding to an item in a Silverlight ItemsControl

I have a list of strings displayed by a Silverlight ItemsControl. The DataTemplate is a Border control with a TextBlock as its child. How can I access the border control corresponding to an item? For example, I might want to do this to change the background color. ...

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 and WCF or not ?

When developing an application wich will be used inside an intranet do you think Silverlight and WCF is a good solution ? Whould you use WCF Services or WCF Web Services to expose your model to the client ? When consuming a WCF Service the proxies will be generated under a reference and you can only have 1 service reference per service...

Silverlight 2.0 - Saving to a text file

I'd like to save some simple text data to a file from my Silverlight app - to a CSV file. The user presses on a button, the code generates the contents of the file in memory (a string), then a prompt appears asking to either open the file or Save to disk, like through a normal web page. I found a complicated way to do it: http://pagebr...

Is there a workaround for the missing FindName method in Silverlight's DataTemplate?

According to the C# compiler and the Silverlight 2 documentation, Silverlight doesn't provide a FindName method for the DataTemplate class. I want to find a Border that's inside a ContentPresenter. What's the best way in SilverLight 2? ...

C1HierarchicalDataTemplate / C1TreeView Problem

Hi! I've a problem building up a ComponentOne TreeView in Silverlight (C1TreeView) with a C1HierarchicalDataTemplate. In detail the Tree only shows 2 levels (H1 and H2), although 3 levels are defined through HierarchicalDataTemplates like: <c1:C1HierarchicalDataTemplate x:Key="H3Template"> <TextBlock FontWeight="Bold" Text="...

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...

does silverlight support remoting?

Does silverlight support the remoting functionality of the .net framework? ...

Silverlight DataBinding Error - Works in WPF Though!

Start a new Silverlight application... and in the code behind (in the "Loaded" event), put this code: // This will *NOT* cause an error. this.LayoutRoot.DataContext = new string[5]; But... // This *WILL* cause an error! this.LayoutRoot.DataContext = this; The error that is raised is "Value does not fall within the expected range." ...

Can you compile code on the fly in Silverlight?

I should clarify that I am looking for a client-side solution. Alternatively, is there a C# compiler written in managed code? ...

Why are file uploads via Silverlight 2 limited to only .TXT files?

I have a Silverlight 2 app that sends a byte array to a Silverlight-enabled WCF service. However, (unless I try to upload a .txt file) the service's SaveFile() method is never reached and I get an error: "The remote server returned an error: NotFound" Am I missing something really obvious? Why can't I upload .doc files? Why only .txt...

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://...