silverlight-4.0

Implicit theme error:The property 'Content' was not found in type 'System.Windows.Controls.Control'

被刻印的时光 ゝ 提交于 2019-12-12 10:48:42
问题 I have got an error while trying to upgrade our large project to SL4. I didn't write the original theme and my theme knowlege isn't great. In my demo app I have a Label and a LabelHeader(which i have created and is just a derived class from Label with DefaultStyleKey = typeof(LabelHeader); I am styling the LabelHeader like this: <Style TargetType="themeControls:LabelHeader"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <DataInput:Label FontSize="{TemplateBinding FontSize}"

How to apply a Filter to a PagedCollectionView but prevent CollectionChanged event from firing on edit?

我与影子孤独终老i 提交于 2019-12-12 09:42:03
问题 I have a Silverlight application where a DataForm binds on a PagedCollectionView containing objects that implement IEditableObject . Whenever the user edits an object using the DataForm, the CollectionChanged event on the collection fires twice, first with a Remove action, then with an Add action. This is not what I want. I simply want to edit the object in the collection without firing the CollectionChanged event. When I try to reproduce this issue in a simple test application, it behaves as

What's a Silverlight plugin?

半腔热情 提交于 2019-12-12 06:23:21
问题 Please explain what a Silverlight plugin is. Is it a single xap file, a xaml file, a dll, or what? Please elaborate. Note: by “Silverlight plugin”, I mean one a developer would make for the browser and for Silverlight, not the Silverlight browser plugin itself. 回答1: Now that we settled what the Silverlight plug-in is vs. a Silverlight application (see Robert Harvey's answer), here is some more info on what makes up a typical Silverlight application: The application itself will be a XAP file

Silverlight json won't serialize

别说谁变了你拦得住时间么 提交于 2019-12-12 05:57:10
问题 I have been trying to serialize some json data in Silverlight. I am using the following code System.Runtime.Serialization.Json.DataContractJsonSerializer serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(stacks.GetType()); MemoryStream ms = new MemoryStream(); serializer.WriteObject(ms, stacks); StreamReader reader = new StreamReader(ms); string json = reader.ReadToEnd(); to attempt the serialization. It does not work. It was the only example I could find that did

Silverlight 2104 Error w/ MVC project as Host

点点圈 提交于 2019-12-12 05:48:45
问题 I have a really odd 2104 error occurring when I am hosting a Silverlight control in my MVC site. If I go to http://mywebsite.com/SomeController then the Silverlight application will load correctly. However, if I go to http://mywebsite.com/SomeController/Index then it fails to load and I get the 2104 error. I tried to change the Action name to something other than index, but still no luck. Right now, it's just boilerplate Silverlight control code, but I need to add some initParams to it, so I

WCF net.tcp server disconnects - how to handle properly on client side?

橙三吉。 提交于 2019-12-12 05:39:10
问题 I'm stuck with a bit of an annoying problem right now. I've got a Silverlight 4 application (which runs OOB by default). It uses WCF with net.tcp as means of communicating with the server. The client uses a central instance of the wcf client proxy. As long as everything keeps running on the server side, everything's fine. If i kill the server in the middle of everything, i drown in an avalanche of exceptions on the client side (connection lost, channel faulted etc etc). Now i'm looking for a

Silverlight 4 Capture source is not stopped

*爱你&永不变心* 提交于 2019-12-12 05:38:33
问题 I am working on a Silverlight project to record the audio on a web page. After I clicked the Pause button the code will always throw an exception: Capture source is not stopped If I put a break point on this line of code and wait there for 3-5 seconds then run the code, no exception will be threw. if (audioSink.CaptureSource.State == CaptureState.Started) (break point is on this line) Here is the code private void Pause(object sender, RoutedEventArgs e) { //System.Threading.Thread.Sleep

ICommand not working in datagrid celltemplate

て烟熏妆下的殇ゞ 提交于 2019-12-12 05:37:41
问题 This is my MainPage.xaml :- <sdk:DataGrid Margin="17,17,20,76" AutoGenerateColumns="False" ItemsSource="{Binding Students}"> <sdk:DataGrid.Columns> <sdk:DataGridTextColumn Binding="{Binding StudName}" Header="Student Name"> </sdk:DataGridTextColumn> <sdk:DataGridTemplateColumn> <sdk:DataGridTemplateColumn.CellTemplate> <DataTemplate> <Button CommandParameter="{Binding}" Command="{Binding Path=DataContext.AddCommand,ElementName=root}" Content="Add Student" /> </DataTemplate> </sdk

WCF RIA services domain service metadata

喜夏-厌秋 提交于 2019-12-12 05:35:39
问题 I am using RIA services in a silverlight application with a RIA domain service that does data transfer. I have made changes to the domain service and metadata in terms of updating methods, adding methods, putting data validation attributes on the metadata fields, etc. When I am in the position where I need to re-generate the domain service due to adding a new table, obviously the generation algorithm doesn't preserve my metadata attributes or additional domain service methods. Is there any

How to call a service when a SilverLight OOB app is closing an

瘦欲@ 提交于 2019-12-12 04:39:43
问题 I need to call a WCF service to update when my SilverLight app exits. it is an out-of-browser app and I'm using SL4. Since the WCF in SL works only async it is not possible to do on Application.Exit I tried also MainWindow.Closing which is available for OOB but this didn't work either. Tried to make the Closing function wait for the WCF Completed callback using thread locking but it just hang. Any ideas? Shahar 回答1: Save the data and submit on next launch Calling a service on exit is a tricky