silverlight-4.0

MVVM Light: how to unregister Messenger

假装没事ソ 提交于 2019-12-03 01:30:45
问题 I love the MVVM Light's Messenger and its flexibility, however I'm experiencing memory leaks when I forget to explicitly unregister the recipients (in Silverlight 4). The cause is explained here, but I'm fine with it as I believe it's a good practice to explicitly unregister the recipients anyways rather than relying on the Messenger's use of weak references. The problem is that is easier said than done. ViewModels are easy: you usually have full control over their lifecycle and can just

Can we concat two properties in data binding?

大兔子大兔子 提交于 2019-12-03 00:57:45
Can we concat two properties together in binding expression? If possible without converter or without writing two textblocks and setting them individually? Like alpha-mouse suggests MultiBinding won't work out of the box, but this guy has thrown something together that might help: http://www.olsonsoft.com/blogs/stefanolson/post/Improvements-to-Silverlight-Multi-binding-support.aspx If that seems a bit rogue, then maybe try putting a combined value property on your object as a helper for the Binding mechanism, like: public string FullName { get { return this.FirstName + " " + this.LastName; } }

How to tack browser Manual change in Silverlight

做~自己de王妃 提交于 2019-12-02 23:49:20
问题 I am developing a application in Silverlight. I want to restrict, when user changes the url directly from address bar. How to stop this. 回答1: There is no way of stopping that. You are not in a position to control the user like that. You could use the beforeonload event of the window object in JavaScript to present a warning to the user. <script> window.onbeforeunload = function() { return "You should not leave this page."; }; </script> 来源: https://stackoverflow.com/questions/8062539/how-to

Streaming a webcam from Silverlight 4 (Beta)

允我心安 提交于 2019-12-02 18:12:00
The new webcam stuff in Silverlight 4 is darned cool. By exposing it as a brush, it allows scenarios that are way beyond anything that Flash has. At the same time, accessing the webcam locally seems like it's only half the story. Nobody buys a webcam so they can take pictures of themselves and make funny faces out of them. They buy a webcam because they want other people to see the resulting video stream, i.e., they want to stream that video out to the Internet, a lay Skype or any of the dozens of other video chat sites/applications. And so far, I haven't figured out how to do that with It

how to bind width of child element to width of parent element in silverlight

眉间皱痕 提交于 2019-12-02 16:58:29
I have a grid whose width is "1*". So the actual width decided at runtime I think. Within that grid I have another grid whose width I want to set to the runtime width of parent grid. How Can I do that in xaml through binding. This will actually help you I guess Width="{Binding ActualWidth, ElementName=parentElementName}" This binds the width to the parent element or the element name provided This is generic solution which may work everywhere. You wouldn't need to write parent element name. This will identify its parent and will take parent's width. Width="{Binding RelativeSource=

Best practice for panning/zooming a user control?

心不动则不痛 提交于 2019-12-02 13:28:49
We currently have a user control which displays a dynamic matrix of other user controls. Since it's dynamic, the view can become large, requiring the user to scroll up/down & left/right in the browser to view everything. I would like to give the users one view of the user control with the ability to pan & zoom on it, much like the feel of this Telerik control. We own the Telerik controls and I've tried to use the Map control for our purpose, but it doesn't seem like that is going to be a good solution. I have also placed a Canvas inside of a scroll viewer, and was able to make it pan (using

How to tack browser Manual change in Silverlight

强颜欢笑 提交于 2019-12-02 13:11:18
I am developing a application in Silverlight. I want to restrict, when user changes the url directly from address bar. How to stop this. There is no way of stopping that. You are not in a position to control the user like that. You could use the beforeonload event of the window object in JavaScript to present a warning to the user. <script> window.onbeforeunload = function() { return "You should not leave this page."; }; </script> 来源: https://stackoverflow.com/questions/8062539/how-to-tack-browser-manual-change-in-silverlight

Which version of Silverlight Supports Task parallel Library

时光总嘲笑我的痴心妄想 提交于 2019-12-02 12:16:28
问题 Though TPL is widely accepted as a feature of C# 4.0 , but heard that it is not supported on SL4, but SL5. Could not find any solid evidence of it. So why the do MicroSoft implemented a feature in WPF but not Silverlight, though both sl4 and wpf4 released around same time. 回答1: If you need TCL in Silverlight 4 you can add the "Microsoft.Bcl" and "Microsoft.Bcl.Async" nuGet packages to your project. They implement part of what TCL delivers in .net. More info can be found here Don't forget you

Silverlight 4 BitmapImage - bmp file support

放肆的年华 提交于 2019-12-02 12:13:58
MSDN mentions support for PNG and JPG, but many people are trying setSource(file.bmp) and complaining about "Catastrophic failures". Can someone clarify this, is bmp supported or not ? And if not, what is the best way for displaying a bmp in silverlight ? BMP is not supported in Silverlight. BMP is a very old and not a very efficient format (compared with PNG & JPG) so they have not bothered to support it. Silverlight only supports JPG & PNG format images. The best way to display them is to convert them on the web server so they can be served up as PNGs. The webserver will have access to

Binding a grid with two datasources in silverlight

时光怂恿深爱的人放手 提交于 2019-12-02 11:51:01
I'm having a problem with how I should bind my datagrid in the best way. The problem is that i would like to use two itemSources. I have a list with alot of incidents, each incident holds a list of buggs. What I would like to do is bind half a gridview row with some of the fields from the incident, and half of the grid with the corresponding bugs that the incident holds. How would I be able to do this in the best way? I have access to the componentOne datagrid, but if the normal grid works it's all good. But I do would like to have a sorting ability. Thank you Sounds like you just want to make