Example #1
0
 // Just for fun/test
 void RotateCubeAnimation()
 {
     axis                    = new AxisAngleRotation3D(new Vector3D(1, 0, 1), 0);
     Cube2.Transform         = new RotateTransform3D(axis);
     RotAngle.From           = 0;
     RotAngle.To             = 360;
     RotAngle.Duration       = new Duration(TimeSpan.FromSeconds(1.0));
     RotAngle.RepeatBehavior = RepeatBehavior.Forever;
     NameScope.SetNameScope(Canvas1, new NameScope());
     Canvas1.RegisterName("cubeaxis", axis);
     Storyboard.SetTargetName(RotAngle, "cubeaxis");
     Storyboard.SetTargetProperty(RotAngle, new PropertyPath(AxisAngleRotation3D.AngleProperty));
     RotCube.Children.Add(RotAngle);
     RotCube.Begin(Canvas1);
 }
Example #2
0
        public void error_sample_segment(int segment)
        {
            Dispatcher.BeginInvoke(new ThreadStart(delegate
            {
                var redBrush = new SolidColorBrush
                {
                    Color = Colors.Red
                };
                var errorLine = new Line();

                Canvas.SetLeft(errorLine, (Canvas.GetLeft(Tube) + (segment * 4)));
                errorLine.X1 = 0;
                errorLine.X2 = 0;
                errorLine.Y1 = 151;
                errorLine.Y2 = 151 + 70;
                errorLine.StrokeThickness = 4;
                errorLine.Stroke          = redBrush;
                errorLine.Fill            = redBrush;
                Canvas1.RegisterName("errorLine" + _count, errorLine);
                _count++;
                Canvas1.Children.Add(errorLine);
            }));
        }