silverlight-4.0

MemoryStream.Position or MemoryStream.Seek does not work (Silverlight)

自作多情 提交于 2019-12-08 08:15:22
问题 I have a memorystream in a silverlight app. I have to copy this memorystream to a filestream object. If I call: memoryStream.Position = 0; memoryStream.Seek(0,SeekOrigin.Begin); It does not work, I debug the application, check the properties of the memorystream, and the position still points to the end of the file. Any clues? 回答1: Is it possible that another of your properties is being triggered in the debugger, and reading through the stream? Rather than using the debugger, what happens if

Silverlight Toolkit ContextMenu: Which control was right-clicked?

限于喜欢 提交于 2019-12-08 08:12:26
问题 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=

How to modify silverlight combobox data display

五迷三道 提交于 2019-12-08 07:51:16
问题 I have a combobox defined as follows: <ComboBox x:Name="cboDept" Grid.Row="0" Margin="8,8,8,8" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" ItemsSource="{Binding Source={StaticResource cvsCategories}}"> <ComboBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Vertical" Width="Auto" Height="Auto"> <sdk:Label Content="{Binding CategoryID}" Height="20" /> <sdk:Label Content="{Binding CategoryName}" Height="20" /> </StackPanel> </DataTemplate> </ComboBox.ItemTemplate> <

HTML in Silverlight

家住魔仙堡 提交于 2019-12-08 06:51:00
问题 I am making a silverlight interface for a discussion board. The boards web interface allows the usual HTML tags like i,a,img,b,u. So now I need to be able to display that in Silverlight. This: http://www.vectorlight.net/silverlight/controls/rich_textblock.aspx seemed like exactly what I need except that it hardly displays anything right. Every HTML(i've made sure it's valid with HTMLAgility) string I give it either makes the whole SL app go white, or the block displays all the text on top of

how to set the rounded inside corners of a grid in Silverlight 4

我怕爱的太早我们不能终老 提交于 2019-12-08 06:13:50
问题 I need to set the rounded corners inside the grid control using silverlight 4. When I tried to do something like this: <Border BorderThickness="2" BorderBrush="#FF3EA9F5" Grid.Row="1" CornerRadius="5,5,0,0" Height="10" VerticalAlignment="Bottom"> <Grid x:Name="Phani1" Width="auto"> </Grid> </Border> I am able to see rounded corners outside the grid. But I want to grid to appear as a rectangle from outside border. But the inside corners of the grid should appear as rounded. Please let me know

Save Silverlight webcam image (ImageSource) to Server

梦想的初衷 提交于 2019-12-08 04:28:05
问题 This is as far as I've gotten. What code would I write to save a captured image to the server? Without any dialog prompting for a save location. Similar to the way Facebook does it. (I've been unable to find examples online) void CaptureSource_CaptureImageCompleted(object sender, CaptureImageCompletedEventArgs e) { capturedImage.ImageSource = e.Result; stopCapture(); // turns off webcam } 回答1: It is not that simple. Create a WCF service on the server. Consume it on the silverlight client.

How to play videos using Smooth Streaming media element

a 夏天 提交于 2019-12-08 04:13:30
问题 I want to stream a video file in my windows phone application.. After i have researched, the smooth streaming media element would do this, I believe. but when im assigning the SmoothStreamingSource to "http://www.streaming/video.mp4" the player does not show any video. But when i change the source to an .ism file it buffered and the video was playing. but I will only the video UTL from my web service. Pls help me in how to do this im WP apps. Here is my code: Using .ism file which works good:

How to achieve Natural(human alpha-numeric ) Sorting, for silverlight datagrids using ViewModel?

╄→гoц情女王★ 提交于 2019-12-08 03:00:02
问题 In silverlight project that uses datagrid, I am using some column that defines "Label number" which is a Varchar. I want to sort this column as described in natural sort order as described in "http://www.interact-sw.co.uk/iangblog/2007/12/13/natural-sorting" or any possible way. When I look around datagrid I saw SortMemberPath="stringProperty" only. Hence, my sorting is just working like string sorting only. For example: Z1 Z10 Z2 Z20 where as I want it to sort like: Z1 Z2 Z10 Z20 It will be

How can I combine some UserControls in SilverLight?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 02:53:56
问题 Maybe it is a simple question, but I can’t find the answer. I have three User controls that are different only with colour. There is code one of them: <UserControl x:Class="SilverlightApplication14.NodePicture" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:SilverlightApplication14"> <UserControl.Resources> <local:NodeViewModel x:Key="Children" /> </UserControl.Resources> <Grid x:Name=

Issue with PackageRestore, Silverlight, and MSBuild

点点圈 提交于 2019-12-08 02:20:23
问题 We use NugetPowerTools PackageRestore to avoid putting our packages folder in svn. This works building .NET projects with Visual Studio and MSBuild. It also works building Silverlight projects with Visual Studio. However, when we use MSBuild to build Silverlight projects, the build fails. This appears to have to do with the tasks in Microsoft.Silverlight.Common.targets . Looking at the MSBuild output, it appears to get to the step GetXapOutputFile before it errors. Something either in that