silverlight

How to use NHibernate and DTOs with RIA Services

陌路散爱 提交于 2019-12-24 02:22:36
问题 I’m using NHibernate with RIA Services and Silverlight 4. I create DTOs for transferring the data via RIA Services rather than distributing my domain layer objects (as per Martin Fowler’s First Law of Distributed Object Design: “Don’t distribute your objects!”). The DTO objects are flattened down to two layers from five corresponding layers in the domain layer. Here’s my problem. After making changes in Silverlight 4, RIA Services knows which DTO objects have been modified, but in the server

save writableimage to file in silverlight

安稳与你 提交于 2019-12-24 02:04:28
问题 How want to save the image of a canvas to a file. var img = new WriteableBitmap(canvas1, null); Image i = new Image(); i.Source = img; var bitmap = new Bitmap(i); I tried to use bitmap.Save( for saving the image but Bitmap is not supported by silverlight. How would you save WriteableBitmap to a file? 回答1: The WriteableBitmap has a Pixels collection which can be used to access the rendered image. However you really need to get it stored in a known format (preferable PNG). The imagetools

Is it possible to configure a GridView to show pivoted data using static XAML if column info is unknown at design time?

China☆狼群 提交于 2019-12-24 01:56:20
问题 I was recently, um, chastised for generating and loading XAML markup at runtime using XamlReader.Parse(). I was told that there's no reason to use XamlReader--it can always be done with static XAML, predetermined at design time. I attempted to ask this person how I could construct a GridView to show pivoted data, where the number of columns and the binding path for each column is unknown at design time. I have yet to hear back, but even if I did, I figured this would be an interesting

Are IronPython or IronRuby well-suited for the MVVM pattern in WPF/Silverlight?

雨燕双飞 提交于 2019-12-24 01:54:49
问题 I've been very happily using the Model-View-ViewModel (MVVM) pattern in WPF and Silverlight apps in combination with C#. Declarative XAML markup and data binding are invaluable - I just can't live without them. But, this talk by Harry Pierson on dynamic languages got me excited about learning a dynamic language, and I'd like to try one out in a new project. I've been enjoying reading IronPython In Action, and it does contain a few WPF examples - but only with imperative-style code. What are

Printing in Silverlight 4 without Print Dialog - Out of Browser and elevated trust

蹲街弑〆低调 提交于 2019-12-24 01:53:39
问题 How can I print in Silverlight 4 without a print dialog showing all printers. Many people say it not possible but they always talk when the app is running in the web browser. In this case I'm out of browser and with elevated trust. Any suggestions? 回答1: Even with elevated trust, you are still going to have to deal with the print dialog using the print API. I know a couple of people who have written POS systems in Silverlight and resorted to using COM interop to handle printing straight to a

Silverlight: VisualStateManager.GetVisualStateGroups doesn't, How can I get them?

假如想象 提交于 2019-12-24 01:51:34
问题 I've tried using VisualStateManager.GetVisualStateGroups in the OnAttached override of my custom behavior, as well as in an event handler added to AssociatedObject.Loaded event in that behavior. Both times I get an empty list. Is there another way to get the visual state groups defined for a control, or another event handler I should attach to? Be for it's asked, yes, the control has VisualStateGroups and VisualStates . 回答1: Usually the VisualStateGroups attached property is attached to the

WCF RIA Services - returning custom class of two already defined classes

我与影子孤独终老i 提交于 2019-12-24 01:39:26
问题 I have a Silverlight / WCF RIA Services application that uses EF 4. Currently, there is a domain service that returns two types of classes, OrderItem and Event. I'd like to create a class that contains both of these items for easier manipulation of the data at the XAML level. Here is what the class that combines the two classes looks like: [Serializable] [DataContract] public partial class EventOrderItem { [Key] [DataMember] public string EventOrderItemKey { get { return Event.EventID

Stream a WAV File From The Web In Silverlight 3

时间秒杀一切 提交于 2019-12-24 01:38:26
问题 I've managed to discover Gilles Khouzam's playback implementation for WAV files in Silverlight 3 and while that would be the majority of the battle, I'm stuck on a final detail: how do I pull a wav file from the web some place and then feed it into his WaveMediaStreamSource for playback? Here's the closest I've come: public MainControl() { // Required to initialize variables InitializeComponent(); PlayButton.Click += PlayButtonClicked; } private void PlayButtonClicked(object sender,

Angular2-Silverlight: Pass URL inside a container to a silverlight object

浪尽此生 提交于 2019-12-24 01:38:06
问题 I am currently rewriting a silverlight application to Angular2. In the process, I need to keep running the existing silverlight application alongside the new Angular2 application. So I have a parent container which nests a 'html'/'silverlight' container based on a hashed route. But since, the silverlight application is now loaded inside a component, it cannot read the URL and the existing routing is broken. Is there any way, I could pass the URL change event inside the nested silverlight

Silverlight 5 dynamic stream URI setting

柔情痞子 提交于 2019-12-24 00:54:50
问题 I'm not familiar with Silverlight (5) but think I'm close to getting what I'm trying to do working. Grateful for any help. Basically, I need to pass a dynamically generated smooth stream URI into the player and set "Media Source" correctly. Steps I'm taking.. Client invocation, a single key-value pair.. <param name="InitParams" value="mediaurl=http://playready.directtaps.net/smoothstreaming/TTLSS720VC1/To_The_Limit_720.ism/Manifest" /> MainPage.xaml.. <!--Media:PlaylistItem DeliveryMethod=