silverlight-4.0

How to configure WCF to push real-time data to the client?

左心房为你撑大大i 提交于 2019-12-09 06:40:06
问题 I need to send live updates from server to client. I know that WCF generally can do this. However silverlight is a picky client.. Does anyone know how to configure WCF to send the real-time updates to Silverlight client? Snipets from configs and walkthrough will be greatly appreciated. 回答1: Use WCF Callbacks. A good walkthrough that shows several configurations for this is available on the MSDN. We used the NetTCPBinding at my last job to great effect. It's very fast and efficient. The

INotifyDataErrorInfo ArgumentOutOfRangeException when raising ErrorsChanged event

笑着哭i 提交于 2019-12-08 23:27:59
问题 This is a wierd one and at this point I am thinking that it may have something to do with my machines configuration. Basically I have created a pretty standard implementation of INotifyDataErrorInfo and in certain circumstances, when raising the ErrorsChanged event I get an ArgumentOutOfRangeException . This exception doesn't contain much info; it gives me ArgumentOutOfRangeException crossed a native/managed boundary plus the standard ArgumentOutOfRangeException description regarding non

Start/Stop DispatcherTimer from a different thread

笑着哭i 提交于 2019-12-08 19:16:38
问题 Here is my code.. public DispatcherTimer tmr = new DispatcherTimer(); void somefunction (parameters){ if (something) tmr.Start(); if (something else) tmr.Stop(); } My problem is that I can't access the Start/Stop methods of the tmr object from the second function since it runs on a different thread!!! Can somebody please help me?? I am struck wih this problem for almost 3 days! :( 回答1: You need to Invoke it via Dispatcher (for marshaling the call from another thread) like so Deployment

Isolated Storage, OOB, and Removing the App

て烟熏妆下的殇ゞ 提交于 2019-12-08 18:53:56
问题 What happens to the files created by Isolated Storage when the OOB app is removed? Do they remain or are the files also deleted? From what I can deduct the files would be maintained so they can be accessed by the same app in browser. Right? 回答1: Correct, the isolated storage files remain. End users can remove all isolated storage data, or data for a specific app, through the Silverlight Configuration dialog. It is available both in the Start Menu / Applications menu, or by right-clicking on

How to put a white border to Black ellipse in windows phone 8

偶尔善良 提交于 2019-12-08 15:46:53
问题 I am using the above given popup in my windows phone 8 application. My issue is for the black color list item, it is not possible to differentiate the item from other items. So my question is how i can put a rounded white border to this particular black list item. Here is the template what i am using in my application. <DataTemplate x:Key="ColorListTemplate"> <Grid Height="70" Margin="0,0,0,5" toolkit:TiltEffect.IsTiltEnabled="True"> <StackPanel Orientation="Horizontal"> <Ellipse Height="52"

Silverlight Toolkit ContextMenu: Which control was right-clicked?

♀尐吖头ヾ 提交于 2019-12-08 14:15:39
The Silverlight Toolkit has a lovely ContextMenu, which can be shared among multiple instances of controls such as Textbox. Sharing can result from the ContextMenu being declared in a container which also hosts other controls. <StackPanel> <TextBox x:Name="box1" Text="{Binding str1}" /> <TextBox x:Name="box2" Text="{Binding str2}" /> <toolkit:ContextMenuService.ContextMenu> <toolkit:ContextMenu Name="cm"> <toolkit:MenuItem Name="cmiCut" Header="Cut" /> <toolkit:MenuItem Name="cmiCopy" Header="Copy" /> <toolkit:Separator/> <toolkit:MenuItem Name="cmiPaste" Header="Paste" /> </toolkit

webClient.DownloadStringTaskAsync().Wait() freezes the UI

人盡茶涼 提交于 2019-12-08 13:03:54
问题 I am using silverlight 4, and the new async CTP. private void button1_Click(object sender, RoutedEventArgs e) { WebClient wb = new WebClient(); var t = wb.DownloadStringTaskAsync("http://www.google.com"); t.Wait(); } This code causes the UI to freeze. On the other hand, this code works fine : private void button1_Click(object sender, RoutedEventArgs e) { WebClient wb = new WebClient(); var t = Task.Factory.StartNew(() => Debug.WriteLine("Doing something")); t.Wait(); } Whats the difference

Silverlight MVVM, stop SelectionChanged triggering in response to ItemsSource reset

孤街醉人 提交于 2019-12-08 12:45:36
I have two ComboBoxes, A & B, each bound to an Observable Collection. Each has a SelectionChanged trigger is attached which is intended to catch when the user changes a selection. The trigger passes the selection to a Command. The collections implement INotifyPropertyChanged in that, in the Setter of each, an NotifyPropertyChanged event is fired. This is needed (in the MVVM approach) to notify the UI (the View) that the ComboBox's contents have changed. The two ComboBoxes are interdependent - changing the selection in A causes B to be repopulated with new items. Now, the problem is that B's

Access resx in application from Silverlight class library

我是研究僧i 提交于 2019-12-08 11:10:50
问题 Resource files in Silverlight can be accessed using the code below: ResourceManager rm = new ResourceManager("MyLibraryNamespace.MyFolder.MyResources", Assembly.GetExecutingAssembly()); However in my application this piece of code is not in the application itself, but in a Silverlight class library and the app has reference to it; changing the namespace to the "MyAppNamespace" just generates error. How can I reach the resources in the xap file from the Silverlight class library? 回答1: There is

Turn off screen from inside app in windows phone 7

谁说我不能喝 提交于 2019-12-08 08:45:27
问题 Is there way to turn off the screen from within the app in windows phone 7? I went through the documentation but could not find anything regarding this. 回答1: No there is no possibly way to do this. The only thing you can do (if you want to make the screen black) is remove all the controls in the page or plop a black rectangle over everything. You cant mess with the WP7 OS API like that 回答2: No, you cant turn off the screen from your application. Microsoft certification will not allow