silverlight-4.0

Silverlight 4 WCF RIA Service Timeout Problem

放肆的年华 提交于 2019-12-31 03:11:09
问题 I have a Silverlight 4 usercontrol that calls a very long running WCF RIA service. As shown below, I am increasing the default timeout period. _domainContext = new WindowsDashboardDomainContext(); // Increase timeout -- this can be a very long running query ((WebDomainClient<WindowsDashboardDomainContext.IWindowsDashboardDomainServiceContract>) _domainContext.DomainClient).ChannelFactory.Endpoint.Binding.SendTimeout = new TimeSpan(99, 0, 0); _domainContext.GetSections( "All", "All", "All" )

Check internet connection in Silverlight

折月煮酒 提交于 2019-12-31 02:41:11
问题 I'm writing a Silverlight 4 application and would like to check when opening the installed out of browser application, whether there is a valid internet connection (to then download some data from my website). What is the best way to do this? I realise that I could put a try catch around a WebRequest but that seems a bit hacky to me. EDIT : What I meant by valid internet connection is just connected to the internet 回答1: You can just kill two birds with one stone with Application

Getting UI virtualization working with ItemsControl in Silverlight

◇◆丶佛笑我妖孽 提交于 2019-12-30 18:50:49
问题 I'm trying to create a scrolling list of fairly large textblocks. I want there to be a vertical scrollbar to show them all, and if they overflow a certain size I want them to display an ellipsis. I actually have all this working pretty good. I have the following Silverlight XAML: <Grid x:Name="LayoutRoot" MaxWidth="500" MinWidth="100" MaxHeight="500" MinHeight="100"> <Grid.DataContext> <app:MainPageViewModel/> </Grid.DataContext> <ScrollViewer> <ItemsControl ItemsSource="{Binding TextItems}"

Change Background of WP7 Application if Theme is altered

坚强是说给别人听的谎言 提交于 2019-12-30 13:30:01
问题 I need to change the Background Image of my Application if user changes theme from "Light" to "Dark" or vice-vesa in code behind. I hope these should be done in Page Loded event 回答1: @TimDams pointed you to one of the nice ways to detect what-theme-is-now-set, but I didn't notice there any information how to detect a change to the theme during the application runtime. The user could start your app, then bump forward to the menu, change the theme, and get back to your app. While you may think

DateTime Convert from int to Month Name in C#, Silverlight

感情迁移 提交于 2019-12-30 03:43:21
问题 I am trying to print out the name of the month not the integer value of each month. (for example if the date is 2/2/2002, I would like the "month" to read out "February" instead of "2." I am pulling in the system.DateTime.now to get the current month. When I try to print out the current month on the form, it just puts the correlating integer value for the month, whereas I would like to have the Month Name. I know this can be done using switch-case or if statements to individually convert the

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

扶醉桌前 提交于 2019-12-30 03:32:06
问题 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: 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.

Silverlight 4.0 PDF Viewer [closed]

血红的双手。 提交于 2019-12-30 01:51:10
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Any free control to view PDF for Silverlight? or how to view pdf in silverlight from memory stream? 回答1: 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

How can I convert WriteableBitmap to BitmapImage?

。_饼干妹妹 提交于 2019-12-29 07:27:28
问题 BitmapImage bitmapImage = new BitmapImage(new Uri("arka_projects_as_logo.png", UriKind.Relative)); Image uiElement = new Image() { Source = bitmapImage }; ScaleTransform t = new ScaleTransform() { ScaleX = 0.2, ScaleY = 0.2 }; WriteableBitmap writeableBitmap = new WriteableBitmap(uiElement,t); I want to insert the result of this conversions (writeableBitmap) into System.Windows.Controls.Image. When I do this: Image arkaImage = new Image() { Source = writeableBitmap }; arkaImage isn't shown at

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

别说谁变了你拦得住时间么 提交于 2019-12-29 03:16:09
问题 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? 回答1: 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

How to add reference of c++ dll (build with pure MSIL option) in silverlight application

倖福魔咒の 提交于 2019-12-25 16:54:56
问题 I have tried adding reference after converting it to .sl.dll, it gets added but my application shows blank page instead of the contents. How can I use the cpp code in silverlight? Also can we use unmanaged code via the managed one similar to WPF? Please note I am already using 2.0.5.0 version of system.dll. 回答1: An application needs full trust in order to make use of unsafe code. Even a trusted Silverlight application does not run with full trust, but a somewhat more relaxed set of