silverlight

Why doesn't MediaElement work in Silverlight?

百般思念 提交于 2020-01-13 06:06:26
问题 When I run my Silverlight app, this code doesn't play a video at all: <MediaElement Source="winvideo-201DataGridPreview.wmv" AutoPlay="True" AudioStreamIndex="2" Margin="10" Height="200" Width="200"/> From all of the examples I can find of MediaElement, it seems to be the correct syntax, etc. Is there anything I'm forgetting? 回答1: Edward, based on your XAML check: 1) that the WMV file is in the appropriate encoding format, 2) that the WMV file is located alongside where your XAP file is (I'd

Sharing state between ViewModels

假如想象 提交于 2020-01-13 04:28:25
问题 I have two ViewModels that present the same Model to different Views. One presents the model as an item in a ListBox , the other presents it as a tab in a TabControl . The TabControl is to display tabs for the items that are selected in the ListBox , so that the tabs come and go as the selection changes. I can easily synchronise the two controls by adding an IsSelected property to the Model and binding the ViewModels to it (a bit like this), but this will clutter the Model with presentation

Silverlight: Multiple project sharing the same style files

♀尐吖头ヾ 提交于 2020-01-12 19:47:36
问题 I have multiple silverlight project that I would like to use the same styles, colour scheme, and some templated objects. How do I accomplish this? 回答1: One way to do this would be to create a new silverlight class library which would be your shared theme/style assembly which would be referenced by the other silverlight projects. This assembly would have one or more Resource Dictionary XAML files in it which could define all of your styles, brushes and templates. You could even set up some

Silverlight: Multiple project sharing the same style files

孤人 提交于 2020-01-12 19:45:50
问题 I have multiple silverlight project that I would like to use the same styles, colour scheme, and some templated objects. How do I accomplish this? 回答1: One way to do this would be to create a new silverlight class library which would be your shared theme/style assembly which would be referenced by the other silverlight projects. This assembly would have one or more Resource Dictionary XAML files in it which could define all of your styles, brushes and templates. You could even set up some

Style the MouseOver on a Silverlight/WPF button

人走茶凉 提交于 2020-01-12 13:02:16
问题 Struggling with styling the mouse over for a button ... I have managed to style the button (solid red), but I would like for it to change to solid black whenever a mouse over occurs. I am new to XAML, and I can see that it wants some type of story board/animation ... not sure exactly how to do this. Any help would be greatly appreciated. 回答1: This is different from WPF to Silverlight. In WPF, the answer from Rob is correct. In Silverlight, this won't work. Silverlight uses the

Style the MouseOver on a Silverlight/WPF button

那年仲夏 提交于 2020-01-12 13:01:59
问题 Struggling with styling the mouse over for a button ... I have managed to style the button (solid red), but I would like for it to change to solid black whenever a mouse over occurs. I am new to XAML, and I can see that it wants some type of story board/animation ... not sure exactly how to do this. Any help would be greatly appreciated. 回答1: This is different from WPF to Silverlight. In WPF, the answer from Rob is correct. In Silverlight, this won't work. Silverlight uses the

Handling Silverlight onerror callback

半腔热情 提交于 2020-01-12 09:58:51
问题 The silverlight object tag accept an 'onerror' parameter which calls back to a piece of javascript of your choice. The default implementation which is generated by the Visual Studio template assembles a descriptive message and throw it as an Error (which lets e.g. IE display the little warning triangle). It seems to me that each time this callback is fired our silverlight instance is dead and you need to refresh the page. Is this a reasonable deduction? Another issue is how to best handle

Damping Effect of Spring-Mass System (or is this ElasticEase?)

微笑、不失礼 提交于 2020-01-12 06:59:11
问题 I'm trying to emulate an animation effect in code (almost any language would do as it appears to be math rather than language). Essentially, it is the emulation of a mass-spring system. I've been looking at WPF/Silverlight's ElasticEase and this appears to be pretty close to what I'm looking for, but not quite. First of all, here's what I'm looking for - an object, travelling a certain number of seconds, hitting a location and immediately slowing down to ocsillate for a certain number of

Best resources to learn WCF RIA Services

寵の児 提交于 2020-01-12 05:45:09
问题 What books, videos, articles are you looking at to learn how to use the newly released [WCF RIA Services][1] for Silverlight? 回答1: The starting point would be http://www.silverlight.net/getstarted/riaservices/ Sample code: http://code.msdn.microsoft.com/RiaServices 回答2: This is a great training course with guided labs about WCF RIA Services with Silverlight 4: http://channel9.msdn.com/learn/courses/Silverlight4/ 回答3: EDIT: I will continue to update this list with community answers. Please let

Union two ObservableCollection Lists

杀马特。学长 韩版系。学妹 提交于 2020-01-12 05:18:05
问题 I have two ObservableCollection lists, that i want to unite. My naive approach was to use the Union - Method: ObservableCollection<Point> unitedPoints = observableCollection1.Union(observableCollection2); ObservableCollection1/2 are of type ObservableCollection too. But the Compiler throws the following error for this line: The Type "System.Collections.Generic.IEnumerable" can't be converted implicit to "System.Collections.ObjectModel.ObservableCollection". An explicite conversion already