silverlight-3.0

Opening response stream in silverlight

我的梦境 提交于 2019-12-10 19:58:08
问题 I am attempting to return a image from a server using Silverlight 3. The server returns the Response stream like this: context.Response.ContentType = imageFactory.ContentType imgStream.WriteTo(context.Response.OutputStream) imgStream.Close() context.Response.End() On the Silverlight client I am handling the stream like: Dim request As HttpWebRequest = result.AsyncState Dim response As HttpWebResponse = request.EndGetResponse(result) Dim responseStream As IO.Stream = response.GetResponseStream

CollectionViewSource.GetDefaultView is not in Silverlight 3! What's the work-around?

折月煮酒 提交于 2019-12-10 16:50:10
问题 The CollectionViewSource.GetDefaultView() method is not in Silverlight 3. In WPF I have this extension method: public static void SetActiveViewModel<ViewModelType>(this ViewModelBase viewModel, ViewModelType collectionItem, ObservableCollection<ViewModelType> collection) where ViewModelType : ViewModelBase { Debug.Assert(collection.Contains(collectionItem)); ICollectionView collectionView = CollectionViewSource.GetDefaultView(collection); if(collectionView != null) collectionView

Silverlight Canvas doesn't support KeyDown?

非 Y 不嫁゛ 提交于 2019-12-10 15:34:42
问题 I have this: <Canvas x:Name="LayoutRoot" KeyDown="LayoutRoot_KeyDown"> </Canvas> In a newly-minted Ag 3 application in VS2008. I simply changed the default <Grid /> to <Canvas /> and added a KeyDown handler that pops a MessageBox. But no matter how I tried, the KeyDown event just would never, ever fires. Is it simply that <Canvas /> doesn't support KeyDown or am I doing something wrong? 回答1: You need to have at least something inside the Canvas that can receive focus, and you will find that

Silverlight 3 Checkbox Listbox bug when scrolling?

我的梦境 提交于 2019-12-10 15:11:36
问题 I've spent a few minutes searching on Google and have not found anything related to this issue I'm having: Today I upgraded to the Silverlight 3 SDK and converted a project that I'm working on. I then noticed a bug in my program with a Listbox that has a Checkbox as its DataTemplate. When one or more items is checked, and I scroll up and down, it seems that a few of the Checkboxes at the extremes get checked off and on randomly. This does not trigger the Checked/Unchecked event, however. Has

Modifying look/behavior of the new Popup control (ChildWindow) in Silverlight 3

痴心易碎 提交于 2019-12-10 13:55:40
问题 I would like to remove grey header of the new Popup control in Silverlight 3. Any ideas if this is possible? 回答1: Pretty easy, just edit the default ChildWindow style. In Blend 3 create a new Item of type ChildWindow. (Right Click on the Project --> New Item --> Select ChildWindow from the list) Right click on ChildWindow in the "Objects and Timeline" pane --> Edit Template --> Edit Copy. Navigate to the element named "Chrome" inside the default template and change the Background to whatever

How to call javascript function on a Silverlight 3 object?

对着背影说爱祢 提交于 2019-12-10 11:23:07
问题 I have the following Silverlight control defined: <object id="objImageViewer" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="500px"> <param name="source" value="../ClientBin/SomeImageViewer.xap"/> <param name="onError" value="onSilverlightError" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="3.0.40624.0" /> <param name="autoUpgrade" value="true" /> <param name="windowless" value="true" /> <param name=

Silverlight 3 Datagrid: Get row/item on MouseOver

烂漫一生 提交于 2019-12-10 10:50:00
问题 I have a bound DataGrid and various other controls(external to the datagrid) that show more details about the selectedrow in the datagrid. This is easy to do with databinding or handling the SelectionChanged event on the datagrid. However, how do I do this without requiring the user to select a row - eg on 'mouseover' can I change the selected item or get the row/item 'under' the mouse. 回答1: Try something like this in your container class like UserControl, Grid, StackPanel, etc... public

Bind ObservableCollection to a DataGrid after assigning new value

谁说胖子不能爱 提交于 2019-12-10 10:34:28
问题 It seems to be a simple problem, but I can't get it to work. I have a UserControl with the following property: public ObservableCollection<HL7Message> source {get; set;} And the following Binding: <data:DataGrid x:Name="dgMessages" Grid.Row="2" AutoGenerateColumns="True" ItemsSource="{Binding source}" ></data:DataGrid> from a parent UserControl I set the value upon a button click: messagesGrid.source = src; //messagesGrid is the name of the UserCntrol above I'm expecting my DataGrid to be

How to change background colors in ReadOnly textbox in silverlight 5?

╄→尐↘猪︶ㄣ 提交于 2019-12-10 09:51:48
问题 I Want To Change Color of ReadOnly Textbox It is Possible To Change Default Color to white Color <Style TargetType="TextBox"> <Setter Property="Background" Value="White"/> <Setter Property="Foreground" Value="Black"/> </Style> and textbox as <TextBox Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" Height="18" Padding="0" IsReadOnly="True" Margin="3,0,3,0"/> Thanks In Advance 回答1: The problem is not that the Background Setter doesn't work, it is that the ReadOnly state for the

Multiple Out-of-Browser Applications in One Application

六眼飞鱼酱① 提交于 2019-12-10 09:33:33
问题 I'm looking at a scenario where I need to create a single "master" Silverlight application and then add "child" applications for an out-of-browser Silverlight application. The scenario is something like this. A user will visit a gameboard web site and choose a game to play. Let's call it Checkers. He likes it, so then he installs the out-of-browser app to his desktop. He then finds Chess, and installs that too. For both games, while played on the site, he has stats (games played, win/loss