silverlight-4.0

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

给你一囗甜甜゛ 提交于 2019-11-29 07:23:09
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 grid. It should trigger another load, when the user scrolls down to items that are not yet in the data

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

China☆狼群 提交于 2019-11-29 06:21:08
问题 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? 回答1: You

Silverlight 4: how to switch control visibility

时光毁灭记忆、已成空白 提交于 2019-11-29 04:17:37
I am using MVVM in my Silverlight app. When control visibility is need to be managed by data, I am connecting its 'Visibility' property to object's corresponding property: XAML: <TextBlock Text="Price" Visibility="{Binding PriceVisibility, Mode=OneWay}"/> <TextBox Text="{Binding TicketPrice, Mode=TwoWay}" Visibility="{Binding PriceVisibility, Mode=OneWay}"/> CodeBehind (C#): public string PriceVisibility { get { return PriceVisible ? "Visible" : "Collapsed"; } } But from my perspective, returning string representation of the Visibility property is not a best approach. Could you please advise

Silverlight 4: Detect browser F5 / refresh and X / Close

倾然丶 夕夏残阳落幕 提交于 2019-11-29 03:53:12
I want to determine how to filter F5, refresh button, X and close in browser via silverlight 4.0 or even in server side. thank you EDITED: I added bounty to my question just today, July 28 2011. My previous solution / answer is no longer working in IE 9. window.onunload = function (e) { // Firefox || IE e = e || window.event; var y = e.pageY || e.clientY; if (y < 0) { alert("close"); } else { alert("refresh"); } } When the user hit F5, refresh, X and close button, message box should NOT appear. Just in case the solution is onbeforeunload. Thanks for you help! It is not possible client-side to

After a computer crash my Visual Studio 2010 will not load an assembly

拟墨画扇 提交于 2019-11-29 01:42:21
问题 My computer blue screened. After my computer restarted, I ran my Silverlight application and got this error: Could not load file or assembly 'AsyncCtpLibrary' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) I actually got a couple of errors regarding RIA services not being able to generate code because a directory name had invalid characters. I cleared that up by deleting everything in the bin and obj directories. Clearly there is

What is the use of Deployment.Current.Dispatcher.BeginInvoke( ()=> {…} )?

对着背影说爱祢 提交于 2019-11-29 01:19:52
I have seen this Deployment.Current.Dispatcher.BeginInvoke( ()=> {...} ) format in some code .Is it used to do some work in Background?What are the general uses of it? No, it's not to do work in a background thread - it's to do work on the UI thread. So it's normally called from a background thread, in order to manipulate the UI, which can only be done on the UI thread. The body of the lambda expression is the code which you want to execute in the UI thread. Mick N When code that updates the UI executes from a thread other than the UI thread, an invalid cross-thread access exception occurs.

Why change from WPF to Silverlight 4?

扶醉桌前 提交于 2019-11-29 01:05:12
I'm working on an application we made WPF instead of Silverlight as we wanted a full blown desktop application with the whole unique feeling and advantages that gives. However, with the announcement of Silverlight 4 I hear there is a buzz about Silverlight mostly being the preferred choice also for desktop applications. So; why should I consider moving my WPF application to Silverlight 4 - given that I still want a desktop application? Keep in mind that Silverlight 4 is currently in Beta with no end-user client runtime available. Silverlight 4 shipped in April of 2010. If you are already

Google Analytics API - Programmatically fetch page views in server side

别来无恙 提交于 2019-11-28 20:55:48
We have a web application that consists of several pages. We registered our web app domain to Google Analytics and page views tracking works as expected (In the Analytics panel we can see page views for each page). Now we want this page views info to be stored in the back-end inside our DB. So we want to create a back-end process that will run once each day, and fetch the page views from Analytics API. This is of course need to be done in code. From initial research it seems that in order to access Analytics API an authentication process must take place, meaning a human user must type in an id

How can I make something like this? (Tiles inside the app) Windows phone

ε祈祈猫儿з 提交于 2019-11-28 17:57:06
I'm sorry if the question title wasnt clear, but I'm trying to make something like this, I dunno if they are tiles or images inside a WrapControl: I was thinking of making such thing with a wrap panel and each one of those blocks as a stackpanel. but I'm not sure if thats the right approach. is there a control to do such thing? Justin XL You are on the right track. WrapPanel is the way to go :) To make each block more interesting, you can take a look at the HubTile control from the latest windows phone toolkit . Whatever controls/panels you are using, just remember the size should be 173*173.

Resources for Windows Phone 7 development [closed]

廉价感情. 提交于 2019-11-28 17:07:43
问题 Windows Phone 7 has been unveiled and MS have announced all details of the development chain at the Mix10 conference. So this could be a good starting point/collection of online resources as they appear EDIT: I've removed the speculation tag now that the covers are off 回答1: An excerpt from Programming Windows Phone 7 Series by Charlez Petzold just became available online. 回答2: Charlie Kindel has started a MSDN blog on WP7 development, along with a video on Channel9. windows phone twitter