silverlight

Silverlight: Canvas overflows

不羁岁月 提交于 2019-12-21 09:34:30
问题 I have created a Canvas, and within it I placed a StackPanel. The StackPanel is horizontal, and it accepts a list of thumbnailed images. The Canvas has a fixed size. When I put more thumbnails than the Canvas width can hold, the StackPanel is supposed to overflow from the Canvas, so I can move it to center the current thumbnail. Everything works correctly, only, the StackPanel's overflow is visible! Is there a way to hide it? Or is the entire approach wrong? Here is a screenshot. The canvas

How to Set this Kind of Perspective Transform in Matrix3D?

孤街浪徒 提交于 2019-12-21 09:29:00
问题 I have an image with and have a few values to make it a perspective in Silverlight, but can't quite figure out what I need to do mathmatically to make it happen. The most important thing is I have an angle called a "Field of View" ( FOV ). This is the normal picture: For example: X = 30° X = 30° X = 30° FOV = 30° FOV = 60° FOV = 120° X = 60° X = 60° X = 60° FOV = 30° FOV = 60° FOV = 120° Any help would be appreciated to walk me through the math to reproduce these in Silverlight. 回答1: I think

MVVM for Web Development

断了今生、忘了曾经 提交于 2019-12-21 09:22:16
问题 I've been reading up on MVVM and so far have found it very interesting. Most of the examples I've found, however, are for Windows apps, as opposed to Web apps. I've also seen a lot of mention of MVVM used with Silverlight, and I know Silverlight can be used for either Web or Windows apps. So my question is - is MVVM a valid pattern for Web-based apps? If it is, does the UI have to be Silverlight? I'm in the process of deciding which technologies to use for a new mid-size website we need to

RIA/EF4 Entity property mapped to NOT NULL nvarchar - empty string

爷,独闯天下 提交于 2019-12-21 09:22:12
问题 Background: Entity Framework 4 Silverlight 4 RIA services MSSQL Server 2008 I have an entity that has a String property named Description. In database it maps to the NOT NULL NVARCHAR(200) . Problem: When I try to insert a new row of that entity, this is what I do: MyExampleEntity entity = new MyExampleEntity() { Name = "example", Description = "" // NOTE THIS LINE! }; DatabaseContext db = new DatabaseContext(); db.MyExampleEntities.Add(entity); db.SubmitChanges(); This, however, causes an

Is System.Security.Cryptography namespace supported by the Portable Class Library

被刻印的时光 ゝ 提交于 2019-12-21 09:06:22
问题 I am converting an existing multi-target Silverlight/.NET project to a Portable Class Library project in order to reduce the number of projects that are required to support multiple Microsoft platforms. I have an error in one class that is using the System.Security.Cryptography namespace The type or namespace name 'Cryptography' does not exist in the namespace 'System.Security' (are you missing an assembly reference?) This namespace is available in Silverlight and I am wondering why the

In a button's control template, how can I set the color of contained text?

半腔热情 提交于 2019-12-21 08:00:17
问题 Using Silverlight 4 & WPF 4, I'm trying to create a button style that alters the text color of any contained text when the button is mouseover'd. Since I'm trying to make this compatible with both Silverlight & WPF, I'm using the visual state manager: <Style TargetType="{x:Type Button}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Border x:Name="outerBorder" CornerRadius="4" BorderThickness="1" BorderBrush="#FF757679"> <VisualStateManager

How to define a DataTemplate in code?

和自甴很熟 提交于 2019-12-21 07:34:12
问题 How can I create a DataTemplate in code (using C#) and then add a control to that DataTemplate ? <data:DataGrid.RowDetailsTemplate> <DataTemplate> <Border> <Border Margin="10" Padding="10" BorderBrush="SteelBlue" BorderThickness="3" CornerRadius="5"> <TextBlock Text="{Binding Description}" TextWrapping="Wrap" FontSize="10"> </TextBlock> </Border> </Border> </DataTemplate> </data:DataGrid.RowDetailsTemplate> I am using Sivlerlight. 回答1: As far as I know, the only way to create a DataTemplate

Ria Services Passing Complex Object as parameter to a query domain service method

淺唱寂寞╮ 提交于 2019-12-21 07:30:56
问题 I'm experiencing some difficulties with a WCF RIA Services similar to the problem specified in this thread. The domainservice method I'm creating (a Query method) should take a complex object parameter. example domainservice method: public ComplexObjectResult GetComplexObject(ComplexObjectParameter test) { //do stuff } the parameter object: public class ComplexObjectParameter { [Key] public decimal ID { get; set; } ... other fields } I get this compilation error: Error 70 Parameter 'test' of

How to invert clipping geometry in Silverlight/WPF?

和自甴很熟 提交于 2019-12-21 07:22:29
问题 The UIElement.Clip property takes a Geometry object and uses it to clip away the outside of the UIElement . I would like to do the geometric inverse and punch a hole into the element instead. Anyone know how to do this? I imagine creating an inverted version of the clip geometry would work, but I can't find a way to do this. EDIT It seems that WPF has Geometry.Combine which can be used to subtract one geometry from another, though this isn't available in Silverlight. If it were, I could

How to invert clipping geometry in Silverlight/WPF?

巧了我就是萌 提交于 2019-12-21 07:21:03
问题 The UIElement.Clip property takes a Geometry object and uses it to clip away the outside of the UIElement . I would like to do the geometric inverse and punch a hole into the element instead. Anyone know how to do this? I imagine creating an inverted version of the clip geometry would work, but I can't find a way to do this. EDIT It seems that WPF has Geometry.Combine which can be used to subtract one geometry from another, though this isn't available in Silverlight. If it were, I could