The layout system lies have become a bit more elaborate [LayoutTransform functionality updated and enhanced for Silverlight 2 Beta 2!]
**
This blog has moved to a new location and comments have been disabled.
All old posts, new posts, and comments can be found on The blog of dlaa.me.
See you there!
Comments
Anonymous
July 04, 2008
Michael Washington on prompting for install, Peter McGrattan updated his Stock List Demo, Joel NeubeckAnonymous
July 09, 2008
The comment has been removedAnonymous
July 10, 2008
kettch, LayoutTransformControl is intended to wrap a single item and give that item the ability to transform as if during the layout pass. As such, I'm not sure wrapping your outer Grid in a LayoutTransformControl would accomplish what I understand your goal to be. What I would expect (without understanding the details of your approach) is that you would wrap the individual elements within the bounds of your layout system in LayoutTransformControl and do their rotations via LayoutTransformControl.Transform/RotateTransform. This should mean that the bounds reported by LayoutTransformControl.RenderSize will accurately reflect the transformation and you (or perhaps the layout system) can then decided if they need to be repositioned further. Hope this helps!Anonymous
July 10, 2008
Ok, I actually had to write a small wrapper to make it easier to manage a collection of LayoutTransformControl's and still be able to access the functionality of the underlying UserControl. However, I think I'm misunderstanding how transforms work. I can't seem to get the transforms to work programatically. Shouldn't something like the following work? Dim rot As New LayoutTransformControlSample.LtcRotateTransform rot.Angle = 90 Dim tg As New TransformGroup tg.Children.Add(rot) ActiveControl.Transform = tgAnonymous
July 10, 2008
kettch, Yes, I would expect the scenario to work. To check for myself, I created a new test project - and things seem to work properly. Here's the XAML and code for it - when the button is clicked, the new text shows up rotated. Hope this helps! <UserControl x:Class="LTCinCode.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <StackPanel x:Name="LayoutRoot"> <Button Content="Click me to add some rotated text!" Click="Button_Click"/> </StackPanel> </UserControl> using System.Windows; using System.Windows.Controls; using LayoutTransformControlSample; namespace LTCinCode { public partial class Page : UserControl { public Page() { InitializeComponent(); } private void Button_Click(object sender, RoutedEventArgs e) { var ltc = new LayoutTransformControl(); ltc.Transform = new LtcRotateTransform { Angle = 45 }; ltc.Child = new TextBlock { Text = "Hello world." }; LayoutRoot.Children.Add(ltc); } } }Anonymous
July 10, 2008
It turns out that I was making it more complicated than it needed to be, and my wrapper wasn't allowing good enough access to the LayoutTransformControl. After some further fiddling with it, everything is working great. Thank you very much for your help!Anonymous
September 25, 2008
Is there a way to have the LayoutTransformControl respect the CenterX and CenterY ScaleTransform properties? In my scenario, I have a large Image control nested in a ScrollViewer. The layout control is the only way I have found for the scroll bars to update based on content scale, but when I use the scale transform (standard or Ltc), the image is always scaled from the top left, ignoring any attempts to set a registration point. The same behavior occurs when using a MatrixTransform (standard or Ltc). Thanks in advance, ChrisAnonymous
September 25, 2008
The comment has been removedAnonymous
September 28, 2008
In the introductory post for LayoutTransformControl and the feature-enhancing follow-up , I gave a varietyAnonymous
November 18, 2008
I'd almost finished patting myself on the back for managing to implement WPF's LayoutTransform on SilverlightAnonymous
November 20, 2008
When I first wrote about adding full LayoutTransform fidelity to Silverlight with my LayoutTransformControlAnonymous
March 02, 2009
I'm a believer in the power of LayoutTransform - so much so that I wrote a control to graft this capabilityAnonymous
April 09, 2009
I came across a question on the Silverlight Toolkit support forum yesterday asking how to animate the