silverlight

How to load XML with special characters using XDocument.Load

**This is for silverlight application. I have a stream with xml data, which after loading massage the data and generate final file. I start by load using XDocument.Load(stream). One of the file was failing to load and after some research I foung out that one of the element has a value of 'First & Second' and load fails on hitting &. I...

DataPager EventArgs

I'm using a DataPager control in my silverlight application. I have different pagers for different DataGrids and want to use the same event handler for the PageIndexChanged event for all of them. The delegate must take an EventArgs object as an argument. Can I use this object to "get back" to the control from which the event was fired?...

A viewmodel's role beyond databinding?

I'm a bit confused as to what a viewmodel's role is beyond databinding. I have a menu built in silverlight. The menu has x number of menu items which is determined at runtime. One of the features I would like to add to this is that each menuitem has a different text colour when hovered over. Is it the role of the view to have a colour s...

What's the difference between Path and Polygon control? + issues when designing custom drawing user control

I'm starting to design a custom control with rather complex drawing. It will be a kind of chart (a kind of radar chart). It will be composed of a few axises with labels, line-regions (like spider-network) and filled shapes. The main question is what's the difference between using Path control and Polygon control? What's better to use he...

How can I collapse Silverlight DataGrid Groups using MVVM?

I'm using MVVM in a Silverlight application. So I use a PagedCollectionView as property of my View Model to bind it to a DataGrid ItemSource. But I have this requirement: "all groups in the Grid should be collapse when the user control is loaded.". As I'm using a Page collection View I used this code: this.PinesView = new PagedColl...

Why might a silverlight ListBox on Windows Phone not allow me scroll all the way down to the bottom?

I have a ListBox in a grid that gets databound when the page loads... pretty straightforward. The problem I'm having is that, after the box is databound, I can scroll... but not all the way to the bottom of the list. It stops an item or two short and won't let me scroll anymore. Here's the listbox XAML: <Grid x:Name="ContentGrid" Grid.R...

Custom RIA Authentication

Following the steps in this post: http://forums.silverlight.net/forums/t/177042.aspx Where/How do I add the [Key] attribute on the Name property of the IAuthentication where User is one of my ADO.Net Entity objects? My options so far seem to be: In the designer codebehind of me ADO.Net Entity Model. Create a partial User class and ad...

Visual Studio 2008 Crystal Report Reference files.

Hi all, I am using Visual Studio 2008 and CR XI R2 for a web application built in silverlight. currently I am having a problem with showing a dynamic image on a crystal report. I was told that the reference file added in the project might be old version, so I replaced the reference files to be 11.5x version from 10.5x version. I r...

Should I use MEF or Prism for my Silverlight project?

Hi! My team(3 developers) will be building a Silverlight LOB application. This is the first Silverlight project for us. We've been doing mostly Winforms. We'll be using Silverlight4 / VS2010 / possibly WCF RIA Services, and ASP.NET Web application to handle authentication and host the silverlight pages. We need a way to.. Modularize t...

SL 3 navigation not working!

Hey Guys I converted all my existing Silverlight app UserControls to Pages so I could use the Navigation Framework. Anyway so I created a UserControl called MyFrame, which would host all the pages. In my App.xaml.cs I have the following to make sure that MyFrame is loaded when the App loads: private void Application_Startup(object se...

Silverlight MouseMove: find missing points during a movement

In an application in Silverlight I'm working on, I need to track the moves of the mouse. My problem is that using the MouseMove event, I don't have a continuous set of points if the user moves the mouse fast enough (if I add each point in a list I can have (10,10) en then (20,20)...) I'd like to have ALL points where the mouse has been ...

Is it possible to make customizable WPF styles?

I really like WPF because of its awesome skinning support by changing resourcedictionaries on the fly, but the catch is, the styles must be made by designers in XAML. My client needs a skinnable UI where the end users can make skins themselves. My question is - In Photoshop, you can take any image, and add a color overlay to change all ...

Silverlight - server side initialization

I am new to SilverLight and also web development. When the webserver application for the Silverlight app starts up I want to kick off some processes (server side) .. how do I do this .. there is no Main() or any other way I can see of doing this. I have a feeling it is to do with the html tag on the startup page which currently point to...

Silverlight (RIA Services) spontaneous culture changing

My RIA enabled Silverlight Application is setting the thread culture in the App constructor (this is absolutley okay since it is an intranet application and will never ever be used by someone who is not german): public App() { InitializeComponent(); Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE"); } It does what...

How to open window pop-up from Silverlight Out-of-Browser?

I need to open window pop-up from Silverlight Out-of-Browser application. I've added parameter <param name="enablehtmlaccess" value="true" /> in Index.html, but executing this from code behind: HtmlPage.Window.Navigate(new Uri(myUrl), "_blank", myFeatures); still returns error: Silverlight OOB Error: The DOM/scripting bridge is disa...

WPF: How to programmatically utilize the ErrorTemplate of an Control?

Hi, is there a way to programmatically set and remove the ErrorTemplate of an Control without the whole Validation mechanism? Basically, what I'd like to do, is to retrieve the ErrorTemplate of an Control at some point like this: ControlTemplate errTemplate = Validation.GetErrorTemplate(myTxtBx); and temporarily use it as it's Contro...

silverlight, xaml, threading problem

Hi! I want to have a thread, that polls the webservice. Howerver the thread doesnt work ... xxx.xaml.cs: public class Alpha:Page { // This method that will be called when the thread is started public void polling() { while (true) { Thread.Sleep(1000); ...

Insert at caret position with a Silverlight textbox

In WPF you can insert at the caret position using the CaretIndex property. However this seems to be missing in the Silverlight textbox control. Is it possible using a different technique? ...

How to deal with the new line character in the Silverlight TextBox

When using a multi-line TextBox (AcceptsReturn="True") in Silverlight, line feeds are recorded as \r rather than \r\n. This is causing problems when the data is persisted and later exported to another format to be read by a Windows application. I was thinking of using a regular expression to replace any single \r characters with a \r\n,...

Pasting non-text data into browser-based apps

Imagine I want a user to be able to copy-paste a selection of pixels from MSPaint into a browser-based app. Is this possible using JavaScript in any current browsers? Will it become possible in HTML5? If not, is it feasible using something like Flex/Silverlight, or is it simply not possible at this time, and you'd have to save a file and...