silverlight

wcf OperationContextScope dispose

扶醉桌前 提交于 2019-12-23 06:10:33
问题 I have a c# app that calls a wcf serivce using OperationContextScope scope = new OperationContextScope(i.InnerChannel); I need to leave the connections open so I cannot dispose the OperationContextScope with the Using statement. However when looking at the memory profiler I am seeing hundreds of OperationContextScope's. I need to dispose the scope but when I call .Dispose() I get an error saying its out of order. I have no idea why I cannot dispose the scope. Does anyone know how to correctly

Sharing assembly code between WPF, Silverlight and Windows Phone: quite impractical for big projects !

烈酒焚心 提交于 2019-12-23 05:29:27
问题 It is said here: http://blogs.msdn.com/b/mikeormond/archive/2010/12/09/writing-cross-platform-xaml-applications.aspx Within Visual Studio, if you add files to the project via “Add Existing Item”, and select the “Add As Link” option you can work on the same file from multiple projects. Oh my I'm on a project which have multiple countries, brands, components layers and each time I will add a file you want me to "Add as Link" ? This is a nightmare maintenance ! Is there any other solutions ? 回答1

Windows Phone 7 – WebClient与HttpWebRequest的使用差别

点点圈 提交于 2019-12-23 05:28:46
这篇文章将先针对WebClient做说明,另外会接着介绍相关于HttpWebRequest的使用,以及这二个类别之间的差异与对于 WP7 的一个影响。 在讨论WebClient与HttpWebRequest之前,要先了解一下一个蛮重要的类别:WebRequest类别。 ‧WebRequest 它是.NET Framework进行处理网际网路资源要求(WebRequest)与回应(WebResponse)的主要模型。属于Abstract类别。 没有办法直接透过建构子实作,需使用: WebRequest.Create 方法来建立实体来进行运用。该类别还有其他相关不同 于通讯协定的类别,包括:WebRequestMethod.File、WebRequestMethod.Ftp与WebRequestMethod.Http。更详细的使 用方法,可以参考< 如何使用WebRequest类别要求资料 >这篇有详细的说明。 然而,在Silverlight所支援的Syste.Netm命名空间里,目前仅支援:WebRequest、WebResponse、WebClient与 HttpWebRequest等类别,虽然缺少了WebRequestMethod.Ftp或FtpWebRequest就代表Silverlight没法支援FTP了吗? 答案是否定的。因为WebClient还是可以做到相同的效果

Silverlight DataGrid - Binding to a Collection of Collections of objects

我与影子孤独终老i 提交于 2019-12-23 05:16:05
问题 Problem: The data I'm trying to display is essentially a collection of collections of some object. So the rows can be any number, normal for a datagrid, and the columns are also any number. That's not so normal for a datagrid. Usually you have a set number of columns and your rows vary. The datagrid cell will be either a string or a value changeable via a combobox. Attempted Solution: I tried adding columns to the datagrid dynamically, and while this worked just fine (adding them in

Is my .XAP file too big? and if so how do i make it smaller?

大城市里の小女人 提交于 2019-12-23 04:42:16
问题 I'm currently doing some work on a silverlight LOB application i wrote for a customer.. When i deploy i can't help noticing how big the xap file is (4mb) and considering it's not a massive app it seems a little unusual. I am using the telerik silverlight toolkit (but only including the required themes - 2 I think).. There's about 1mb of images (which is maybe a bit too much for a LOB app).. Is this average for a silverlight application? Whats the average size of your xap files? How would I go

Is my .XAP file too big? and if so how do i make it smaller?

久未见 提交于 2019-12-23 04:41:12
问题 I'm currently doing some work on a silverlight LOB application i wrote for a customer.. When i deploy i can't help noticing how big the xap file is (4mb) and considering it's not a massive app it seems a little unusual. I am using the telerik silverlight toolkit (but only including the required themes - 2 I think).. There's about 1mb of images (which is maybe a bit too much for a LOB app).. Is this average for a silverlight application? Whats the average size of your xap files? How would I go

How to get all methods from WCF service?

岁酱吖の 提交于 2019-12-23 04:36:34
问题 How to get list of all methods from WCF silverlight enabled service from code. I already have added service reference to Silverlight application. Can I get all methods using Reflection? If can please provide me example. 回答1: Given the type of the service class you could use the GetMethods function to get a list of all the methods through reflection: MethodInfo[] methods = typeof(TypeOfTheService).GetMethods(); foreach (var method in methods) { string methodName = method.Name; } 来源: https:/

How do you wait/join on a WCF Web Service called from Silverlight?

北战南征 提交于 2019-12-23 04:36:08
问题 If you call a web service from Silverlight like this: MyServiceClient serviceClient = new MyServiceClient(); void MyMethod() { serviceClient.GetDataCompleted += new EventHandler<GetDataCompletedEventArgs>(serviceClient_GetDataCompleted); serviceClient.GetDataAsync(); // HOW DO I WAIT/JOIN HERE ON THE ASYNC CALL, RATHER THAN BEING FORCE TO LEAVE THIS METHOD? } I would rather wait/join with the asych service thread inside "MyMethod" rather than leaving "MyMethod" after calling "GetDataAsync",

MVVM way to wire up event handlers in Silverlight

百般思念 提交于 2019-12-23 04:36:06
问题 Using an MVVM pattern in Silverlight/WPF, how do you wire up event handers? I'm trying to bind the XAML Click property to a delegate in the view model, but can't get it to work. In other words, I want to replace this: <Button Content="Test Click" Click="Button_Click" /> where Button_Click is: private void Button_Click(object sender, RoutedEventArgs e) { // ... } with this: <Button Content="Test Click" Click="{Binding ViewModel.HandleClick}" /> where HandleClick is the handler. Attempting this

Silverlight 3 Dataform - how to add fieds at runtime

故事扮演 提交于 2019-12-23 04:30:35
问题 I am creating a DataForm from dynamic data (so I can't create the columns in the xaml), I currently create columns for my DataGrid (I have not worked out how I can create a button + event in a colomn yet) foreach (var item in headings.Entities) { theDataGrid.Columns.Add( new DataGridTextColumn { Header = item.Label, Binding = new Binding(item.LocalName) }); } I cannot see any methods to add fields to a DataForm at runtime, however... 回答1: You'd be better off not creating your datagrid columns