silverlight-4.0

Prism for Silverlight: How to maintain views in a specific order inside a region

为君一笑 提交于 2019-11-28 01:57:40
问题 I am creating sort of a "Navigation panel" (which is actually an ItemControl) for SL and using Regions to allow each module to add his link to the panel. Problem is that modules loading is inconsistent and thus order of links in the panel can change according to modules loading order. Restricting the modules order is out of the question. Other feasible option is the order the region's Views Collection that is binded to the ItemControl, the problem is that ViewCollection is very limited, so

Is there a way to programmatically quit my App? (Windows Phone 7)

前提是你 提交于 2019-11-28 01:50:28
I'm writing a windows phone 7 app. I have "fatal exception" handling code where I know for sure that the app is totally busted and there's no point in continuing. (I'm hoping I never get here...). Since there's nothing more my app can do other than quit I want the user to be able to close the app. But I noticed there is no System.Environment.Exit() in the Silverlight 4 SDK for Windows Phone 7. Is there another way to quit the app programmatically? App Cert Reqt: 5.1.2 Application Termination The application must handle exceptions raised by the .NET Framework and not terminate unexpectedly.

Passing the value of an item selected in a Gridview to the ViewModel of a different Usercontrol

被刻印的时光 ゝ 提交于 2019-11-28 01:34:12
After researching a solution to this for three days, finally I gave up. Now I need your help to solve this. Scenario: I've a GridView in a Usercontrol (Lets say WLMSLogs.xaml) and My GridView ItemSource is binded to a List from the ViewModel (WMLSLogsViewModel.cs) Lets say the List has 4 items (EventID, Name, Request and Response). BothRequest and Responses are XML Strings. GridView needs to display some of the List items in RowDetailsTemplate under different tab items. So I'm displaying Request and Response under respective TabItems. <GridView x:Name="WMLSLogGrid" ItemsSource="{Binding

How to set focus on TextBox in Silverlight 4 out-of-browser popup

妖精的绣舞 提交于 2019-11-28 01:26:44
问题 I have a simple ChildWindow popup in Silverlight 4 (beta). Important: This is an out-of-browser application. i want to auto set focus on a TextBox control when the window opens. I've tried a couple things : The following code doesn't seem to do anything. I don't think the control is ready to be focussed after 'Loading'. private void ChildWindow_Loaded(object sender, RoutedEventArgs e) { textBox1.Focus(); } This works, but its klunky. private void ChildWindow_GotFocus(object sender,

What does WPF still have to offer over Silverlight 4?

流过昼夜 提交于 2019-11-28 01:01:38
Given the list of new features announced in Silverlight 4, when is WPF still required? WPF still has a lot fuller 3D rendering capabilities. Also even though they announced enhancements to the commanding and binding capabilities, that's no guarantee that it will have the full ability that WPF currently has or will have in the next version Edit: After playing around with Silverlight 4 beta, it looks like pretty much all of the new features (webcam, file access, full screen keyboard, COM interop, etc) only work when the application is elevated trust, and elevated trust can only be enable when

Binding to Converter Parameter

旧时模样 提交于 2019-11-27 21:47:20
Is it possible to bind to a ConverterParameter in Silverlight 4.0? For instance I would like to do something like this and bind the ConverterParameter to an object in a ViewModel for instance. If this is not possible are there any other options? <RadioButton Content="{Binding Path=Mode}" IsChecked="{Binding Converter={StaticResource ParameterModeToBoolConverter}, ConverterParameter={Binding Path=DataContext.SelectedMode,ElementName=root}}" /> Unfortunetly no, you can't bind to a ConverterParameter. There's two options I've used in the past: instead of using a Converter, create a property on

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

馋奶兔 提交于 2019-11-27 18:10:10
问题 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

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

吃可爱长大的小学妹 提交于 2019-11-27 15:47:09
问题 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? 回答1: 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. 回答2: When code that updates

Is there any difference in x:name and name for controls in xaml file?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 15:39:45
I am new in Silverlight. When I add some control to my xaml file with Visual Studio it set controls name with Name property, but there is also x:Name. Is there any difference and when to use each of them? Thanks. In Brief Yes there is a difference. The bottom line is that x:Name can be used on object elements that do not have Name properties of their own. A longer explanation You can only use Name on an element that represents an object that actually does have a Name property. For example anything that derives from FrameworkElement . The x:Name attribute may be placed on any element that

What is the replacement for DataTrigger in Silverlight

点点圈 提交于 2019-11-27 13:37:35
This is my scenario. I have 2 Properties. Type and State. Type is an Enum with 3 values eg, ball, car, arrow. State is an int which would accept 3 state values eg., -1, 0, 1. Also, I have 9 images for each state values. Like, if I select type as ball and value as -1, I want to display a Red color ball. If I select type as arrow and value as 1, I want to display a up arrow. etc., I'm able to do this in WPF. I created 3 DataTemplates with an empty Image. Then, I use DataTrigger to check and update the particular image for the selected StateValue. But, in silverlight how can I do this. I know, I