silverlight

Problems displaying an image in Silverlight

I am trying to generate an image in silverlight but for some reason it is not showing. Here is the code that I am using Image fireBall = new Image(); Uri imageUri = new Uri("/Yambushi;Images/Projectiles/Fireball.png", UriKind.Relative); fireBall.Source = new BitmapImage(imageUri); cnvGam...

Silverlight 2 - Adding database records using WCF

I'm creating a simple Silverlight 2 application - a guestbook. I'm using MSSQL as the data source, I've managed to load the data but I can't find out how to add new rows (messages) to the database. I crawled all the internet but didn't find any working solution. The SCMEssages table has four columns - MessageID, MessageDate, MessageAuth...

What is the best practice for exception handling in silverlight?

In ASP.NET, I usually log exceptions server-side, I win forms I can either log exceptions server-side or write to a log file on the client. Silverlight seems to fit somewhere in between. I wanted to know what everyone else is doing to handle their Silverlight exceptions and I was curious if any best practices have emerged for this y...

Silverlight control in XAML is null at runtime

I've created a silverlight app with a DeepEarth map control on it. Here is my base XAML <Grid x:Name="LayoutRoot" > <!-- Map Control --> <DeepEarth:Map x:Name="map" Margin="0,0,0,0"> <Controls:CoordControl VerticalAlignment="Bottom" HorizontalAlignment="Right" /> <Controls:ScaleControl VerticalAlignment="Bottom" HorizontalAlignmen...

Will HTML be replaced by any new technology?

I see various frameworks being launched that promise Rich Ui and better User experience as they call it. Silverlight, Flash, Yahoo's new framework etc etc. Does this mean that over a period of time these frameworks will replace the existing HTML, JAVASCRIPT CSS based web applications? Wouldn't it be same as opening an application insid...

Test where MouseLeave() leaves to

Hi, I've got a UserControl called myListItem that goes into ListBox'es. On mouse-over, it displays a pop-up window, and in that pop-up there's a scroll-view that the user might want to use to scroll the text in the view. I've made an event-handler that displays the pop-up when the mouse enters, but I'm struggeling a bit with when the mou...

Can I detect a datagrid column being sorted in Silverlight?

I need to be able to load a page of results into the grid from many tens of thousands of possible results. I want to get the data in pages of fifty from the server, using SQL Server to sort the data before returning it for binding to the datagrid. When the user sorts the dta in the datagrid by clicking a column header, I need to detect t...

100% Width Data Template in Silverlight Custom Control

I have a custom Silverlight control that extends Panel. I require the data template (root node is stack panel) to take 100% of the available width - at present, however, the stack panel only fills to the width of the text. The arrange override in my control: protected override Size MeasureOverride(Size availableSize) { foreach (Fra...

What tools do I need to do Silverlight development?

I already own Visual Studio 2008 Team Version, and have an MSDN subscription...and I am an experienced ASP.Net developer. What do I need to install to do Silverlight development, and can all of those tools be installed alongside my current "production" development machine (want to make sure there will not be any side effects). I know I...

Silverlight WebPart in SharePoint

Hi, I'm making a WebPart for SharePoint that will instantiate a Silverlight UserControl and feed it some data. My problem is that when I have created my sample-WebPart and just instantiate a Silverlight control, the webpart, when added to a page or displayed in the webpart gallery, instead of rendering blank, renders an error page saying...

Javascript calling C# function under SliverLight

I have a SilverLight application using C#, with 2 main functions that I want to make accessible from JavaScript functions. I have done the RegisterScriptableObject() in the class and set-up the [ScriptableMember] for the functions I want access to. This the SilverLight object: <div id="silverlightControlHost"> <object id="silverlight...

Best way to upload multiple files from a browser

Hi all, I'm working on web application. There is one place where the user can upload files with the HTTP protol. There is a choice between the classic html file upload control and a java applet to upload the files. The classic html file upload isn't great because you can only select one file at a time, and it's quite hard to get any ...

Silverlight DataGrid - Hiding a Row while showing its RowDetails

I have a Silverlight DataGrid and want to show the RowDetails of selected rows (RowDetailsVisibilityMode="VisibleWhenSelected"). That is no problem. But at the same time I would like to hide the selected row itself. Kind of swapping a row with its details. Setting the row Visibility to Collapsed or the Height to 0 does not work for me ...

Dynamically creating Columns in a datagrid

I'm trying to create a datagrid with a variable number of columns and rows. I can create the columns but I don't know how to insert the content. _dataGrid.Columns.Add(new DataGridTextColumn { Header = "Column 0", Binding = new Binding("0") ...

Audio output from Silverlight

I'm looking to develop a Silverlight application which will take a stream of data (not an audio stream as such) from a web server. The data stream would then be manipulated to give audio of a certain format (G.711 a-Law for example) which would then be converted into PCM so that additional effects can be applied (such as boosting the vo...

What is the sense of crossdomain.xml and clientaccesspolicy.xml when there is e.g. PHP/cURL?

So let's say I have a site and I do not have a crossdomain.xml or clientaccesspolicy.xml on it. This means that people cannot access my site via Silverlight or Flash applications. But they can use, say cURL in PHP (or the equivalent in other languages) to get the information from my site and provide it to their Silverlight and Flash ap...

easiest way to center an image in silverlight?

Say I have a grid with 3 rows. In the center row I'd like to put an image and then center it in that row vertically and horizontally. But since (I think) Silverlight uses upper left corners of an element when it centers, the upper left corner of the image is centered when I tell it to center vertically/horizontally. I've seen 2 approa...

Silverlight Listbox Performance Question

I'm developing a Silverlight application that displays items in a listbox control and I've run into a bit of a performance issue. Each item in the listbox is a custom stackpanel with some formatted text and such. When I've got a list of 500 or less items the listbox works fine, but loading more than this causes problems. At 1000 items,...

Broken Silverlight Design-Surface in VS2008

In VisualStudio 2008, the design surface is just empty since I added this style to App.xaml: <Style x:Key="RightAlignedCell" TargetType="data:DataGridCell"> <Style.Setters> <Setter Property="HorizontalContentAlignment" Value="Right" /> </Style.Setters> </Style> and adding this required namespace at ...

Is there any way of checking if a DataGrid in Silverlight has Focus ?

I have a Silverlight DataGrid of which I need to check if it has Focus. I know there is a method to set Focus and an event for GotFocus but can't see anyhting for checking if it has focus. Any Ideas ? ...