silverlight-2.0

Silverlight Architecture Guidance - Lazy Loading

Background: We have an offshore group working up a Silverlight 2 prototype for us. There is the conception that we need to be very concerned with lazy loading of various "screens"/parts of the application. The offshore group has decided to dynamically load assemblies in order to achieve this; however, I would think MS has already dealt w...

How can I pass an ASP.NET querystring value into my silverlight 2 control?

I have an ASP.NET page. What I want to do is pass in an ID field that is in the querystring. So if my page is http://www.mysite.com/default.aspx?id=35 I want a silverlight control that is on this page to have access to the id field. My silverlight control is going to get data for a grid and it needs to use the id. ...

On a Silverlight 2 datagrid, how can I get a collection of only the rows that are edited?

I load data into my grid using a WCF service. When a user clicks 'Submit' on my silverlight 2 control, I want to send only the edited rows back to my WCF service for updating. Is there a good way to do this? ...

Add a line to a list and canvas

Hello I'm currently trying to add a regular line shape to both the canvas and a custom object. I'm not getting an error, but the line is not being added to the canvas The relevant bit of code is below lh = new LineHolder(); Line lnx = new Line(); lnx.StrokeThickness = 1; MainCan.Children.Add(lnx); lh.MainLiner = lnx; lstLH.Add(lh)...

Silverlight Button Click Event

I have a silverlight page with a textblock and button on it. Like this: <TextBlock x:Name="txbNote" Margin="50,50" Text="Hello"/> <Button x:Name="btnCheck" Height="40" Click="btnCheck_Click" ClickMode="Press" Margin="50,50,50,50" Content="Check Service"/> Here is the handler for the click event: Private Sub btnCheck_Click(By...

How can I get the Silverlight ComboBox to resize the dropdown after I change ItemsSource?

There are various posts on the web about this issue whereby the ComboBox only changes its dropdown height to fit the items on its very first dropdown. Any changes to the items shown doesn't cause the dropdown to resize. The various workarounds I have found don't seem to work for me, so I was wondering if anyone had found a way to solve t...

How do you use two-way binding if the instance being bound does not implement INotifyPropertyChanged in Silverlight 2?

I am trying to write a fairly simple user control in Silverlight 2 that allows the user to search for existing addresses, optionally update the selected address, and add new addresses. To this end I have put together a simple WCF service that allows for simple querying and I am currently wiring this up to a textbox, listbox combination ...

Accessing ASP.NET 2.0 web services from Silverlight 2.0

I have some ASP.NET 2.0 web services and I have a Silverlight control that accesses these services. When I run these under the localhost, everything works fine. However, if I deploy the web services to an ASP.NET server and run my simple Silverlight html host locally, Silverlight no longer gets a response from the asynchronous web servic...

Silverlight 2: How to abort a WCF operation.

I have a Silverlight 2 application that calls a WCF Service that invokes a database stored procedure. The query could take several minutes to process and I want to provide a cancel button on the client UI. How do I properly abort the WCF operation that was called? What is the best practice? ...

Intermittent InavlidCastException in a UserControl.InitializeComponent()

Thanks in advance for any help with this. It is driving me nuts. Here is the setup: I have a Silverlight Control Library "Controls", in which I have a customer control defined for presenting dialogs: public class Dialog : ContentControl { public Dialog() : base() { DefaultStyleKey = typeof(Dialog); } <......

Dynamic DataTemplate switching

I am trying to achieve the same behavior as indicated in the following post. The trouble is this post solves the problem for WPF. http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/4fd42590-8375-46d0-b7bc-6c217df0f0ba/ Any ideas on how to do this in Silverlight 2.0? Thanks Chris ...

ContentPresenter losing DataContext

I want to create a "FlipPanel", which provides two different views of the same object. Here is the approach I am taking. This is the main page, which consists of an ItemsControl whose ItemTemplate is a FlipPanel. The FlipPanel exposes two properties which define the DataTemplate to use for the Front and the Back. <UserControl.Resou...

Silverlight Web Project shows install icon when debugging

When I add a Silverlight project to a blank solution, it asks me whether I want to add a web project to host the silverlight page or automatically generate a test page. Oddly enough, when I automatically generate a test page, everything in fine. However, when I add the web project I have problems. I first get an error saying that it n...

Hosting a SilverLight website

Hi all, I am new to web development and am seeking some help :-) I have followed a silver light tutorial to build a basic silverlight app. http://weblogs.asp.net/scottgu/pages/silverlight-2-end-to-end-tutorial-building-a-digg-search-client.aspx i then hosted this app on aspspider. i have now modified the app to connect to a SQLExpre...

Silverlight: Force Canvas to Invalidate or Repaint itself?

I have a Silverlight application which has on it a Canvas. On that Canvas, I dynamically "paint" a bunch of stuff, but adding controls to the canvas. I have a button outside the Canvas area which clears the content. The objects are removed (successfully). However, the Canvas area does not refresh itself immediately; it currently requi...

How do I set the ZIndex of a Listbox Item on MouseEnter?

I have a different style for the items in my listbox on MouseOver which gives a slight zoom effect. This works nicely, but since the ZIndex is set in the order items are added to the ListBox, the zoomed item will be drawn behind the next item. I would like to set it so that the zoomed item is on top. I've tried creating a MouseOver even...

How do I include a custom row at the end of a DataGrid in Silverlight?

I have a DataGrid in my Silverlight application and it works nicely, adding a row or removing a row as I manipulate the ItemsSource collection. However, I want there to be an additional row, or control that always appears after the last data row. I can get the additional control to appear after the last row using a ControlTemplate and s...

How is the Parent property of a FrameworkElement set in Silverlight?

I have written a custom Silverlight control based on Control. I have two DependencyProperties called Top and Bottom which both hold child controls for a specific layout display. I then use a ControlTemplate to arrange these two controls into a grid, placing one on the 0 row and the other on the 1 row. The problem I have is that I cann...

How to improve the much-to-be-desired Silverlight installation experience?

I wanted to get a sense of the average user experience of having to install Silverlight in order to use the Silverlight applications I've been making. I fired up a virtual machine with clean browsers and pretended to "be my Dad" just wanting to check out the website and then being confronted with the "you must install Silverlight" butt...

Silverlight 2 getting membership/identity information from MVC application

Hi there, I have an MVC application that among other things contains a small Silverlight menu that is displayed as part of the .Master page used in most pages. I have also written a MembershipProvider (and a role provider) that uses my app's database for authenticating and authorizing users. Works fine. However, I want the Silverlight...