silverlight

Silverlight: How to create a page dynamically

邮差的信 提交于 2019-12-29 08:12:26
问题 Problem: I store the page name I want opened in Silverlight in a database. When I startup the application I want to set the page to this string so rather than this: this.RootVisual = new MainPage(); I want something like this string pageName = getValueFromDatabase() if (!PageExists(pageName)) throw error else this.RootVisual = SomeWizzyMethodToCreatePage(pageName) I guess I will need to use reflection here to find all of the pages (PageExists), and then somehow create a new instance

Silverlight: How to create a page dynamically

江枫思渺然 提交于 2019-12-29 08:11:45
问题 Problem: I store the page name I want opened in Silverlight in a database. When I startup the application I want to set the page to this string so rather than this: this.RootVisual = new MainPage(); I want something like this string pageName = getValueFromDatabase() if (!PageExists(pageName)) throw error else this.RootVisual = SomeWizzyMethodToCreatePage(pageName) I guess I will need to use reflection here to find all of the pages (PageExists), and then somehow create a new instance

Click-to-edit in Silverlight

こ雲淡風輕ζ 提交于 2019-12-29 07:46:07
问题 Is there a way to make a "click-to-edit" control in silverlight? I've got some items that will be displayed in a treeview control, and I would like the labels to be editable directly in the treeview. Anyone know how to do this? 回答1: Very easy actually. I have implemented many forms with such a swapping mechanism. You could do this using a Converter and do a simple BooleanToVisibility conversion on an IsEditable property that exists on the entities that you bind to your TreeView. Within your

How can I convert WriteableBitmap to BitmapImage?

。_饼干妹妹 提交于 2019-12-29 07:27:28
问题 BitmapImage bitmapImage = new BitmapImage(new Uri("arka_projects_as_logo.png", UriKind.Relative)); Image uiElement = new Image() { Source = bitmapImage }; ScaleTransform t = new ScaleTransform() { ScaleX = 0.2, ScaleY = 0.2 }; WriteableBitmap writeableBitmap = new WriteableBitmap(uiElement,t); I want to insert the result of this conversions (writeableBitmap) into System.Windows.Controls.Image. When I do this: Image arkaImage = new Image() { Source = writeableBitmap }; arkaImage isn't shown at

Windows Phone 7 Silverlight binding image from the IsolatedStorage

心不动则不痛 提交于 2019-12-29 07:20:11
问题 I need to find the way to save images to the IsolatedStorage and show them I the Silverlight (XAML) Important: Silverlight have to take image “himself”, I cannot set the image from the code behind I have tried many solutions before. The very last solution is, to bind byte array and convert them to the Image XAML StackPanel Orientation="Horizontal" Margin="0,0,0,20"> <Image Width="110" CacheMode="BitmapCache" Source="{Binding ThumbLocal,Converter={StaticResource imgConverter}}" Margin="12,0,9

Rendering a UI using IValueConverter using just c# code

两盒软妹~` 提交于 2019-12-29 07:13:13
问题 I am c# and silverlight-5 beginner. First i had to create object by deserializing an xml string. I have done that succesfully but now my next step is to create GUI using the object elements. I have idea that i have to use " IValueConverter " for doing this. But how that i dont know. My Program class which contains the object is like this: using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System

Solution for developing in Windows Silverlight in Visual Studio 2017?

谁说胖子不能爱 提交于 2019-12-29 06:43:27
问题 Our company is trying to remove Visual Studio 2015 all together but we still have some Silverlight code. Is there a workaround for being able to work with Silverlight in VS 2017 even though it's not supported, or a more light-weight solution rather than having to keep either both IDE's or just use 2015? 回答1: I'm left using both IDEs as 2017 does not support it. The solution uses 2017 but if I have to edit SL code I have to go back to the previous IDE version. To quote Visual Studio 2017

Programmatically determining max fit in textbox (WP7)

无人久伴 提交于 2019-12-29 06:25:14
问题 I'm currently writing an eBook reader for Windows Phone Seven, and I'm trying to style it like the Kindle reader. In order to do so, I need to split my books up into pages, and this is going to get a lot more complex when variable font sizes are added. To do this at the moment, I just add a word at a time into the textblock until it becomes higher than its container. As you can imagine though, with a document of over 120,000 words, this takes an unacceptable period of time. Is there a way I

【原】用Blend 3/SketchFlow画Silverlight 3原型图

只谈情不闲聊 提交于 2019-12-29 03:08:01
简介:之前做Silverlight项目,用过Axure RP画原型图,虽然也是很好的工具,但人家本职毕竟是用来画网页原型的,和Silverlight总有些隔膜:控件上有欠缺;不提供样例数据生成;一些较复杂的页面不支持手绘,只能截图;状态、动画统统没有……于是Sketch Flow一出,立刻下手研究,最终感受是:到底是一个系统的,用起来舒服多了。 创建Sketch Flow项目 Blend 3里新新添加两种项目模板,分别是Silverlight 3和WPF的SketchFlow Application。创建Silverlight 3 SkethcFlow Application,会发现同时创建了两个Project。与在VS中创建Silverlight工程时会创建一个“Silverlight应用程序”项目和一个“网站应用程序”项目不同,这里除了创建一个“Silverlight应用程序”项目,还创建了一个“Silverlight库”项目,而大部分画原型图的过程就是充实这个Silverlight库项目的过程。 研究这个项目,发现下面有一个文件夹放了三种特殊的字体,另有一个声明样式的XAML文件,另有一个名为Sketch.Flow的文件,里面会有一些原型图的配置信息。理论上这三部分都是可以增删改的。但这里我们只把关注点放到默认选中的Screen 1.xaml这个文件上。 关于Screen

Silverlight/WPF 系列汇总

﹥>﹥吖頭↗ 提交于 2019-12-29 03:04:27
Silverlight 解谜游戏系列 -- Silverlight 3 · Silverlight 解谜游戏 之一 新建项目 · Silverlight 解谜游戏 之二 创建题板 · Silverlight 解谜游戏 之三 消除名单 · Silverlight 解谜游戏 之四 粒子特效 · Silverlight 解谜游戏 之五 放大镜(1) · Silverlight 解谜游戏 之六 放大镜(2) · Silverlight 解谜游戏 之七 放大镜(3) · Silverlight 解谜游戏 之八 界面切换 · Silverlight 解谜游戏 之九 胜利通关 · Silverlight 解谜游戏 之十 自定义粒子特效 · Silverlight 解谜游戏 之十一 鼠标的新衣 · Silverlight 解谜游戏 之十二 解谜游戏暗示(1) · Silverlight 解谜游戏 之十三 解谜游戏暗示(2) · Silverlight 解谜游戏 之十四 音效 · Silverlight 解谜游戏 之十五 地震 · Silverlight 解谜游戏 之十六 消失的蒙娜丽莎 · Silverlight 解谜游戏 之十七 胜利界面优化 Silverlight 边学边练系列 -- Silverlight 2 · Silverlight2 边学边练 之一 五子棋 · Silverlight2