Skip to main content

Microsoft Silverlight

Answered Question Unexpected Result From TransformGroup Created in CodeRSS Feed

(0)

ld1453
ld1453

Member

Member

284 points

112 Posts

Unexpected Result From TransformGroup Created in Code

 Hello, I've made an animation in both code and XAML that I think should have the same effect but don't.  I don't believe the difference is a direct result of the animation but more likely where a TransformGroup is created that the animation uses.

My goal was to make create a new TransformGroup in the RenderTransform of the the control to be animated so that if there were any existing Transform I wouldn't mess it up. Sort of going from  this 

<ObjectToTransform>
    <ObjectToTransform.RenderTransform>
        <TransformGroup>
            <!-- Existing Transforms -->
        </TransformGroup>
    </ObjectToTransform.RenderTransform>
</ObjectToTransform>
to this 
<ObjectToTransform>
    <ObjectToTransform.RenderTransform>
        <TransformGroup>
            <!-- Existing Transforms -->

            <TransformGroup x:Name="MyIdentifier">
                <!-- My Transforms -->
            </TransformGroup>
        </TransformGroup>
    </ObjectToTransform.RenderTransform>
</ObjectToTransform>
When the TransformGroup with Name "MyIdentifier" is created in XAML everything occurs as expected, 
but if it's made and added in code the result is very different. Does anybody know why this would happen?

If anybody is interested and needs more information I wouldn't mind putting in the effort to recreate it in
a separate project for you.

nirav_2052003
nirav_20...

Member

Member

274 points

105 Posts

Answered Question

Re: Unexpected Result From TransformGroup Created in Code

Can u write few lines about how you are assigning transform values programmatically. I doubt the type casting of transform object to be improper. Sp please give me some more data about ur problem so that I can assist you better.

 

Regards,

Nirav

ld1453
ld1453

Member

Member

284 points

112 Posts

Re: Unexpected Result From TransformGroup Created in Code

 Thank for responding Nirav.  I reproduced my problem in another project to show you and I found my problem.  My transform wasn't working as expected because of the order I was adding the transformations to the TransformGroup. I needed to add the ScaleTransform before the TranslateTransform.  Thanks for your help. My new rule is going to be reproduce my question in another project before posting.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities