silverlight

How to set uri for local image in silverlight app?

In SL class library MyLib, I have a image say my.png. Then I want to use it in code behind I tried following way: StreamResourceInfo resourceStream = Application.GetResourceStream(new Uri("/MyLib;component/my.png", UriKind.Relative)); BitmapImage image = new BitmapImage(); image.SetSource(resourceStre...

Real-time image slicing for Deep Zoom and Silverlight 4

Is there an example where the Deep Zoom images will prepare dynamically in real time? Is it even possible with Silverlight 4? So basically, whatever the Deep Zoom composer is doing under the hood should happen in real-time, on demand... ...

Silverlight: Use reflection to get the BindingExpression (and value) for controls having a ContentProperty

Hello, I need to use reflection to get the binding value in a control that is a DataGridTemplateColumn (e.g HyperLinkButton). Does anyone know how I might do this? It seems simple enough to do this with a TextBlock because it has a “TextProperty” dependency property, but I can’t seem to get a binding expression from a control that does ...

Validating Application Settings Key Values in Isolated Storage for Windows Phone Applications

Hello everyone. I am very new at all this c# Windows Phone programming, so this is most probably a dumb question, but I need to know anywho... IsolatedStorageSettings appSettings = IsolatedStorageSettings.ApplicationSettings; if (!appSettings.Contains("isFirstRun")) { firstrunChe...

DataContext, DataBinding and Element Binding in Silverlight

I'm having one hell of a time trying to get my databinding to work correctly. I have reason to believe that what I'm trying to accomplish can't be done, but we'll see what answers I get. I've got a UserControl. This UserControl contains nothing more than a button. Now within the code behind, I've got a property name IsBookmarked. When I...

Silverlight 4 RichTextbox Paragraph Margin or similar?

Hi All, I'm trying to add bullets to the SL4 RichTextBox. Using the Run / Paragraph objects and adding the correct bullet child seems to be an easy approach. However, when I want to apply a bullet to an existing paragraph, I would like to indent the content of the paragraph. How can apply this kind of styling to the paragraph? The margin...

Silverlight 4 Trusted Application - Can I drag widgets outside the window?

I have a feeling this really isn't possible, but (for example) would it be possible to implement a trusted Silverlight 4 filesystem browser that allows me to drag files from within the Silverlight application to another application on my desktop? ...

Sorting Listbox in Silverlight (Sketchflow)

I have a Listbox with multiple columns and bound to a data source (XML) as shown below. <ListBox x:Name="lstBox1" Background="#FFC5EFFD" Margin="7,50,10,15" ItemTemplate="{StaticResource ItemsPanelTemplate1}" ItemsSource="{Binding BPICollection}" BorderThickness="0"/> I'm trying to figure out how to sort a particular column in the li...

Make silverlight object in the center of page

Hi all When I create a Silverlight project in the Visual Studio, then build it, the VS would popup a page with the silverlight that I just made.But that silverlight object always on the left-up corner, is there any way to make it in the horizontal center of the page? Best Regards, ...

assign a xaml file in a frame source dynamically

I have this code in a xaml file now in a event handler code i want to assign a xaml file in a frame source dynamically the code in xaml file is .. <navigation:Frame Name="ProjectTab" Grid.Column="1" Grid.Row="2" Source="/ProjectTab.xaml"/> here this assignment of source is working but how to do that in a .cs file. ProjectTab.Sourse...

How to add a menu item in a xaml file

Hi there.. I am new in silverlight .. unlike windows form ,I am unable to find menu item in silverlight . How to add menu item in xaml file. I have to do this Thanks ...

Mixing Silverlight-Specific System.Xml.Linq dll with Non-Silverlight System.Xml.Linq dll

I have a Logic layer that references Silverlight's System.Xml.Linq dll and a GUI that is in WPF (hence using the non-Silverlight System.Xml.Linq dll). When I attempt to pass an XElement from GUI project to a method in the Logic project, I am getting (basically) "XElement is not of type XElement" errors. To complicate matter, I am unable ...

Pass value from another page to MainPage.xaml in Silverlight when using Navigation?

I have a Page in Silverlight which is Navigated from the MainPage.xaml, called OpenPage.xaml, I then want to pass a value back to the MainPage.xaml - this OpenPage.xaml is called using this: NavigationService.Navigate(new Uri("/OpenPage.xaml", UriKind.Relative)); From the mainpage - this is not a child of the MainPage as the RootVisua...

Silverlight - Closing a Service

Hello, I'm working on a Silverlight application that works with WCF services. While loading the service metadata in my browser, I noticed that it provides the following code: class Test { static void Main() { myServiceClient client = new myServiceClient(); // Use the 'client' variable to call operations on the ...

Could not load file or assembly ‘System.Web.Silverlight’

I really need some help with this as I have been trying to fix this for months and I can't figure it out. I run an online chess site written in Silverlight 3.0 The architecture is Silverlight Client connecting to a WCF service that reads and writes data to a SQL Server database. It is hosted on Godaddy, Once every so often I get the...

Very basic Silverlight binding question

I have a custom UserControl called (for instance) MyPanel, and I want to use it in another XAML file. I would like to set a property of MyPanel, such as "Title" in the XAML file into which MyPanel is placed, as follows: <UserControl x:Name="ContainerControl"> <local:MyPanel Title="Whatever I Want" /> </UserControl> I would like f...

Gratuitous use of System.Runtime.Serialization attributes?

Is there any cost/drawback (apart from typing too much) to adorning a class with System.Runtime.Serialization attributes (like [DataContract]) such that it can be used locally as a direct reference to a desktop Client project or as a type for a WCF service? The goal here is to write a data-tier class that can be used in both rich client ...

Silverlight tests not working unless RDP connection open

I have a few Silverlight UI tests that I'm automating with White. These tests are subsequently run by a TFS build agent, which is running interactively so it can access the desktop. The build passes if I have a Remote Desktop connection open to the build agent as the tests are run; I can see the mouse pointer moving around. When the t...

How does one change the background color for a loading out-of-browser Silverlight 3 application?

When running our Silverlight 3 application out-of-browser, startup takes a little time, but it's long enough to be noticeable. During this startup, the background of the window hosting the application displays an ugly white background color. When running in-browser, we have a splash screen, but that's loaded via JavaScript of course. ...

Reposition element in Bing maps MapLayer Silverlight

How do you reposition an element within a maplayer? I've successfully added a UIElement to my MapLayer, and it works great! Aside from the AddChild method, I can't figure out how to update the position of my UIElement. Thanks UPDATE Looks like the methods I need are accessible statically through the MapLayer class. Hope this helps any...