我已经完成了一个简单的userControl对象“MilObject”,它将遵循鼠标在InkCancas上完成的路径。我的问题是动画不想开始。好吗?
这是我的inkCanvas背后的代码:
private void myInkCanvas_StrokeCollected(object sender, InkCanvasStrokeCollectedEventArgs e)
{
if (myInkCanvas.Children.Count > 0)
{
myInkCanvas.Children.RemoveAt(0);
}
MilObject myObj = new MilObject();
InkCanvas.SetLeft(myObj, (e.Stroke.StylusPoints[0].X));
InkCanvas.SetTop(myObj, (e.Stroke.StylusPoints[0].Y));
myObj.Height = 100;
myObj.Width = 100;
myObj.Color = myColorPicker.SelectedColor;
myInkCanvas.Children.Add(myObj);
if (myInkCanvas.Children.Count > 0)
{
MilObject myMilObject = myInkCanvas.Children[0] as MilObject;
myMilObject.RenderTransformOrigin = new Point(0.5, 0.5);
//get the path from the mouse mouvements points collection
myPath = new PathGeometry();
Geometry temp = e.Stroke.GetGeometry();
myPath.AddGeometry(temp);
//create the MatrixAnimationUsingPath
MatrixAnimationUsingPath myanimation = new MatrixAnimationUsingPath();
myanimation.PathGeometry = myPath;
myanimation.FillBehavior = FillBehavior.HoldEnd;
myanimation.Duration = TimeSpan.FromSeconds(60);
myanimation.DoesRotateWithTangent = true;
//Set the static parameters for the Storyboard
Storyboard.SetTarget(myanimation, myMilObject);
Storyboard.SetTargetProperty(myanimation,new PropertyPath("(UIElement.RenderTransform).(MatrixTransform.Matrix)"));
Storyboard.SetTargetName(myanimation, "myMilObject");
// Create a Storyboard to contain and apply the animation.
Storyboard pathAnimationStoryboard = new Storyboard();
//begin the animation
pathAnimationStoryboard.Children.Add(myanimation);
pathAnimationStoryboard.Duration = myanimation.Duration;
pathAnimationStoryboard.Begin();
}
}
这是我的XAML userControl MilObject
<UserControl x:Name="MilObject1" x:Class="MilOpViewer.MilObject"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
Height="100" Width="100">
<UserControl.RenderTransform>
<TransformGroup>
<TranslateTransform X="-50" Y="-50"></TranslateTransform>
<MatrixTransform></MatrixTransform>
</TransformGroup>
</UserControl.RenderTransform>
<UserControl.Resources>
<DrawingBrush x:Key="plane1" Stretch="Uniform">
<DrawingBrush.Drawing>
<DrawingGroup x:Name="myGroup">
<DrawingGroup.Children>
<GeometryDrawing Geometry="F1 M 631.401,518.352C 640.017,521.898 644.826,526.069 644.873,530.959C 644.916,535.303 640.006,539.033 631.157,542.229C 632.753,545.645 636.226,548.02 640.266,548.02C 640.266,548.02 828.117,553.74 891.204,563.664C 891.426,563.699 891.641,563.734 891.859,563.769C 898.62,564.852 903.902,565.983 907.288,567.162L 907.288,498.141C 903.888,499.078 898.369,499.98 891.156,500.85C 828.503,508.397 640.266,513.066 640.266,513.066C 636.427,513.066 633.094,515.207 631.401,518.352 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 366.209,1025.63L 366.164,1011.55L 366.164,1025.63L 366.209,1025.63 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1513.94,529.433C 1513.91,537.098 1498.88,546.164 1475.46,554.053L 1475.77,578.01C 1492.21,578.11 1514.84,577.062 1540.45,575.156L 1539.2,483.112C 1513.43,481.051 1490.77,479.692 1474.52,479.176L 1474.86,506.745C 1497.66,513.176 1513.98,520.874 1513.94,529.433 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1224.34,572.609C 1208.79,572.542 1194.85,572.487 1183.36,572.453C 1181.66,583.22 1179.36,593.436 1176.51,602.672L 1192.35,602.672C 1206.4,602.672 1225.32,596.109 1225.32,588.014L 1225.32,580.425L 1225.32,572.613C 1224.99,572.611 1224.67,572.61 1224.34,572.609 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1348.9,573.225C 1306.03,572.996 1261.41,572.77 1225.32,572.613L 1225.32,580.426C 1239.79,580.208 1412.68,577.628 1475.77,578.011L 1475.46,554.053C 1443.36,564.869 1395.5,573.475 1348.9,573.225 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1020.47,413.71C 1020.74,417.83 1024.18,421.09 1028.4,421.09L 1032.94,421.09L 1129.72,421.09C 1133.99,421.09 1132.73,417.741 1132.66,413.542C 1132.65,413.422 1132.65,413.305 1132.65,413.184C 1132.65,408.818 1122.39,405.278 1118,405.278C 1118,405.278 1047.04,397.813 1025.05,405.278C 1022.98,405.979 1020.69,408.547 1020.46,412.547C 1020.45,412.756 1020.44,412.967 1020.44,413.184C 1020.44,413.361 1020.45,413.535 1020.47,413.71 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1020.44,413.184C 1020.44,412.967 1020.45,412.756 1020.46,412.547C 1019.9,412.601 1019.34,412.656 1018.78,412.713L 1020.47,413.71C 1020.45,413.535 1020.44,413.361 1020.44,413.184 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 359.167,17.4193C 357.88,16.7194 356.481,16.1068 355.003,15.5975C 341.667,10.9985 314.193,3.73962 300.154,2.28162C 295.502,1.79724 281.871,1.17139 278.029,7.34326L 253.326,423.053C 253.326,428.05 256.442,432.178 260.506,432.912L 261.203,432.893L 260.506,432.912C 260.928,432.987 261.355,433.04 261.795,433.04L 357.067,433.04C 361.744,433.04 365.535,428.569 365.535,423.053L 366.164,225.135L 366.164,36.1191">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1002.57,491.427L 1003.13,414.37C 949.078,420.406 891.204,429.84 891.204,429.84L 891.204,500.844C 898.37,499.98 903.888,499.078 907.288,498.141L 907.288,498.085L 1080.73,486.542L 1080.44,464.453C 1080.08,464.493 1079.71,464.517 1079.33,464.517L 1072.63,464.517C 1067.09,464.517 1062.59,460.046 1062.59,454.53L 1062.59,442.879C 1062.59,441.535 1062.86,440.255 1063.34,439.084C 1064.84,435.452 1068.44,432.891 1072.63,432.891L 1079.33,432.891C 1079.57,432.891 1079.8,432.911 1080.04,432.927L 1079.89,421.934L 1080.04,432.927L 1080.24,449.088L 1080.44,464.453L 1080.73,486.542L 1132.37,483.105C 1132.37,483.105 1135.68,503.391 1135.72,531.375C 1135.75,558.458 1132.85,578.198 1132.42,580.964C 1132.39,581.185 1132.37,581.31 1132.37,581.31L 1131.89,581.28L 907.288,567.162C 903.903,565.983 898.62,564.852 891.859,563.769L 892.598,629.858C 892.142,629.762 891.669,629.667 891.204,629.573L 891.204,629.997C 891.204,629.997 948.391,639.509 1002.3,645.577L 1002.85,573.543L 1002.3,645.577C 1008.37,646.261 1014.41,646.902 1020.31,647.479L 1020.87,647.146C 1021.05,642.933 1024.53,639.568 1028.81,639.568L 1033.65,639.568L 1081.57,639.568L 1081.4,627.149C 1080.73,627.287 1080.04,627.361 1079.33,627.361L 1072.63,627.361C 1068.68,627.361 1065.27,625.083 1063.63,621.781C 1062.97,620.45 1062.59,618.958 1062.59,617.374L 1062.59,605.723C 1062.59,600.207 1067.09,595.736 1072.63,595.736L 1079.33,595.736C 1079.89,595.736 1080.43,595.791 1080.96,595.878L 1080.73,579.646L 1080.96,595.878L 1081.17,611.37L 1081.4,627.149L 1081.57,639.568L 1130.14,639.568C 1134.27,639.568 1133.22,642.693 1133.08,646.692C 1145.22,644.714 1155.81,641.257 1160.84,634.99C 1167.17,627.109 1172.42,615.898 1176.51,602.672L 1176.5,602.672L 1176.51,602.672C 1179.36,593.436 1181.66,583.219 1183.36,572.453C 1180.85,572.446 1178.46,572.438 1176.19,572.433C 1172.82,572.424 1166.95,569.701 1162.93,562.868C 1160.64,558.985 1158.95,553.769 1158.66,546.967C 1154.99,546.83 1151.28,543.866 1151.28,540.218L 1151.28,520.244C 1151.28,516.607 1154.96,513.65 1158.63,513.497C 1158.89,506.684 1160.63,501.681 1163,498.064C 1167.29,491.504 1173.65,489.485 1177.03,489.485C 1177.03,489.485 1179.83,489.381 1184.72,489.213C 1183.45,479.291 1181.61,469.833 1179.2,461.189L 1179.01,461.189L 1179.2,461.189C 1174.93,445.891 1168.85,433.138 1160.84,424.847C 1155.13,418.935 1144.64,415.559 1132.66,413.542C 1132.73,417.74 1133.99,421.09 1129.72,421.09L 1032.94,421.09L 1028.39,421.09C 1024.18,421.09 1020.74,417.829 1020.47,413.71L 1018.78,412.713C 1013.64,413.225 1008.4,413.781 1003.13,414.37L 1002.57,491.427 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1225.32,572.613C 1261.41,572.77 1306.03,572.996 1348.9,573.225C 1395.5,573.474 1443.36,564.869 1475.46,554.053C 1498.88,546.164 1513.91,537.098 1513.94,529.433C 1513.98,520.875 1497.66,513.176 1474.87,506.745C 1435.21,495.56 1375.94,488.213 1348.91,486.86C 1323.18,485.573 1266.57,486.771 1225.32,487.939C 1224.99,487.948 1224.67,487.957 1224.34,487.966C 1207.31,488.451 1193.01,488.926 1184.72,489.212C 1179.83,489.381 1177.03,489.485 1177.03,489.485C 1173.65,489.485 1167.29,491.504 1163,498.064C 1160.63,501.681 1158.89,506.684 1158.63,513.497C 1158.73,513.492 1158.82,513.482 1158.92,513.482C 1159.06,513.482 1158.73,513.489 1158.62,513.509C 1158.58,513.506 1158.59,513.502 1158.63,513.498L 1158.63,513.497C 1154.96,513.65 1151.28,516.608 1151.28,520.244L 1151.28,540.218C 1151.28,543.865 1154.99,546.831 1158.66,546.967L 1158.66,546.963C 1158.62,546.96 1158.61,546.956 1158.66,546.963C 1158.76,546.973 1159.06,546.98 1158.92,546.98C 1158.83,546.98 1158.75,546.97 1158.66,546.967C 1158.95,553.769 1160.64,558.985 1162.93,562.868C 1166.95,569.701 1172.82,572.424 1176.19,572.433C 1178.46,572.439 1180.85,572.446 1183.36,572.453C 1194.85,572.488 1208.79,572.542 1224.34,572.609C 1224.67,572.611 1224.99,572.612 1225.32,572.613 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 366.164,225.135L 366.164,453.654L 380.121,453.144L 380.372,499.736L 380.373,499.736L 380.121,452.542C 380.121,452.542 752.058,455.641 890.366,430.118L 891.204,500.844L 891.204,429.841C 891.204,429.841 949.078,420.406 1003.13,414.37L 1003.13,414.304L 1003.13,414.37C 1008.4,413.782 1013.64,413.225 1018.78,412.713L 382.456,36.1191">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1158.66,546.951C 1158.61,546.956 1158.62,546.96 1158.66,546.963 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1080.96,595.878C 1080.43,595.791 1079.89,595.736 1079.33,595.736L 1072.64,595.736C 1067.09,595.736 1062.59,600.207 1062.59,605.723L 1062.59,617.374C 1062.59,618.958 1062.97,620.45 1063.63,621.781C 1065.27,625.083 1068.68,627.361 1072.64,627.361L 1079.33,627.361C 1080.04,627.361 1080.73,627.287 1081.39,627.149L 1081.17,611.37L 1080.96,595.878 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1020.87,647.146L 1020.31,647.479L 1020.86,647.475C 1020.86,647.363 1020.87,647.256 1020.87,647.146 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1158.66,546.963L 1158.66,546.967L 1158.92,546.98L 1158.66,546.963 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1130.14,639.568L 1081.57,639.568L 1033.65,639.568L 1028.81,639.568C 1024.53,639.568 1021.05,642.933 1020.88,647.146C 1020.87,647.255 1020.86,647.364 1020.86,647.533C 1020.88,651.865 1023.3,654.646 1025.46,655.381C 1047.45,662.845 1118.41,655.381 1118.41,655.381C 1122.81,655.381 1133.07,651.841 1133.07,647.474C 1133.07,647.21 1133.07,646.949 1133.08,646.692C 1133.22,642.693 1134.27,639.568 1130.14,639.568 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 382.935,1025.63L 1020.31,647.479C 1014.41,646.901 1008.37,646.261 1002.3,645.577L 1002.29,645.671L 1002.3,645.577C 948.391,639.508 891.204,629.997 891.204,629.997L 891.204,629.573C 769.586,604.651 380.958,609.377 380.958,609.377L 380.957,609.052L 366.164,608.512L 366.164,1011.55">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 366.164,1025.63L 366.164,1011.55L 364.978,638.112C 364.978,632.596 361.187,628.125 356.509,628.125L 261.352,628.125L 261.237,628.125C 260.595,628.125 259.973,628.216 259.37,628.375L 262.04,628.402L 259.37,628.375C 255.592,629.379 252.768,633.353 252.768,638.112L 277.471,1053.82C 281.314,1059.99 294.944,1059.37 299.597,1058.88C 313.635,1057.43 341.11,1050.17 354.445,1045.57C 355.541,1045.19 356.592,1044.75 357.59,1044.27">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1158.63,513.498C 1158.59,513.501 1158.58,513.506 1158.63,513.509 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1158.92,513.482L 1158.63,513.498L 1158.92,513.482 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 1785.81,530.959C 1785.81,531.533 1786.28,531.999 1786.85,531.999L 1837.1,531.999C 1837.68,531.999 1838.14,531.533 1838.14,530.959C 1838.14,530.385 1837.68,529.919 1837.1,529.919L 1786.85,529.919C 1786.28,529.919 1785.81,530.385 1785.81,530.959 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 366.164,1034.51C 365.654,1038.63 362.253,1042.01 357.59,1044.27C 357.987,1044.32 358.388,1044.36 358.801,1044.36L 405.273,1044.36C 410.475,1044.36 414.693,1040.16 414.693,1034.99C 414.693,1029.82 410.475,1025.63 405.273,1025.63L 382.935,1025.63L 366.164,1035.58L 366.164,1034.51 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 366.234,1033.43C 366.234,1033.8 366.209,1034.16 366.164,1034.51L 366.164,1035.58L 382.935,1025.63">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 357.589,1044.27C 362.253,1042.01 365.654,1038.63 366.164,1034.51L 366.164,1025.63">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 366.164,1034.51L 366.234,1033.43">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 366.792,27.733C 366.792,27.4233 366.771,27.1188 366.739,26.8168L 366.164,26.4772L 366.164,36.1188L 366.765,36.1188L 366.792,27.733 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 366.739,26.817L 382.456,36.1191L 406.128,36.1191C 411.33,36.1191 415.548,31.9279 415.548,26.7572C 415.548,21.5864 411.33,17.3951 406.128,17.3951L 359.656,17.3951C 359.491,17.3951 359.329,17.411 359.167,17.4193C 363.358,19.6981 366.331,22.933 366.739,26.817 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 382.456,36.119L 366.738,26.8169C 366.771,27.119 366.792,27.4237 366.792,27.733">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 366.164,36.119L 366.164,26.4774L 366.739,26.8169C 366.331,22.9327 363.357,19.6987 359.167,17.4191">
<GeometryDrawing.Pen>
<Pen Thickness="4" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 897.519,801.469L 897.519,787.732C 897.519,783.739 892.114,780.504 885.448,780.504C 878.782,780.504 873.378,783.739 873.378,787.732L 873.378,797.136">
<GeometryDrawing.Pen>
<Pen Thickness="4.476" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 873.378,828.924L 873.378,838.329C 873.378,842.322 878.782,845.557 885.448,845.557C 892.114,845.557 897.518,842.322 897.518,838.329L 897.518,823.852">
<GeometryDrawing.Pen>
<Pen Thickness="4.476" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 768.227,797.136L 714.634,828.924L 873.378,828.924L 873.378,797.136L 768.227,797.136 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4.69334" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 873.378,797.136L 873.378,828.924">
<GeometryDrawing.Pen>
<Pen Thickness="4.476" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 903.957,825.597L 905.967,825.597C 913.079,825.597 918.843,819.806 918.843,812.661C 918.843,805.516 913.079,799.723 905.967,799.723L 903.957,799.723C 901.608,799.723 899.413,800.365 897.519,801.469L 897.519,823.852C 899.413,824.956 901.608,825.597 903.957,825.597 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="6.39867" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 896.681,258.662L 896.681,272.399C 896.681,276.391 891.277,279.626 884.61,279.626C 877.945,279.626 872.54,276.391 872.54,272.399L 872.54,262.994">
<GeometryDrawing.Pen>
<Pen Thickness="4.476" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 872.54,231.206L 872.54,221.801C 872.54,217.808 877.945,214.574 884.61,214.574C 891.277,214.574 896.681,217.808 896.681,221.801L 896.681,236.278">
<GeometryDrawing.Pen>
<Pen Thickness="4.476" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 767.389,262.994L 713.797,231.206L 872.54,231.206L 872.54,262.994L 767.389,262.994 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4.69334" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 872.54,262.994L 872.54,231.206">
<GeometryDrawing.Pen>
<Pen Thickness="4.476" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 903.119,234.533L 905.13,234.533C 912.242,234.533 918.005,240.325 918.005,247.47C 918.005,254.614 912.242,260.407 905.13,260.407L 903.119,260.407C 900.771,260.407 898.576,259.765 896.682,258.661L 896.682,236.278C 898.576,235.175 900.771,234.533 903.119,234.533 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="6.39867" MiterLimit="2.75" Brush="White"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</UserControl.Resources>
<Grid
Background="{DynamicResource ResourceKey=plane1}">
</Grid>
答案 0 :(得分:0)
问题是matrixTransform包含在TransformGroup中。所以解决方案是:
Storyboard.SetTargetProperty(myanimation, new PropertyPath("(UIElement.RenderTransform).(TransformGroup.Children)[0].(MatrixTransform.Matrix)"));
谢谢