silverlight

Pass data to Child Window in Silverlight 4 using MVVM

一世执手 提交于 2019-12-22 09:59:55
问题 I have a datagrid with master detail implementation as follows: <data:DataGrid x:Name="dgData" Width="600" ItemsSource="{Binding Path=ItemCollection}" HorizontalScrollBarVisibility="Hidden" CanUserSortColumns="False" RowDetailsVisibilityChanged="dgData_RowDetailsVisibilityChanged"> <data:DataGrid.Columns> <data:DataGridTextColumn Header="Item" Width="*" Binding="{Binding Item,Mode=TwoWay}"/> <data:DataGridTextColumn Header="Company" Width="*" Binding="{Binding Company,Mode=TwoWay}"/> </data

Silverlight HttpWebRequest syncronous call

£可爱£侵袭症+ 提交于 2019-12-22 09:17:54
问题 In my silverlight app I do a file upload. I break the file into chunks and then I upload each chunk. The problem is that I want to use the HttpWebRequest synchronously. My propblem is to ensure that all request are ok and to catch exceptions. Is that possible in Silverlight? I would like sopmething like: while(chunk) { try{ HttpWebRequest req = ... req.BeginGetRequestStream(new AsyncCallback(WriteCallback), req); //add data into request stream req.BeginGetResponseStream(new AsyncCallback

Changing the UI language dynamically

心不动则不痛 提交于 2019-12-22 09:05:10
问题 I have a multi-language silverlight application where the resources are stored in resx files for different languages and bound to the buttons' and labels' Content Properties inside the xaml. When setting the thread's UI culture in the constructor of the silverlight's page every thing works fine, but when changing it based on user's selection (through combobox selection) the interface doesn't change. I need the page to redraw the controls and rebind to the resource files based on the new

Set focus to a Silverlight control from javascript

≡放荡痞女 提交于 2019-12-22 08:57:44
问题 I'm having a focus issue with Silverlight... How can I set the focus to my Silverlight control using javascript? 回答1: Add the following to your Silverlight hosting page (just above the onSilverlightError function): function appLoad(sender, args) { var xamlObject = document.getElementById('SilverlightObject'); if (xamlObject != null) xamlObject.focus(); } In the object declaration itself (e.g. in <object id='SilverlightObject' ) add this after <param name="onError" value="onSilverlightError" /

allowing clicks on Button in ComboBoxItem when IsHitTestVisible is false

限于喜欢 提交于 2019-12-22 08:55:04
问题 alt text http://img375.imageshack.us/img375/9830/combobox.png Setting the IsHitTestVisible="false" has the effect of having the whole ComboBox's drop area unresponsive to clicks. The same goes for setting to true. With a ComboBox I don't have to create any storyboard to make ComboBox animation like but I found this issue. How can one make the ComboBoxItem area unclickable except for the button within? 回答1: Sounds like you should be creating a custom control that uses a popup window, that just

Obtaining caret position in TextBox

一笑奈何 提交于 2019-12-22 08:37:17
问题 How to get caret position (x, y) in the visible client zone in TextBox control? I need to add an auto complete feature to the text box. I've found solution for WPF, but it can't be applied in Silverlight. 回答1: public class AutoCompleteTextBox : TextBox { public Point GetPositionFromCharacterIndex(int index) { if (TextWrapping == TextWrapping.Wrap) throw new NotSupportedException(); var text = Text.Substring(0, index); int lastNewLineIndex = text.LastIndexOf('\r'); var leftText =

Converting ESQL to LINQ to Entities. Sort by related entities

蹲街弑〆低调 提交于 2019-12-22 08:29:44
问题 I am using EF + RIA and unfortunately meet some problems with sorting by related entities. For such purpose there is ESQL query that I implemented (found only this solution): var queryESQL = string.Format( @" select VALUE ent from SomeEntities as ent join Attributes as ea ON ea.EntityId = ent.Id where ea.AttributeTypeId = @typeId order by ea.{0} {1}", columnName, descending ? "desc" : "asc"); var query = ObjectContext.CreateQuery<SomeEntity>(queryESQL, new ObjectParameter("typeId",

Alternative IDE for Silverlight

狂风中的少年 提交于 2019-12-22 08:28:52
问题 I want to play around with silverlight without having to buy a Visual Studio 2008 license. I already used my trial time with Visual Studio, so I'm trying to find another solution. Any thing out there? Thanks 回答1: Visual Web Developer Express SP1 is supported with RC0 and later. Install it first, then install the tools. 回答2: What I heard, you can use VS Express SP1 with Silverlight. 回答3: Use Eclipse Eclipse tools for Microsoft Silverlight check out http://www.eclipse4sl.org/ 来源: https:/

Animating Margin Bottom Silverlight

隐身守侯 提交于 2019-12-22 08:17:00
问题 I'm currently working with animations, I have a grid hiding a search panel, clicking on the search button moves the grid down revealing the search options. I have this part working the problem is that the grid view takes up all available space so when the search bar is hidden it looks fine but if the search bar is visible then the bottom of the grid goes off the page. I've been trying to fix this using a margin, when the search bar is revealed the bottom margin is increased, reducing its

After rebinding Silverlight Listbox control how do you get it listbox to scroll to back to the top?

这一生的挚爱 提交于 2019-12-22 08:14:10
问题 I have a silverlight listbox that is being used as a search result box. I'm using dynamic searching (keyups in the search box cause the events to fire to filter this list box's contents). The issue I'm running into is if the user scrolls down when the box is unfiltered, then does the search, the rebinding of the listbox does not cause the scroll to go back up to the top making the results look like there is only one value in it. the code I have so far for the listbox is this (This is a