Skip to content

Commit

Permalink
Show transform issue in test application.
Browse files Browse the repository at this point in the history
Trying to fix the rendering issue described in #2.
  • Loading branch information
Steven Kirk committed Dec 17, 2014
1 parent fd17491 commit 71208bc
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions TestApplication/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -464,14 +464,15 @@ private static TabItem LayoutTab()

private static TabItem AnimationsTab()
{
Rectangle rect1;
Border border1;
Rectangle rect2;
RotateTransform rotate;
Button button1;

var result = new TabItem
{
Header = "Animations",
IsSelected = true,
Content = new Grid
{
ColumnDefinitions = new ColumnDefinitions
Expand All @@ -486,14 +487,19 @@ private static TabItem AnimationsTab()
},
Children = new Controls
{
(rect1 = new Rectangle
(border1 = new Border
{
Width = 100,
Height = 100,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Fill = Brushes.Crimson,
Background = Brushes.Crimson,
RenderTransform = new RotateTransform(),
Content = new Border
{
Background = Brushes.Gainsboro,
Margin = new Thickness(25),
}
}),
(rect2 = new Rectangle
{
Expand All @@ -502,13 +508,13 @@ private static TabItem AnimationsTab()
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Fill = Brushes.Coral,
RenderTransform = (rotate = new RotateTransform
{
PropertyTransitions = new PropertyTransitions
{
RotateTransform.AngleProperty.Transition(500),
}
}),
//RenderTransform = (rotate = new RotateTransform
//{
// PropertyTransitions = new PropertyTransitions
// {
// RotateTransform.AngleProperty.Transition(500),
// }
//}),
PropertyTransitions = new PropertyTransitions
{
Rectangle.WidthProperty.Transition(300),
Expand All @@ -532,12 +538,12 @@ private static TabItem AnimationsTab()
if (rect2.Width == 100)
{
rect2.Width = rect2.Height = 400;
rotate.Angle = 180;
//rotate.Angle = 180;
}
else
{
rect2.Width = rect2.Height = 100;
rotate.Angle = 0;
//rotate.Angle = 0;
}
};

Expand All @@ -551,7 +557,7 @@ private static TabItem AnimationsTab()
return 360.0 * progress;
});

rect1.RenderTransform.Bind(
border1.RenderTransform.Bind(
RotateTransform.AngleProperty,
degrees,
BindingPriority.Animation);
Expand Down

0 comments on commit 71208bc

Please sign in to comment.