silverlight

Silverlight 4 Clipboard Security Exception "access is not allowed" ?

Hey, I'm new in Silverlight and i am doing some tests. With my current test I try to display in real time the current Clipboard content. But there is a weird behaviors with this code : namespace SilverlightTest { public partial class MainPage : UserControl { private Timer _timer; public MainPage() { InitializeCompo...

Silverlight 4 and out of browser

Hi, Does any one know if its possible to animate app.current.mainwindow.width so that you get a nice animation with easing if you programatically resize the oob apps window. Thanks. ...

Load image dynamically on Silverlight

I have a Silverlight app that has to load an image dynamically, depending on the image name. The approach that im taking right now is passing the image name by query string to the page and passing that as a param to the Silverlight objet tag This is the query string passed Response.Redirect("Build.aspx?img=" + this.PictureUploader.Pos...

Silverlight MouseLeftButtonDown event not firing

For the life of me, I can not get this to work. I can get MouseEnter, MouseLeave, and Click events to fire, but not MouseLeftButtonDown or MouseLeftButtonUp. Here's my XAML <UserControl x:Class="Dive.Map.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/...

How do I change the spacing between fields in a DataForm?

How do I change the spacing between fields in a DataForm in Silverlight? I've tried editing the template but cannot find what I need. I thought all I needed to do was change the MinHeight and Margin of the DataField style, but that doesn't seem to do it. <Style TargetType="dataFormToolkit:DataField"> <Setter Property="IsTabStop...

Silverlight 4 MediaElement AG_E_NETWORK_ERROR

Trying to play a video in SL and getting a AG_E_NETWORK_ERROR error. <MediaElement Source="http://www.archive.org/download/MIT18.02F07/ocw-18_02-f07-lec25_300k.mp4" /> How can I play this video in SL ? ...

How to create the border of a dynamic canvas in Silverlight?

Hi I am creating a Canvas in code behind like below: Canvas musicPlayerCanvas = new Canvas(); musicPlayerCanvas.Background = new SolidColorBrush(Colors.White); musicPlayerCanvas.Height = 80; musicPlayerCanvas.Width = 1018; LayoutRoot.Children.Add(musicPlayerCanvas); musicPlaye...

Does Silverlight 4 support drag and drop from app to desktop ?

I have seen that SL4 support drag and drop from the desktop to the application, but is it possible to drag and drop from the application to the desktop ? Thanks, ...

How do I go about adding a website to Silverlight

Hi, Say I had (foolishly) setup a Silverlight project in VS and failed to setup a supporting website at time of instantiation are there any steps I can take to add one retrospectively? Many thanks. ...

Silverlight styles, an old school html style?

Hi I'm looking for some free silverlight styles to play with. I'd ideally like a style which makes a silverlight page's controls (textbox, etc), look as though they came from a html page. Also after some other styles to play with, any good free libraries out there? thanks ...

Silverlight 4 RC File Upload with Upload Progress: how to?

It's been stated that one of the new features of Silverlight 4 RC is that it now supports upload progress. I'm assuming this means it's possible to make an upload file progress bar without "chunking" but I can't figure out how to do this, so how do we do this? Source code examples would be great. Thanks! ...

Diagramming in Silverlight MVVM- connecting shapes

Hi, have I have a quesition regarding MVVM pattern in the uses case of diagramming. What I have so far is a list of Items which are my Shapes. ObservableCollection<ItemsViewModels> Items; and a Collection of Connection of Items ObservableCollection<ConnectionViewModel> Each ItemViewModel has an ID and a ConnectionViewModel has t...

How would MVVM be for games?

Particularly for 2d games, and particularly silverlight/wpf games. If you think about it, you can divide a game object into its view (the graphic on the screen) and a view-model/model (the state, ai, and other data for the object). In silverlight, it seems common to make each object a user control, putting the model and view into a sing...

Why does KeyDown event not have access to the current value of bound variable?

In the example below: I start program, type text, click button, see text above. Press ENTER see text again. BUT: I start program, type text, press ENTER, see no text. It seems that the KeyDown event doesn't get access to the current value of the bound variable, as if it is always "one behind". What do I have to change so that wh...

Adding image to RichTextBox programatically does not show in Xaml property

Trying to add an image to a RichTextBox progamatically from a Stream. The image displays in the text box, however when reading the Xaml property there is no markup for the image. private void richTextBox3_Drop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { FileInf...

How to mock a RIA service

Is there any ability to mock methods that are provided with RIA Services? I would like to test my Silverlight App without communication to the server side... I see a following approach: create a separate interface; add it to "base classes" for my RiaService; define each autogenerated RIA-method in this interface; insert dependency so...

Silverlight 4 launch a trusted application into the browser ?

Hi guys, I just lost 5 hours looking for a answer which i haven't been able to find :p First, I'd like to force a trusted application (i need to access the file system) to display into the browser. Based on what i found on google a trusted application must be installed and launched as a desktop application (also called out-of-browser a...

Can't add Silverlight App with "Enable .NET RIA Services" to existing project

I can create new Silverlight App with ".NET RIA Services" enabled. But when I try to add Silverlight App into existing solution in the "New Silverlight Application" the "Enable .NET RIA Services" checkbox is disabled. Why? How can I add Silverlight App into existing solution? Thanks. P.S. Environment description: Win Vista x64, VS200...

CollectionViewSource.GetDefaultView is not in Silverlight 3! What's the work-around?

The CollectionViewSource.GetDefaultView() method is not in Silverlight 3. In WPF I have this extension method: public static void SetActiveViewModel<ViewModelType>(this ViewModelBase viewModel, ViewModelType collectionItem, ObservableCollection<ViewModelType> collection) where ViewModelType : ViewModelBase { Debug.Assert(col...

right click on grid row

hi to all of you, problem is , that whenever the grid's row is right clicked the selected item is null.how do i make a the grid's row selected when any row was right clicked? thanks Jamal ...