silverlight

How can I upload a file to a Sharepoint Document Library using Silverlight and client web-services?

拜拜、爱过 提交于 2019-12-21 06:28:36
问题 Most of the solutions I've come across for Sharepoint doc library uploads use the HTTP "PUT" method, but I'm having trouble finding a way to do this in Silverlight because it has restrictions on the HTTP Methods. I visited this http://msdn.microsoft.com/en-us/library/dd920295(VS.95).aspx to see how to allow PUT in my code, but I can't find how that helps you use an HTTP "PUT". I am using client web-services, so that limits some of the Sharepoint functions available. That leaves me with these

XAML to Html and vice versa

旧时模样 提交于 2019-12-21 05:47:30
问题 I'm currently working on a SilverLight text editor for my site control panel, I almost done with that, but now I need to convert XAML to Html and vice versa (as you probably know Silverlight's RichTextBox returns XAML ) So I've to convert it to Html. Any idea how can I handle this ? 回答1: Well, it's just XML. So convert Section and Paragraph elements to their appropriate HTML equivalents ( p and div , probably) and do so for the inlines as well ( Run expands to just the text, probably, Span

Silverlight Toolkit ; Pie Chart Colors

不问归期 提交于 2019-12-21 05:22:17
问题 I have a huge problem that I can't figure out. Let's say that I have five different fruits, and I want each of them to be associated with a certain color. Let's say that I have three "baskets" which contain zero or more of said fruits. When I Make Pie charts for my three baskets, Each wedge is just some random color that is presumable picked by the control. How would I say, make the blueberries blue, bannanas yellow, etc. in the chart? I know this is a weird question, but I can't think of a

Can I add dll to Silverlight 3 application?

蓝咒 提交于 2019-12-21 04:59:52
问题 I am tring to add dll file to my Silverlight application but get error which says that I can't add reference which wasn't built with Silverlight runtime. Is there any solution? Thanks. 回答1: Try to use WCF Service to connect to your DLL.I did that way and it solved my problem. 回答2: Try creating an empty Silverlight class library, then add all your code to that project, then you will be able to add it to a silverlight application as a reference. If this does not meet your needs, upgrade to

Attach behaviour to all TextBoxes in Silverlight

时间秒杀一切 提交于 2019-12-21 04:54:15
问题 Is it possible to attach behavior to all TextBoxes in Silverlight application? I need to add simple functionality to all text boxes. (select all text on focus event) void Target_GotFocus(object sender, System.Windows.RoutedEventArgs e) { Target.SelectAll(); } 回答1: You can override the default style for TextBoxes in your app. Then in this style, you can use some approach to apply a behavior with a setter (generally using attached properties). It would something like this: <Application

WriteableBitmap memory leak in Windows Phone 8

隐身守侯 提交于 2019-12-21 04:49:16
问题 I'm having a memory leak whenever I create any instance of a WriteableBitmap . I've tried multiple suggestions on stackoverflow and other forums, but nothing is working. The basic flow of my test app is this: Select an image with the PhotoChooserTask Use the Stream from the PhotoResult object to create a WriteableBitmap . That's it. Nulling the variables and calling GC.Collect() only solves part of the problem. It keeps the app from allocating memory until the app crashes, but even though the

Getting a Stream from an absolute path?

假如想象 提交于 2019-12-21 04:42:19
问题 I have this method: public RasImage Load(Stream stream); if I want to load a url like: string _url = "http://localhost/Application1/Images/Icons/hand.jpg"; How can I make this url in to a stream and pass it into my load method? 回答1: Here's one way. I don't really know if it's the best way or not, but it works. // requires System.Net namespace WebRequest request = WebRequest.Create(_url); using (var response = request.GetRespone()) using (var stream = response.GetResponseStream()) { RasImage

Silverlight实用窍门系列:6.Silverlight弹出窗口以及DataGrid分页【附带实例源码】

浪尽此生 提交于 2019-12-21 04:41:11
继上节所讲,在上一节中,我们讲述了DataGrid绑定webService传输过来的XML数据实体类集合。在本节我们将这个DataGrid移动到一个ChildWindow中去。然后实现ChildWindow的弹出效果。以及对这个DataGrid的分页效果。实例源代码也是在上一节的基础上做一些改动而来。 一.Silverlight弹出子窗口。首先我们右键点击项目-->“添加”-->“新建项”-->选择“Silverlight子窗口”,重命名为“PopWindow.xaml”然后点击确定。就添加Silverlight的子窗口文件了。在这里,我们将DataGrid解析和绑定数据的XAML代码和CS代码转移到PopWindow页面中去。然后,我们在MainPage页面添加一个按钮。为这个按钮的点击事件添加以下语句: PopWindow popwin = new PopWindow(); popwin.Show(); 在这里我们实例化ChildWindow,然后调用Show()函数,即可弹出一个小窗口。 二.关于DataGrid的分页,我们使用DataPager来分页。在这里,我们贴出DataPager的代码如下: <sdk:DataPager Margin="28,0,0,14" PageSize="10" Height="30" HorizontalAlignment="Left"

Workaround for some WPF features that are missing in Silverlight

拥有回忆 提交于 2019-12-21 04:29:12
问题 I’m porting a WPF app to silverlight 2, and have come across several WPF features which are presently missing from SL. Could anyone help me with equivalents or suggest workarounds. I want to handle clicks and double clicks on a textbox embedded in a list box. The WPF implementation uses PreviewMouseLeftButtonDown/Up on a listbox control. How can this be done in silverlight, it seems that PreviewMouseLeftButtonDown/Up are missing in silverlight. I want to handle button presses (F2/Delete) on a

How to dynamically discover all XAML files in all modules in a Silverlight prism app

…衆ロ難τιáo~ 提交于 2019-12-21 04:12:40
问题 Is there an easy way to dynamically discover all the XAMLs files within all the currently loaded modules (specifically of a Silverlight Prism application)? I am sure this is possible, but not sure where to start. This has to occur on the Silverlight client: We could of course parse the projects on the dev machine, but that would reduce the flexibility and would include unused files in the search. Basically we want to be able to parse all XAML files in a very large Prism project (independent