Update for Beta 2?

Jun 9, 2008 at 6:39 PM
Hi, the code actually compiles under Beta 2 with no problems.

However, when you run it, a few errors occur, like setting properties, which are easily fixed.

The problem is that in the following code, it fails on the casting, and I'm not sure why.

        internal Transform FindTransform(FrameworkElement target, string transformName)
        {
            if (target.RenderTransform != null)
            {
                if (((TransformGroup)target.RenderTransform).Children.Count > 0)
                {
                    for (int i = 0; i < ((TransformGroup)target.RenderTransform).Children.Count; i++)
                    {
                        if (((TransformGroup)target.RenderTransform).Children[i].GetType().Name == transformName)
                        {
                            return (Transform)((TransformGroup)target.RenderTransform).Children[i];
                        }
                    }
                }
            }
            return null;
        }

Help!