Difference between revisions of "Silverlight"
From Richard's Wiki
| Line 15: | Line 15: | ||
<code> | <code> | ||
Effect="{StaticResource DropShadow}" | Effect="{StaticResource DropShadow}" | ||
| + | </code> | ||
| + | * To get position of a UIElement: | ||
| + | <code> | ||
| + | // Obtain transform information based off root element | ||
| + | UIElement element = this as UIElement; | ||
| + | GeneralTransform gt = element.TransformToVisual(Application.Current.RootVisual); | ||
| + | // Find the four corners of the element | ||
| + | Point topLeft = gt.Transform(new Point(0, 0)); | ||
| + | Point topRight = gt.Transform(new Point(element.RenderSize.Width, 0)); | ||
| + | Point bottomLeft = gt.Transform(new Point(0, element.RenderSize.Height)); | ||
| + | Point bottomRight = gt.Transform(new Point(element.RenderSize.Width, element.RenderSize.Height)); | ||
</code> | </code> | ||
=== Silverlight Control Libraries === | === Silverlight Control Libraries === | ||
* [http://silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/default.html Silverlight Toolkit (Codeplex)] | * [http://silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/default.html Silverlight Toolkit (Codeplex)] | ||
* [http://mightymeaty.members.winisp.net/blacklight.silverlight/ Blacklight] | * [http://mightymeaty.members.winisp.net/blacklight.silverlight/ Blacklight] | ||
Revision as of 18:21, 11 March 2010
- 4 Simple Steps to Consume WCF Service using Silverlight
- Interaction between Silverlight and HTML
- How to Construct a Reusable Silverlight ASP.NET User Control
- Silverlight 3 Drag Behavior (using WriteableBitmap())
- Dropshadow effect (in Resources):
<DropShadowEffect x:Key="DropShadow"
BlurRadius="15"
Color="Black"
Direction="320"
Opacity="1.0"
ShadowDepth="10" />
- To use:
Effect="{StaticResource DropShadow}"
- To get position of a UIElement:
// Obtain transform information based off root element UIElement element = this as UIElement; GeneralTransform gt = element.TransformToVisual(Application.Current.RootVisual); // Find the four corners of the element Point topLeft = gt.Transform(new Point(0, 0)); Point topRight = gt.Transform(new Point(element.RenderSize.Width, 0)); Point bottomLeft = gt.Transform(new Point(0, element.RenderSize.Height)); Point bottomRight = gt.Transform(new Point(element.RenderSize.Width, element.RenderSize.Height));