silverlight

How do I centralize common code in silverlight with a classical Client/Server design?

The setting: I got a silverlight application and a webservice both want to use the same code. Here my problem: If make an normal dll the silverlight Application say's it can not reference it. If I make an Silverlight dll the Webservice can not reference it. I don't like duplicate code how can I share code between my Silverlight ap...

Clock Application

Hi, I am creating a clock application in C#.Net.I have images for each digits from 0-9. I have a timer in the main page constructor which ticks every seconds DispatcherTimer tmr = new DispatcherTimer(); tmr.Interval = TimeSpan.FromSeconds(1); tmr.Tick += new EventHandler(tmr_Tick); tmr.Start(); void tmr_Tick(object sender, EventArgs e)...

ASP.NET or ASP.NET MVC or Silverlight or a mixture ?

I want to start to implement a new web application (with many user interactions) from the scratch. I have 2 years experiences with ASP.NET. Now Microsoft offers ASP.NET MVC. I have read a little about the concepts behind, but I am not sure if I should use the classic ASP.NET variant or the new one. Perhaps it makes sense to mix it ? Or s...

Using RIA Services FilterDescriptor from code behind

Hi, I was wondering if it's possible to use the FilterDescriptor control from code behind? On the page load of my form I set the datasource of a grid in the code behind, not using a DomainDataSource control, like: TestDomainContext context = new TestDomainContext(); dataGridEmployees.ItemsSource = context.EmployeePositions; context.Lo...

How to programmatically create customcontrol and change its values in Silverlight 4

Hi! I want to create a custom tabcontrol class which has an icon before the text, and I want to be able to change the icon in the constructor of the new tabcontrol. I use implicit styles in Silverlight 4, and the custom tabcontrol should not have any xaml of its own, just the class and the implicit xaml style in my App.xaml. I cannot...

silverlight full screen

i use silverlight fullscreen changing normally when i click the fullsceen and exit fullscreen button But when i change it through code without clicking it do the exit but not the fullscreen, which means false is working true doesn't work. Any ideas ?? ...

Silverlight combobox performance issue

Hi, I'm facing a performance issue with a crowded combobox (5000 items). Rendering of the drop down list is really slow (as if it was computing all items before showing any). Do you have any trick to make this dropdown display lazy? Xaml code: <Grid x:Name="LayoutRoot"> <StackPanel Orientation="Horizontal" Width="200" Heigh...

Instantiate ItemsPanelTemplate

I'm trying to create a ItemsControl that has a separator between items, for example a control to create a navigation bread crumb. I want the control to be completely generic. My original method was to create extend ItemsControl, add a SeparatorTemplate property, and then have the class add separators to the ItemsHost of the ItemsContro...

How to put animation effects on C# in WPF

I am using wpf application where i am using an image. I want to put some animation effects on it. When a user clicks on button it dissapear from the screen and move away from left to right or some this kind of animation. What classes do i need to use. Can I use silverlight or flash or something else here ...

How to save esri map as an image file

Hi, I am using Silverlight 3 and I am trying to take a screenshot of esri map. I was able to take a screenshot and save as a file for silverlight controls, but when I try to access Esri map image, I get "Pixel access not allowed" error. I heard this is because of different domain (I am trying to get map image on the client side, and...

ExpressionMediaPlayer to play .mpeg

I'm trying to write a Silverlight application that reads a media file from a database (most likely a .mpeg or .mpg) and play it on the fly using either a Silverlight MediaPlayer or ExpressionMediaPlayer. When I try using Expression Media Player it plays .wmv and .mp4 files but NOT .mpeg or .mpg file extensions. Is this even possible? If ...

Silverlight communication/commands/events? between view and viewmodel?

I am just getting into the Silverlight world, and wish I didn't learn WPF first so I wouldn't be so frustrated with the little things that are missing. In WPF I was using commands (RoutedUICommand) for my view/UI to handle "events" (by event I mean something the user did) and passing them to the viewmodel. Now in silverlight I find tha...

Problem during RIA authentication

Hi I've built an authentication service in RIA that inherits from DomainService and IAuthenticate. The problem is following: When LoginOperation fails (loginOperation.LoginSuccess is false) due to wrong credentials, everything is ok and it is reported to the user. However, when login succeeds, I get throw a really weird exception: {...

Preserve control state in Silverlight's TabControl

Is there any way to preserve the control state within a Silverlight TabControl? I found this solution for WPF, but it doesn't compile in a Silverlight app: http://www.pluralsight-training.net/community/blogs/eburke/archive/2009/04/30/keeping-the-wpf-tab-control-from-destroying-its-children.aspx ...

Set property on usercontrol that can be used in custom panel in control... Silverlight

I have a simple usercontrol that uses a simple custom panel where I just overrode the Orientation and Measure functions. What I want to do is to have a property in the usercontol to control the orientation So I basicaly have UserControl --> Listbox --> MyPanel And I want a property for the usercontrol that can be set in xaml (of...

Silverlight Control Disable/Remove Events

I have a scenario where a control has an event wired up in XAML, say a Button.Click. Somewhere else in my code, a security check is applied which mean I need to disable said event, but I do not have access to the normal -= syntax to remove it. How else can I remove or disable this event? Thanks, Dave ...

Silverlight ~ MVVM ~ Dynamic setting of Style property based on model value

I have a class called Question that represents a question and it's answer. I have an application that renders an ObservableCollection of Question objects. Each Question is rendered as a StackPanel that contains a TextBlock for the question verbiage, and a TextBox for the user to enter in an answer. The questions are rendered using an Ite...

Silverlight 4 RichTextBox - can't restore Xaml with text containing curly braces

We have a Silverlight application using the RichTextBox as a rich text editor for the user to create emails. We actually have our own serializer but essentially we are saving and restoring the Xaml. As far as I can tell it is impossible to restore any text containing curly braces. You can demonstrate this fairly easily by creating a Ri...

silverlight socket: implement two-way communications?

I basically try to reproduce the Socket example from here: http://www.silverlightshow.net/items/Sockets-and-their-implementation-in-SL2-Beta-1-including-a-chat-like-example.aspx. I have been able to get the message send from Client To Server using the following code. But how can the server response to client? Client Code: String safeHo...

ways to convert current screen into array of bytes in silverlight3

Hi, I would like to know if there is any other way than using WriteableBitmap to convert the current screen into array of bytes. Because I am trying to get a screenshot of Esri map, but I am getting "pixel access not allowed" error. Please help. Thanks, ...