silverlight

Binding to a property of a custom converter

旧街凉风 提交于 2019-12-24 15:18:28
问题 I've written a converter BoolToStringConverter. The converter has two properties TrueString and FalseString. Here's how I've used it in XAML <UserControl.Resources> <local:BooleanToStringConverter x:Key="BooleanToStringConverter" TrueString="{Binding Strings.Open, Source={StaticResource MyStrings}}"></local:BooleanToStringConverter> </UserControl.Resources> This compiles ok, but I get an xml parse exception when running it. If I change the setting of the TrueString property to TrueString =

Hosting Silverlight 5 in IIS 5.1

大憨熊 提交于 2019-12-24 15:08:50
问题 I wanted to know if a Silverlight application can be hosted on IIS 5.1, because when I create a virtual directory and publish the Silverlight project and try browsing it, I get this following error: The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request. 回答1: Host Silverlight in IIS: Add application to: (Or make sure IIS_IUSRS has permission) C:\inetpub\wwwroot\[Application] Add

Silverlight: Expose audio with specific start and stop times

白昼怎懂夜的黑 提交于 2019-12-24 15:05:48
问题 From an audio-file I want to be able to expose audio on a webpage, but between specific start and stop times . Say I have a audio-file that is 45:30 , for example, and I want to expose it for streaming and download between 7:25 and 8:30 , but also between 6:20 and 9:27 . What do I need in term of special services , Silverlight-controls and maybe some sample-code for this. Bonus-question : Is there already an online-service for this? 回答1: Seb, I assume that when you say "expose" that you mean

How can I get a 2d point from a matrix3d in silverlight?

岁酱吖の 提交于 2019-12-24 14:53:00
问题 I have a Matrix3D object that defines a 2d plane with perspective. (think a large painting that has fallen on the floor, away from you) How can I get the 2d point that relates to the new location after the translation ? If the 'painting' was three horizontal stripes then once the 'painting' is transformed those three stripes of equal width are now a trapezoid where the top stripe is smaller than the middle and bottom one. 回答1: You need to transform a 3D vector of the form (X, Y, 0) using this

Magnetic Effect In Slider

安稳与你 提交于 2019-12-24 14:52:46
问题 look i have Slider in Silverlight having maximum value of 1 starting from minimum value of 0, i want the slider to have some magnetic effect, like if i drop slider thumb near 0 it must return to 0. for example , if i drop the thumb between (0 - 0.50) say 0.40 the very thumb must move to 0, and if thumb drop at value more than 0.50 it must move to 1. <Slider Height="50" x:Name="slider" Width="160" Maximum="1" SmallChange="1" LargeChange="1" Minimum="0" /> 回答1: What about the ValueChanged

Silverlight, DataTemplate, Binding to click event

可紊 提交于 2019-12-24 14:07:15
问题 Good day, I'm getting desperate here. Consider the following use case. I have a listbox which item's are custom templated control. It has several buttons for which this custom control has event handlers in code behind. Whenever button is clicked I call a method of the object my custom control is bound to through the DataContext. So, when user clicks stop, I call _context.stopDownload() and object does the rest. But, I have one button which should start the playback of the content. I am trying

ViewModel Event Registration and ViewModel Lifetime

♀尐吖头ヾ 提交于 2019-12-24 13:40:29
问题 I have an architectural problem, and a possible solution for which I would like an opinion. I'm used to MVVM architecture for WP7 (whenever possible but unfortunately sometimes the sdk seems to go on the opposite direction). WP7 force an ViewFirst approach and I feel confortable with this (except for the part that we can't override the View creation, as in Silverlight, to made constructor injection possible). I found myself confident by having most of the viewmodel follow the lyfetime of its

MeasureOverride not always called on children's property changes

二次信任 提交于 2019-12-24 13:34:51
问题 I wrote a panel similar to the built-in StackPanel. I works almost fine except for a slight problem: Changing layout properties on children do not always cause the panel's MeasureOverride and ArrangeOverride to be called. They are always called when a child's Visibility property changes, but not when the Width and Height properties change. I haven't yet managed to reproduce this behavior in a sample small enough to be appropriate for being included in a question on StackOverflow: But since it

How to set http header If-Modified-Since on a WebRequest in Windows Phone 7?

雨燕双飞 提交于 2019-12-24 13:33:50
问题 Trying to set the 'If-Modified-Since' header in wp7: request.Headers[HttpRequestHeader.IfModifiedSince] = dateString; Gives the error: This header must be modified with the appropriate property. Which means that the property .IsModifiedSince should be used on the request class, as described in MSDN: http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.ifmodifiedsince.aspx But this property does not exist in Silverlight i.e. WP7. Has anyone been able to set this header for a http

problem in Silverlight publish

て烟熏妆下的殇ゞ 提交于 2019-12-24 13:33:22
问题 I have a silverlight 2.0 object on content of masterpage. i see it on local but can't see on the host after publishing. according to Microsoft blog i add 2 MIME type of xaml and xap but silverlight object doesn't appear. i can't see the content of silverlight object but i can configure silverlight by right click. please guide me. 回答1: If you can right-click and get the Silverlight menu, your object tag is obviously rendering OK, which is a good start. You don't mention whether you see the