silverlight-4.0

How to set up RIA services with Silverlight 4.0 and without EF

和自甴很熟 提交于 2019-11-30 10:51:08
As a Silverlight newbie, I am finding it really hard to set up an RIA Web service. The examples available on the web almost always refer to Entity framework as the ORM but we are using NHibernate as our ORM. I am aware of the tutorial by Brad Abrams where he uses NHibernate as the ORM but most of it goes above my head because I am also a newbie at NHibernate and some of the concepts of RIA are not clear to me e.g. DomainService. I'd like to first keep it simple and ignore the ORM at the moment. So, can anyone point me in the right direction as to how to get a "vanilla" web service going with

Handling event of user control in its holding page's code behind

左心房为你撑大大i 提交于 2019-11-30 10:11:51
I am looking for a solution for following situation. In my application i had a page say page1 and i placed a user control inside the page1. My requirement is i need to get the click event of button used in user control on page1's code behind. How i can achieve the same in windows phone / silverlight. 1. The first and the right way: (If you are aware of MVVM pattern) would be for you control, say MyControl , to expose DependencyProperty of type ICommand , named e.g. MyControlButtonClickCommand. Xaml: <UserControl> <Button Command={Binding MyControlButtonClickCommand, Source={RelativeSource Self

SL4/MVVM: Handle MouseDragElementBehavior.Dragging event with void Foo() in VM

安稳与你 提交于 2019-11-30 09:24:01
问题 I am trying to handle the MouseDragElementBehavior.Dragging event on a control I have. See here for background on why I want to do this. I am having trouble wiring up this event. From the XAML you can see I have added a behavior to the user control. Then I attempted to add a handler to the Dragging event on the behavior via the CallMethodAction EventTrigger. <i:Interaction.Behaviors> <ei:MouseDragElementBehavior ConstrainToParentBounds="True"> <i:Interaction.Triggers> <i:EventTrigger

How to implement a lazy loaded Silverlight data grid without using paging

我的梦境 提交于 2019-11-30 08:37:31
问题 Using the Business Application template from the brand new released RIA Services, you can see lots of examples using the data grid on top of a DomainDataSource in combination with a DataPager . The properties PageSize and LoadSize can be used to adjust the amount of data to be displayed in one page and the data that is prefetched in the background. Now I'd like to have a data grid with a scrollbar and no pager. The underlying DomainDataSource should load only the data that is diplayed in the

Silverlight 4 / .NET 4 Debugging resource strings

人走茶凉 提交于 2019-11-30 07:58:16
I recently encountered a strange thing. On some of my company's servers when an exception message is printed out (yes, bad, I know. It's for debugging), the actual message isn't displayed. Instead it displays the key for an external string resource and says that "Debugging resource strings are unavailable" After some research I've come up with the following: In release mode, Silverlight does not package the xap with the dlls containing the actual error messages in order to save space. I've found workarounds for OLD versions, but nothing for 4. It seems like there are Developer versions of the

MSBuild command-line error - Silverlight 4 SDK is not installed

拈花ヽ惹草 提交于 2019-11-30 07:52:08
My MSBuild command line is as follows: msbuild e:\code\myProject.csproj /p:Configuration=Debug /p:OutputPath=bin/Debug /p:Platform=x86 /p:PlatformTarget=x86 The project builds fine on my development machine in VS2010 but not with the command above. I am running Win 7 64 - Bit. I'm getting an error that says I don't have the Silverlight 4 SDK installed but I do. I"ve read some posts that you have to set the Platform=x86 but to no avail. Here is the error message in full: Microsoft (R) Build Engine Version 4.0.30319.1 [Microsoft .NET Framework, Version 4.0.30319.1] Copyright (C) Microsoft

Silverlight 4.0: How to convert byte[] to image?

只愿长相守 提交于 2019-11-30 06:53:09
public Image Base64ToImage(string base64String) { // Convert Base64 String to byte[] byte[] imageBytes = Convert.FromBase64String(base64String); MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length); // Convert byte[] to Image ms.Write(imageBytes, 0, imageBytes.Length); System.Drawing.Image image = System.Drawing.Image.FromStream(ms, true); return image; } I want to convert byte[] to image, however System.Drawing.Image is not supported in Silverlight. Any alternative? You need to create an ImageSource and assign that to an Image control or use an ImageBrush to set on the

Silverlight 4.0 PDF Viewer [closed]

此生再无相见时 提交于 2019-11-30 05:05:00
Any free control to view PDF for Silverlight? or how to view pdf in silverlight from memory stream? Aim Kai Try this question: Previewing PDF and PowerPoint files with Silverlight/Flash Other maybe useful links: http://forums.silverlight.net/forums/p/23986/85909.aspx#85909 http://www.siberix.com/reporting.html#pdf-sparkle - Costs money though! http://forums.silverlight.net/forums/t/70573.aspx You could use this to edit/print to pdf Try codeplex: http://silverlightpdf.codeplex.com/ Works with Silverlight 3 not used it with Silverlight 4 beta yet. One easy way is that you can just use HTML brush

Silverlight Constructor Injection into View Model + Design Mode

妖精的绣舞 提交于 2019-11-30 02:22:08
Im trying to get to grips with writing testable ViewModels in Silverlight 4. Im currently using MVVM light. Im using AutoFac and the IoCContainer is doing its job fine. However to inject into the constructor of ViewModels, which are bound to Views I have this constructor chaining: public UserViewModel() : this(IoCContainer.Resolve<IUserServiceAsync>()) { } public UserViewModel(IUserServiceAsync userService) { if (this.IsInDesignMode) return; _userService = userService; } Which doesn't feel clean, but is the best option i have found so far. This works and my app works as desired, and is

listbox items orientation to horizontal

放肆的年华 提交于 2019-11-30 01:12:06
问题 How to make the listbox items orientation to horizontal in the default styling of a listbox. What i mean by default is the style which we get using blend. 回答1: Use the ItemsPanel property to replace the panel with a horizontal StackPanel: <ListBox> <ListBox.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ListBox.ItemsPanel> </ListBox> If you want to do this in a Style, just add a Setter that sets the ItemsPanel property: <Style TargetType=