silverlight-4.0

Silverlight 4 ComboBox - Binding to Nullable data (tried TargetNullValue but not working as expected)

放肆的年华 提交于 2019-12-11 16:34:44
问题 (Please note - I am a Silverlight beginner and am looking for the simplest solution here, e.g. that doesn't involve writing/installing a replacement for the ComboBox control!) This is an issue with a Silverlight 4 application that uses the View Model (MVVM) approach. I have a simple form for editing a "Product" object. Product has a CategoryID property which is nullable (int?). A ComboBox is used to view and set the CategoryID - this is bound to an ObservableCollection of Categories. Product

how to call an animation in mainpage.xaml from login.xaml in silverlight 4

强颜欢笑 提交于 2019-12-11 15:46:31
问题 I am making a Silverlight Application using expression Blend 4.0. I have mainpage.xaml and I've given the user control (loginpage.xaml) on it. Then I have the login button in user control (loginpage.xaml). I have prepared the animation also on the mainpage.xaml, so that when the user click the login button, then the animation is started. I have no idea what should the command I give in the login button so that the animation will start when the user click it. or would you like to give another

Rad Mask TextBox: Change Text to upper and position cursor at end of the text.

荒凉一梦 提交于 2019-12-11 15:06:52
问题 I have Rad Mask TextBox and a button. So user can enter any case into the text box. when button is clicked, I am fetching some record based on text and event I have to change the text to upper, trim and position the caret to end. I noticed, if upper case is entered, I get all the scenario's but when lower case is entered the postion of cursor is pointed to beginning. this is what I tried. txtSearch.MaskedText = txtSearch.MaskedText.ToUpperInvariant().Trim(); txtSearch.SelectionOnFocus =

Why are the InitParams I pass into Silverlight always empty?

半腔热情 提交于 2019-12-11 14:49:41
问题 My Silverlight application needs one parameter, an integer. In my Html, I have written: <param name="InitParameters" value="UserId=1" /> In code I am reading the parameters in: foreach (KeyValuePair<string, string> pair in e.InitParams) { Resources.Add(pair.Key, pair.Value); } e.InitParams is always empty. Any ideas? 回答1: Because I'm passing in "InitParameters" instead of "InitParams". That's what I get for staring at my code for too long. 来源: https://stackoverflow.com/questions/3144666/why

Multi level grid in Expression Blend

旧街凉风 提交于 2019-12-11 14:16:42
问题 I have been playing with Expressions Blend 4 for the past few days, and I'm starting to get a hang of it. I just recently started playing with the Data binding and find it really easy and powerful. For prototyping purposes, there is no better application. I'm currently prototyping a Silverlight screen with a potential multi-level grid. Is there any way to do this with Blend? I tried creating a multi-level data sample (I added a collection data to a collection data) and dragged it to a

RIA Services: Enumerate Deleted Entities

北战南征 提交于 2019-12-11 14:03:40
问题 My RIA service context class has an entity set TaskToOperationAssociations which contains a list of Task to Operation associations. Is there a way to "find" an association entity which has been removed from the collection? I can see that the context has a reference to the removed Association in it's private fields (it obviously needs to keep track of it so the delete operation can be submitted). Here's an example... If I have Task "A" (with Id=T1) which is associated to Operation X, Y and Z

Access HorizontalOffset from ScrollViewer in Datagrid

安稳与你 提交于 2019-12-11 13:58:14
问题 I have a DataGrid from the Silverligt 4.0 SDK. I want to access "HorizontalOffset" from the internal ScrollViewer of the DataGrid. I can access attached properties for it, such as: <data:DataGrid x:Name="MyGrid" ItemsSource="{Binding Elements}" ScrollViewer.HorizontalScrollBarVisibility="Visible"> But how can I access the ScrollViewers HorizontalOffset property? If I could bind it in XAML it would be nice but it could be enough to access it from code behind. I've tried to find it by iterating

How to bind to a custom property in a Silverlight Custom control

我的梦境 提交于 2019-12-11 13:39:48
问题 I've created a custom control with, amongst others, the following: public partial class MyButton : UserControl { public bool Enabled { get { return (bool)GetValue(EnabledProperty); } set { SetValue(EnabledProperty, value); SomeOtherStuff(); } } } public static readonly DependencyProperty EnabledProperty = DependencyProperty.Register("Enabled", typeof(bool), typeof(MyButton), new PropertyMetadata(true)); public static void SetEnabled(DependencyObject obj, bool value) { obj.SetValue

How to move cursor to next field auto without hit Tab Key in Silverlight?

Deadly 提交于 2019-12-11 13:37:14
问题 Suppose I set MaxLength=3 for a textbox, when user input 3 char in this field, I want to the cursor move to next item. It's default is user must hit Tab or use mouse to move the cursor to next field. How to implement this request? 回答1: There may be a more clever way but at first glance I would say a simple way would be to you add a TextChanged event to your TextBox and then when the number of characters hits the 3 you mention then set the focus to what you want. So if this is in your xaml:

Open a local xml file in WP7

情到浓时终转凉″ 提交于 2019-12-11 13:26:49
问题 Me having a local xml file and need to load it to Isolated Storage when my app. starts for first time. but if i am opening that file using stream OR File.Open it's throwing an error. Also i need to store that file in serialized form. Please help, as being new to WP7 and C# not able to crack it. Following code is used for opening the XML file: FileStream stream = new FileStream("site.xml", FileMode.Open); 回答1: If the file is a part of your project then you can add the file to your project as