silverlight

How do you set Image.Source in Silverlight(Code behind)

北战南征 提交于 2019-12-18 18:49:47
问题 I am dynamically generating an image through code-behind in Silverlight and apparently the image source doesn't accept a string or Uri as a path. How can I set the source? 回答1: How do you mean it won't accept a string as source? Are you not able to do this? Or are you saying your image is in memory and you don't know how to reference it? this.MyImage.Source = new BitmapImage(new Uri("/MyNameSpace;images/someimage.png", UriKind.Relative)); 回答2: // create a new image Image image = new Image();

Windows Phone 7 Silverlight using session

≡放荡痞女 提交于 2019-12-18 18:31:15
问题 I am creating a Windows 7 mobile Silverlight project. I use Rest api for authentication using a class say Authentication . I get an authentication token as a response and I assign it to a class property AuthToken because I need to use this in different places. Is there any way to store this AuthToken in session or any thing else. Because I did not find any session example in wp7. Thanks 回答1: You're not finding any session examples because WP7 doesn't have session as far as I know. You should

Does anyone know of a way to easily convert a PDF to a docx format programmatically

佐手、 提交于 2019-12-18 18:07:30
问题 We have a couple 3rd party systems that give us PDFs. We would like to convert those PDFs for display on the web without using an Adobe product. Ideally we would like to use Silverlight to render the PDFs but are having trouble converting from a PDF to Xaml or using docx format as a middle man. There are lots of libraries that give PDFs but that is not what we need. If there is a library out there that does this, a .net lib would be preferable but we can run the conversion using the command

How to switch UI Culture of data binding on the fly in Silverlight

懵懂的女人 提交于 2019-12-18 18:03:06
问题 I have a TextBlock control, which is data bound to DateTime property. The text displayed something like this: Thursday, October 21, 2010 I need to switch UI Culture on the fly, using something like this: Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-de"); I've tried this to force binding to recalc: var bindingExpression = textBlock.GetBindingExpression(TextBlock.TextProperty); bindingExpression.UpdateSource(); But I still see Thursday

Silverlight HTTP POST few variables, SIMPLEST example (least code)

孤街浪徒 提交于 2019-12-18 16:52:45
问题 Hello I want to post some data from silverlight to a website. I found the following link and it works... However.... This example was so elaborate it made my eyes hurt. Also.. the flex example was much cleaner/less code.. I'd say there must be a better solution... For reference.. We post 2 variables (strings) and read out the result (string). The solution from the link : 1. // C# 2. // Create a request object 3. HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(POST_ADDRESS,

Silverlight media player with frame counter

我与影子孤独终老i 提交于 2019-12-18 16:42:10
问题 I am trying to write a simple Silverlight media player, but I need the timestamp to be hh:mm:ss:ff where FF is Frame count. I used a timer in order to get ticks and calculate the frame I am in, but it seems very inaccurate. How can I count reliably the frame I am in? Does anyone know of a free Silverlight player that will do that? 回答1: Silverlight is designed to update at irregular intervals and catch-up any animation or media playing to the current elapsed time when the next frame is

ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等(一)

可紊 提交于 2019-12-18 14:58:39
平台:Vs 2010,Blend 4,Silverlight 4 调用API: ArcGis for Silverligth API(ESRI.ArcGIS.Client) 前言:本想只写一篇知识性的简单介绍下 ArcGis API,后来发觉程序做的比较复杂,不是一两篇能搞定的为了让大家能更深入的了解 ArcGis API 干脆写一个连载长篇的!写的不好请大家批评指正! 好了不说废话少说了!国际惯例先上图吧!图上实现的功能我会在后面章节中讲解! 项目准备:ArcGis API(自己找地址吧),我用的ESRI.ArcGIS.Client是1.1.0.97的版本。其它版本也应该差不多! 好了我们先建个网站项目,然后建个silverlight项目,把ArcGis Api 添加到项目中 我们先把地图加到silverlight中 Xmal中代码: <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas

With Silverlight disappearing from Chrome 45, what are my alternatives?

六眼飞鱼酱① 提交于 2019-12-18 14:56:22
问题 Since Chrome 45 will drop NPAPI support in september and with it Silverlight, what would be my alternatives beside using another browser ? I would really need to still support Chrome with my application and can't force the user to not update their main browser. Could I use a chrome extension ? Could I make them install an out of date Chrome alongside an updated one ? What else ? 回答1: Well it seems there is a solution ! I have tried IETab with Chrome Canary (v45) and the dev channel (v46) and

How to use template binding inside data template in custom control (Silverlight)

时间秒杀一切 提交于 2019-12-18 14:49:32
问题 I am trying to create control which will take ItemsSource and InnerTemplate and will show all the items wrapped in CheckBox es. The control has 2 dependency properties: public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.Register("ItemsSource", typeof(IEnumerable), typeof(CheckBoxWrapperList), null); public static readonly DependencyProperty InnerTemplateProperty = DependencyProperty.Register("InnerTemplate", typeof(DataTemplate), typeof(CheckBoxWrapperList),

List Items Vertically on a WrapPanel and take advantage of multiple columns

北城余情 提交于 2019-12-18 14:30:34
问题 I need to list items (all of same size) vertically (with a ScrollViewer). I want the items to spread through x columns if the container is large enough to display x columns I first tried that : <ScrollViewer> <toolkit:WrapPanel Orientation="Horizontal" ItemHeight="30" ItemWidth="100"> <Button Content="1" /> <Button Content="2" /> <Button Content="3" /> <Button Content="4" /> <Button Content="5" /> </toolkit:WrapPanel> </ScrollViewer> Result - The WrapPanel works like I want but my items are