silverlight-4.0

Windowless Silverlight (and Flash?) app on Firefox: wrong mouse positions reported

筅森魡賤 提交于 2019-12-07 10:34:38
问题 When I create a windowless Silverlight app and run it on Firefox, wrong mouse positions are reported. There is a vertical offset between the actual mouse position and what the application responds to. I also tagged this question with Flash because my research shows that this problem also occurs with Flash (see links below). To reproduce: Step 1: Create a new Silverlight application. Step 2: Inside the grid of MainApp.xaml add the following: <HyperlinkButton NavigateUri="http://google.com"

Runtime theme switching with explicit styles in Silverlight 4

↘锁芯ラ 提交于 2019-12-07 08:02:41
问题 It's been requested that we add dynamic theme switching to our application, and I'm having problems figuring out how to do this. Here's the current situation: our application has a merged resource dictionary with explicit (not implicit) styles. The views in our application refer to these styles through the StaticResource markup extension. The reason why we're not using implicit styles is that we have multiple looks for common types of controls; for example, buttons in one location look

How to detect Ctrl+V in Silverlight 4?

老子叫甜甜 提交于 2019-12-07 07:46:17
问题 What is the best way to detect Ctrl + V in Silverlight? I want to detect Ctrl + V , to get access to the Clipboard. 回答1: EDIT To capture the CTRL + V keypress globally in your silverlight application, is fraught with difficulty. Events start at the child elements and bubble down to the parent controls, so simply handling KeyDown on your root UIElement will not work. Any text input control will first get the event and smother it (by setting Handled to true on the event args.) I think that if

How to fire a button Click event in code behind in user control?

做~自己de王妃 提交于 2019-12-07 07:01:36
问题 is it possible to fire a button Click event in code behind in user control? 回答1: In C# events can only be invoked from the class that declares them. In case of the Button there is a method called OnClick which raises the ClickEvent but it is protected. So you need to declare class that inherits from Button and change the visibility of OnClick method (or declare some over method that calls base.OnClick) public class MyButton : Button { public new void OnClick() { base.OnClick(); } } Example of

How wrap image around cylinder in Silverlight

我的未来我决定 提交于 2019-12-07 06:36:39
问题 I am trying wrap image around cylinder in silverlight. I looked a lot in Google but don't found anything. As I know it can be done with pixel shader, but don't know how. Is it possible? Thanks. 回答1: It's not a complete wrap onto cylinder, but you will get a starting idea/example: (code is in GLSL, not in HLSL, but i think it will be not hard to convert it) uniform sampler2D tex; void main() { vec2 cen = vec2(0.5,gl_TexCoord[0].y)-gl_TexCoord[0].xy; cen = vec2(pow(cen.x,1.7),pow(cen.y,2.2));

Pixel fonts in Silverlight 4

五迷三道 提交于 2019-12-07 06:27:29
问题 Is there a way to render pixel fonts correctly in Silverlight 4? Without breaking text into paths or some sort of manual rendering because the text is dependent on data binding. Tweaks with UseLayoutRounding and .5px positioning shifting don't work. 回答1: Just have created a custom TextBlock control which renders text with a pixel font and anti-aliasing turned off. Pixel Fonts for Silverlight 回答2: MS render the font anti-aliased to make them look better... generally... but of course that does

Silverlight MVVM binding updates fire in undesired order

孤街浪徒 提交于 2019-12-07 05:47:42
问题 Scenario : In a Silverlight 4 MVVM project, we have a ListBox control containing items, the selected item is two-way-bound to the appropriate property in the ViewModel. Another control (for example reasons, I've stripped it down to a single TextBox ) is data bound to the selected item's content. The value should update on leave/focus lost. Problem : When the value in the TextBox is changed and we leave that TextBox by pressing the Tab key, everything works as desired - the value is updated.

SL4 AutoCompleteBox repeating filter results issue

别来无恙 提交于 2019-12-07 04:45:16
问题 I'm having an issue with the AutoCompleteBox filtering. It seems to be rembering the previous filter. For example I type in 'A' and it returns 1 item. I delete the 'A' and type in 'Z' which should return 1 item. The problem is it returns the results from the 'A' filter plus the 'Z', I delete 'Z' and type 'S' which brings back 2 items and it now displays the results from all 3 filters. Am I doing something wrong? stockTypes.Add(new StockTypeDTO() { Description = "Steel Coil", StockCode = "SC"

wshttpbinding support in silverlight 4

浪尽此生 提交于 2019-12-07 03:22:42
问题 Does silverlight 4 beta supports wshttpbinding (wcf)? If not, will it be supported in stable release? 回答1: No, it doesn't look like it. Check out these blog post on the topic: New Web Services features in Silverlight 4 Beta WCF net.tcp Protocol in Silverlight 4 Silverlight 4 will support the NetTcp Binding, mostly for intranet scenarios - but I haven't heard anything about support for wsHttpBinding, sorry. Marc 来源: https://stackoverflow.com/questions/1854126/wshttpbinding-support-in

ReactiveUI and Validation

南笙酒味 提交于 2019-12-07 02:55:45
What's considered "best practice" when performing data validation while using ReactiveUI ? Let's say I have a view model that looks like this: public class MyViewModel: ReactiveObject { public ReactiveAsyncCommand SaveMyDataCommand { get; protected set; } private string _email; public string Email { get { return _email; } set { _email = value; raisePropertyChanged("Email"); } } private string _name; public string Name { get { return _name; } set { _name= value; raisePropertyChanged("Name"); } } private bool _sendEmail = false; public bool SendEmail { get { return _sendEmail; } set { _sendEmail