silverlight

Silverlight - Paramterised resource values for Internationalisation

一曲冷凌霜 提交于 2019-12-21 23:25:12
问题 I'm running into a problem that seems to have no sensible / tractable solution that I am happy with. Silverlight and Internationalisation - a quagmire in the making. I have a set of resource files that contain translated strings. In the simple case, I can declare the language resource etc and bind the content / text of a value within the strongly typed resource. Thats fine - plenty of examples of that posted around. A less simple case is that the strings can have a parameter, so I need to

How do you configure a get-only property for a Silverlight-enabled WCF service

痴心易碎 提交于 2019-12-21 22:01:46
问题 I'm not certain where the error is resulting (from silverlight, from wcf, something else...) but, I have a WCF service being called from Silverlight. The method returns a class, with a property that does not have a setter. This throws an error. If I add a setter to the property then it does not give an error. The error is the usual impenetrable and unhelpful Silverlight error message, but... [Serializable] [DataContract] public SomeClass { DataMember] public string PropertyA { get; set; }

Silverlight AutoCompleteBox uppercase input

北战南征 提交于 2019-12-21 21:44:09
问题 I need to force uppercase input inside AutoCompleteBox in Silverlight 4 app. In TextBox this could be done by replacing Text property on KeyDown event like: control.Text += enteredChar; control.Select(control.Text.Length, 0); //To maintain caret position However AutoCompleteBox doesn't provide text selection function, and I found no way to move caret to string end. 回答1: You need to change AutoCompleteBox template and add UpperCaseBehavior to the TextBox within: <TextBox x:Name="Text" ...> <i

Silverlight sockets: mimic framework Bind, Listen and Accept methods?

点点圈 提交于 2019-12-21 21:41:10
问题 I have this .NET Framework C# class that practically acts as a wrapper for TCP connections around the Socket class in the System.Net.Sockets namespace. Recently I have migrated the API of this wrapper class to Silverlight, but because of the limitations of the Socket class in Silverlight, as well as the normal trust restrictions with respect to avaiable ports, client access policy etc., I have only implemented network client support in my Silverlight version. Now, with Silverlight 5 (RC), it

TimePicker without the TextBox

房东的猫 提交于 2019-12-21 21:38:42
问题 I want to use only the chooser dialog (shown below) from the TimePicker control included in the Silverlight Toolkit for Windows Phone. Normally this dialog only appears when a user clicks on the TimePicker control listbox. I would like to bypass the listbox altogether and launch the chooser dialog when a button is pressed. Is this possible or would I have to create a custom control for myself. 回答1: Create class that inherited from TimePicker , and use ClickTemplateButton() to simulate click

How to open window pop-up from Silverlight Out-of-Browser?

房东的猫 提交于 2019-12-21 21:17:06
问题 I need to open window pop-up from Silverlight Out-of-Browser application. I've added parameter <param name="enablehtmlaccess" value="true" /> in Index.html, but executing this from code behind: HtmlPage.Window.Navigate(new Uri(myUrl), "_blank", myFeatures); still returns error: Silverlight OOB Error: The DOM/scripting bridge is disabled. I've read about this post, does it mean that I can't open pop-up from OOB? Why I need to do this, because actually I've shown the HTML page in OOB

Silverlight WCF RIA服务(二十)Silverlight 客户端

雨燕双飞 提交于 2019-12-21 20:51:00
Silverlight客户端 使用WCF RIA Services,我们可以创建一个当数据交互时知道中间层应用逻辑的Silverlight客户端。还可以对可见的和可编辑的数据提供用户接口,来在提交数据修改之前应用验证规则。我们的SL控件将会使用从中间层代码自动生成类。次章节介绍SL客户端如何使用domain context, 如何与数据一起工作,以及如何自    Silverlight客户端 使用WCF RIA Services,我们可以创建一个当数据交互时知道中间层应用逻辑的Silverlight客户端。还可以对可见的和可编辑的数据提供用户接口,来在提交数据修改之前应用验证规则。我们的SL控件将会使用从中间层代码自动生成类。次章节介绍SL客户端如何使用domain context, 如何与数据一起工作,以及如何自定义生成的代码. 使用DomainContext 在中间层项目中会对每个domain service都生成一个DomainContext类来公开实体对象。在域上下文中包含着查询和修改等方法,这些方法与在域服务中对应的域操作进行沟通。当我们在SL应用程序中调用域上下文类上的一个查询方法时,这个查询方法会调用返回所需数据的域服务上的对应方法。这些域上下文上的方法都是异步执行的,所以在装载数据的时候,用户界面不会被锁定。 呈现和修改数据 我们使用SL控件

Getting an object reference by name from a DataTemplate

随声附和 提交于 2019-12-21 20:45:41
问题 If I have the following XAML: <toolkit:DataForm Height="100" x:Name="form"> <toolkit:DataForm.EditTemplate> <DataTemplate> <StackPanel Name="stack"></StackPanel> </DataTemplate> </toolkit:DataForm.EditTemplate> </toolkit:DataForm> I can get a reference to "form" by this.FindName("form") from the View. How can I get a reference to "stack"? FindName returns null. 回答1: The problem here is that the xaml content of a DataTemplate belongs to a different NameScope than the outer Xaml. Calling

Silverlight rendering issue in Firefox 4 and 5 on MacBooks

主宰稳场 提交于 2019-12-21 20:36:30
问题 We have encountered something that looks like a Silverlight 4 rendering problem when running our Silverlight 4 app in FireFox 4 and 5 on MacBook’s. There is no problem in Safari or OOB (that’s Safari I guess). The problem is that large parts of the UI goes white and gradually reappears by moving the mouse over the white areas, or if the UI canvas is repainted. We use Telerik controls in our app, but the problem can occur just by scrolling a list inside a scrollviewer, so I dont think its

Memory profiler for silverlight

不问归期 提交于 2019-12-21 20:35:45
问题 Do you have any suggestion/idea of Memory profiler for Silverlight? 回答1: You can use the standard memory profiling tools (memory GC and lifetime) in Visual Studio 2010 - but only the Ultimate and Premium versions. The support is only for command line profiling, so the basics go: Open a Visual Studio command prompt VSPerfClrEnv /globalsamplegclife VSPerfCmd -start:sample -output:somefile.vsp VSPerfCmd -launch:"c:\Program Files (x86)\Internet Explorer\iexplore.exe" -args:"" VSPerfCmd -globalon