silverlight-4.0

Castle Windsor InternalsVisibleTo Silverlight

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 02:27:07
问题 I'm using Castle Windsor for SL v2.5.1.0. I have it proxy internal classes (the interfaces are public of course, but the implementation is internal, so that the consumer is only aware of the interface). I'm using the following attributes in my assembly with the internal classes [assembly: InternalsVisibleTo("Castle.Core, PublicKey

How to display HTML in Silverlight application?

邮差的信 提交于 2019-12-07 02:05:36
问题 I would need to display some basic HTML (just some paragraphs, unordered lists and hyperlinks) in my Silverlight application. How would I go about that? Which control to use? 回答1: Try this link for starters: http://www.wintellect.com/CS/blogs/jprosise/archive/2009/12/22/silverlight-4-s-new-html-hosting-support.aspx Here is the relevant part: Another of the new capabilities that Silverlight 4 brings to the platform is the ability to host HTML content inside a Silverlight control. This support

How to get the Owner of the ContextMenu (from Silverlight 4 toolkit)?

牧云@^-^@ 提交于 2019-12-07 00:13:26
When I use ContextMenu from Silverlight 4 Toolkit I want to get ContextMenu instance's Owner, but it's not available since in ContextMenu class Owner is an internal property. For example, I have a Rectangle put inside a Border. When I right-click a Rectangle (and a context menu appears) I need to change the Rectangle Border's thickness to indicate that the Rectangle is the current element of the parent Grid, for example. So I try to use ContextMenu.Loaded event where I get the ContextMenu (through the sender parameter), but I can't get the Owner of that ContextMenu (i.e. the Rectangle with its

Silverlight MVVM Confusion: Updating Image Based on State

此生再无相见时 提交于 2019-12-06 19:21:40
I'm developing a Silverlight application and I'm trying to stick to the MVVM principals, but I'm running into some problems changing the source of an image based on the state of a property in the ViewModel. For all intents and purposes, you can think of the functionality I'm implementing as a play/pause button for an audio app. When in the "Play" mode, IsActive is true in the ViewModel and the "Pause.png" image on the button should be displayed. When paused, IsActive is false in the ViewModel and "Play.png" is displayed on the button. Naturally, there are two additional images to handle when

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

僤鯓⒐⒋嵵緔 提交于 2019-12-06 15:44:31
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? 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 you log (or show on a message box): Log("Position = " + stream.Position); stream.Position = 0; Log("Position

Diagramming in Silverlight MVVM- connecting shapes

混江龙づ霸主 提交于 2019-12-06 15:43:48
问题 have I have a quesition regarding MVVM pattern in the use case diagarm. What I have so far is a list of Items which are my Shapes. ObservableCollection<ItemsViewModels> Items; and a Collection of Connection of Items ObservableCollection<ConnectionViewModel> Each ItemViewModel has an ID and a ConnectionViewModel has two ID to connect the Items. My ItemsViewModel Collection is bound to a Itemscontrol which is layout on a Canvas. With the ElementMouseDragBehavior I am able to drag my Items

Why .gif image shows only some first frames(Windows Phone)

老子叫甜甜 提交于 2019-12-06 15:02:33
问题 my previous question with source code is here: How to use gif animated image in WP 7 I am using http://imagetools.codeplex.com/ in my animated gif I have 24 frames, but it decodes only some first frames, so I see repetition animation of some(maybe two) frames again and again 回答1: For some gif-files this decoder work, for some other - don't. I downloaded source code of that project and found the code which doesn't work correctly. It is situated in the ImageTools.IO.Gif\GifDecoder.cs file, the

How to modify silverlight combobox data display

亡梦爱人 提交于 2019-12-06 14:43:44
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> </ComboBox> It works fine. However, once I select an item in the list, I want a different template to be

Issue with PackageRestore, Silverlight, and MSBuild

喜夏-厌秋 提交于 2019-12-06 12:39:09
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 step, or after that step, is looking for the packages, but the package restore does not run until after

How can I assign a custom UserControl to a DataGrid column header?

好久不见. 提交于 2019-12-06 12:22:19
I am trying to make a datagrid with a custom header that has a textblock and a button. The textblock and button is represented by this UserControl I created: <UserControl x:Class="SilverlightWorkshop.Controls.CollapsibleDataGridHeader" ... /> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding HeaderText, Mode=TwoWay}" /> <Button Content="←" Click="ArrowButtonClick"/> </StackPanel> </UserControl> The idea is, when the user clicks the button, the column width will collapse to a small size. However, I am having trouble finding an elegant solution for using this control as a template