silverlight

How do I execute a foreach lambda expression on ObservableCollection<T>?

旧城冷巷雨未停 提交于 2020-01-01 09:10:03
问题 How do I execute a foreach lambda expression on ObservableCollection<T>? There is not method of foreach with ObservableCollection<T> although this method exists with List<T>. Is there any extension method available? 回答1: There is no method available by default in the BCL but it's straight forward to write an extension method which has the same behavior (argument checking omitted for brevity) public static void ForEach<T>(this IEnumerable<T> enumerable, Action<T> action) { foreach ( var cur in

How to wait for state changing transition to finish in Silverlight 4?

痞子三分冷 提交于 2020-01-01 08:39:14
问题 I need to change state of a control and then do some action. To be specific, I want to run an animation before a control is hidden. I would like to do something like that: VisualStateManager.GoToState(control, "Hidden", true); // wait until the transition animation is finished ParentControl.Children.Remove(control); The problem is that the transition animation is run asynchronously and thus the control is removed from the visual tree right after the animation is started. So how do I wait for

How to make ChildWindow blocking

主宰稳场 提交于 2020-01-01 08:01:06
问题 The ChildWindow is a modal window, but it does not block. Is there any way to make it blocking? I basically want a ShowDialog() method that will call ChildWindow.Show() but then not return until the user has closed the ChildWindow. I tried using Monitor.Enter() to block after ChildWindow.Show(), but the ChildWindow never rendered and the browser just hung. Anyone have any ideas? 回答1: I don't believe it supports that behavior. You can vote for it on CodePlex. Depending on what you want, you

Disable scrolling in browser control for WP7?

痞子三分冷 提交于 2020-01-01 05:42:06
问题 Is it possible to disable the scrolling in a web browser control in Windows Phone 7.1? I have seen quite a few questions ask around it (Windows Phone 7.0, Silverlight) but an answer has yet to come up. Any ideas? 回答1: There is a blog post here explaining how to suppress the zoom and scroll functionality of the WebBrowser control. Quote from that post: The visual tree is quite simple, composed of a few grids and borders. The significant parts are the TileHost, which is the native IE9 component

What is the most intuitive, usable way of entering a time of day or a duration?

自作多情 提交于 2020-01-01 05:36:11
问题 I'm building a line-of-business application in Silverlight and need to get the user to edit two .NET TimeSpan values. One is a time of day (relative to midnight) and the other is a duration. Currently I'm using two TextBoxes, formatted as hh:mm. This is pretty straightforward, but it could definitely be improved. I've observed people using the application and while some have no problem quickly entering times, other people struggle. Given that I'm working in Silverlight2, what would you see as

Previewing PDF and PowerPoint files with Silverlight/Flash

旧街凉风 提交于 2020-01-01 05:29:35
问题 I'm looking for code or a good control to preview PDFs and PPTs with Silverlight or Flash. It would be great if it has nice page-curl functionality. We want our customers to be able to have a look at their reports in a spiffy way. 回答1: Some ideas for Silverlight display: PPT Viewer PDF for Silverlight TextGlow Page Curl 回答2: Flash can only display Jpg images, therefore will need to convert each page of the PDF or PPT to a jpg file, then import these into a flash page turner component. PDF

Portable way to determining of printer is physical or virtual

☆樱花仙子☆ 提交于 2020-01-01 05:29:04
问题 I need direct-to-printer functionality for my website, with the ability to distinguish a physical printer from a virtual printer (file). Coupons.com has this functionality via a native binary which must be installed by the user. I'd prefer to avoid that. SmartSource.com does it via Java applet: Does anybody know how this is done? I dug through that Java APIs a bit, and don't see anything that would let you determine physical vs virtual, except looking at the name (that seems prone to

looking for stock charting component [closed]

浪尽此生 提交于 2020-01-01 04:45:28
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . i am writing a financial WPF desktop application and i am looking for a component that would allow me to display (and print) OHLC,

Get Webcam stream using Aforge.NET in C# and WPF

半腔热情 提交于 2020-01-01 04:37:07
问题 I want to capture a webcam feed using my camera. For that I am using the 2 references: AForge.Video.dll and AForge.Video.DirectShow.dll . Here's a snippet I found: public FilterInfoCollection CamsCollection; public VideoCaptureDevice Cam = null; void Cam_NewFrame(object sender, NewFrameEventArgs eventArgs) { frameholder.Source = (Bitmap)eventArgs.Frame.Clone(); /* ^ * Here it cannot convert implicitly from System.Drawing.Bitmap to * System.Windows.Media.ImageSource */ } private void startcam

Force Binding Update Silverlight

自作多情 提交于 2020-01-01 04:07:08
问题 How can I force my objects DataContext bindings to update? I'm using an event on a grid, and binding updates are not being processed before my event fires. Any cheap tricks to get around this? In the end I can always do things the old manual way of getting the values from my textboxes and updating my object, but it'd be nice to have binding do it for me. UPDATE My grid contains two textboxes. If a user clicks on the grid (MouseButtonUp event) then I save the changes. But in my MouseButtonUp