silverlight-2.0

programatically add column & rows to WPF Datagrid

Hello Guys, i m new to WPF. i just wana know how should we add Columns & rows programatically to DataGrid in WPF. The way we used to do it in windows forms. create table columns , rows & bind it to datagrid. i believe WPF datagrid is bit different the one used in ASP.net & Windows form ( correct me if i m wrong). Basically i have No ...

Silverlight Full Screen input problem

Hi, I am having some problems with the Silverlight full screen mode. If I switch my application to full screen all the input from the keyboard is not handled. No textbox input, no key down / key up event and probably much more. Here is a sample application that demonstrates this : Xaml : <Canvas> <TextBlock Text="Try some input:" C...

How do I translate a &#174; into Silverlight Text Represenation

I make calls to a webservice to get information that bind to the Text property of a TextBlock. Sometimes the information will contain encoded special characters for HTML - most notably the ® which I believe to the (r) symbol. The silverlight TextBlock just displays the raw text and not the (r). Of course, I can strip out the text, but...

How can I use non-Silverlight assemblies in a Silverlight app?

I'm working an project (pure hobby, "Sharping my skills") which has one unified back-end and multiple front-ends (ASP.NET MVC 1.0/JQuery and Silverlight 2). When I try to add reference to my business layer assembly in the Silverlight 2 project (VS2008); It gets rejected, because it's not a Silverlight assembly. Is their a way to include...

Binary serialization of Silverlight XAML object

I'm working on Silverlight application that needs to display complex 2d vector graphics. It downloads zipped XAML file from the server, parses it (XamlRead) and injects to the layout root on the page. This works fine for fairly small xaml files. The problems is that I need to make it work with much bigger file (lots more content in it)...

Silverlight Unit Testing - How to check UI base types?

In short: How would I check the type of a UI user control during a Silverlight unit test? In detail: I am loading child views into a ContentControl on a parent view. During testing I want to check that the correct view has been loaded at the correct time. My views are in separate projects, and I don't want to add a reference to those as...

Binding Silverlight UserControl custom properties to its' elements

Hi. I'm trying to make a simple crossword puzzle game in Silverlight 2.0. I'm working on a UserControl-ish component that represents a square in the puzzle. I'm having trouble with binding up my UserControl's properties with its' elements. I've finally (sort of) got it working (may be helpful to some - it took me a few long hours), but w...

How do you have Silverlight resize text content to fit?

I've got a user control (below), I'm binding the text to a datasource and instancing up a bunch of the usercontrols. I want the size of the text to be the largest possible that will still fit in the bounds of the control. In Windows programming, I could measure the text size decrementing the font size until it fit the target dimensions....

Compiling Silverlight runtime question

I have created a Silverlight project which also contains a Web project. I have a few class files in my web project which use System.Windows.Point and System.Windows.Size data types and I am getting compile errors when I try to pass either of these types in a List like List<Point> in the Silverlight project. If I try without the List<> ...

How does Silverlight Image Clipping work?

I've got a very large image which I'd like to use for sprite techniques (à la css image sprites). I've got the code below: <Image x:Name="testImage" Width="24" Height="12" Source="../Resources/Images/sprites.png"> <Image.Clip> <RectangleGeometry Rect="258,10632,24,12" /> </Image.Clip> </Image> This clips the source...

Setting up the SharePoint+Silverlight Blueprint Colleague Viewer Web Part

I'm trying to get the Silverlight Colleague Viewer webpart to work on my test server. The silverlight player renders the Viewer but it fails when it attempts to access the WCF service. The error below is caught by IE 8. Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR >1....

Listbox perfomance issue with huge data in Silverlight 2

Hi.. Iam using Silverlight 2 in which I have a perfomance issue when I use a Listbox control. I am binding a List of objects of about 500 records which is taking 3-4 seconds for databinding. But Iam not having this issue with DataGrid. Does anyone have a answer for improving the perfomance issue in Listbox? ...

Turn off IIS 6 HttpCompression for specific browsers

I am having issues with IE6 (surprise) and HTTP Compression using IIS6. I really don't want to turn off HTTP Compression for the site. Is there a way to tell IIS6 to not compress responses to specific versions of browsers? IE7 works fine. EDIT: My problem actually comes from Silverlight 2 consuming a WCF Service. With compression tu...

Autosizing ComboBox dropdown to content in Silverlight.

I have this ComboBox in my Silverlight UserControl: <ComboBox AutomationProperties.AutomationId="cmbProjects" Grid.Row="0" Grid.Column="2" ItemsSource="{Binding Projects}" SelectedItem="{Binding SelectedProject, Mode=TwoWay}" Style="{StaticResource Defau...

TemplateBindings in Custom Controls

I'm just mucking about with custom controls in silverlight and for the life of me i can't get the TemplateBindings to work. Can someone give this reduced version a once over to see if I'm missing something. So my ControlTemplate in the generic.xaml looks like <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/pre...

Silverlight StackPanel Overflow Detection

Haven't started this one yet but I know I will have to tackle it in the next couple weeks.. I am creating a simple single-line toolbar (a horizontal StackPanel w/buttons) in Silverlight 2 and need to detect when the width of the browser starts colliding with the buttons. Upon collision I will display an "overflow" indicator which is at...

Final step in silverlight 2

I have been working on multiple silverlight applications, but up to this point they have only been running in my system when I test them from Visual Studio. Now that I am getting ready to push it out I cannot figure out the steps to accomplishing it. ...

Auto Size Silverlight Application.

I want to have my silverlight application to auto size it self to the contents within the application by changing the height of the Host div. How would you get what the size of the total app should be? For instance I have a Grid with three rows, The top and bottom row have buttons and the middle row has a DataGrid that can change in hei...

How can I find out when a new UIElement is added in Silverlight

I am designing a user control in sliverlight that inherits from canvas. It is necessary for me to find out when a new UIELement is added to Children property of MyBase but there is no event like "ItemAdded". Since I want to animate the children of my canvas, I can not use LayoutUpdated event (It is hit a million times). ...

How do I position an ellipse on a Silverlight Grid?

I am creating a silverlight application which will allow you to click at two places on the screen and will draw an ellipse whose major axis starts and ends at the click locations. The clickable area is a Silverlight Grid control. Currently: When you first click, I am: Dropping a marker at the click point. Creating an ellipse and paren...