Exemplo n.º 1
1
        private void AntGrid(Grid g)
        {
            g.Width = 5;
            g.Height = 5;
            g.Visibility = Visibility.Visible;

            Storyboard sb = new Storyboard();
            DoubleAnimation da = new DoubleAnimation(5.0, gridmain.ActualWidth - 10, new Duration(TimeSpan.FromSeconds(2)));
            DoubleAnimation da1 = new DoubleAnimation(5.0, gridmain.RowDefinitions[0].ActualHeight - 10, new Duration(TimeSpan.FromSeconds(2)));

            DoubleAnimation da2 = new DoubleAnimation(0, 720, new Duration(TimeSpan.FromSeconds(2)));

            TransformGroup tg = new TransformGroup();
            RotateTransform rt = new RotateTransform(720);

            tg.Children.Add(rt);
            g.RenderTransform = tg;
            g.RenderTransformOrigin = new Point(0.5, 0.5);
            Storyboard.SetTarget(da2, g);
            Storyboard.SetTargetProperty(da2, new PropertyPath("(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)"));//RotateTransform.AngleProperty
            sb.Children.Add(da2);

            Storyboard.SetTarget(da, g);
            Storyboard.SetTargetProperty(da, new PropertyPath(Grid.WidthProperty));
            sb.Children.Add(da);

            Storyboard.SetTarget(da1, g);
            Storyboard.SetTargetProperty(da1, new PropertyPath(Grid.HeightProperty));
            sb.Children.Add(da1);

            if (!Resources.Contains("ShowAn"))
                Resources.Add("ShowAn", sb);
            sb.AccelerationRatio = 1.0;
            sb.Begin();
        }
Exemplo n.º 2
0
        private Media.Transform CreateAnimatedTransform2(double speed = 4)
        {
            var lightTrafo      = new Media.TransformGroup();
            var rotateAnimation = new Media.Animation.DoubleAnimation
            {
                RepeatBehavior = Media.Animation.RepeatBehavior.Forever,
                By             = 360,
                AutoReverse    = false,
                Duration       = TimeSpan.FromSeconds(speed / 4),
            };

            var rotateTransform = new Media.RotateTransform(0, 0, 0);

            rotateTransform.BeginAnimation(Media.RotateTransform.AngleProperty, rotateAnimation);
            lightTrafo.Children.Add(rotateTransform);


            var scaleAnimation = new Media.Animation.DoubleAnimation
            {
                RepeatBehavior = Media.Animation.RepeatBehavior.Forever,
                From           = 1, To = 5,
                AutoReverse    = true,
                Duration       = TimeSpan.FromSeconds(speed / 4),
            };
            var scaleTransform = new Media.ScaleTransform(1, 1, 0, 0);

            scaleTransform.BeginAnimation(Media.ScaleTransform.ScaleXProperty, scaleAnimation);
            scaleTransform.BeginAnimation(Media.ScaleTransform.ScaleYProperty, scaleAnimation);
            lightTrafo.Children.Add(scaleTransform);
            return(lightTrafo);
        }
Exemplo n.º 3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.rect = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 2:
                this.rotate = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 3:
                this.tbCenterX = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.tbCenterY = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.tbAngle = ((System.Windows.Controls.TextBox)(target));
                return;

            case 6:
                this.rect1 = ((System.Windows.Shapes.Rectangle)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 4
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/AnalogClock;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot          = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.TitlePanel          = ((System.Windows.Controls.StackPanel)(this.FindName("TitlePanel")));
     this.ApplicationTitle    = ((System.Windows.Controls.TextBlock)(this.FindName("ApplicationTitle")));
     this.PageTitle           = ((System.Windows.Controls.TextBlock)(this.FindName("PageTitle")));
     this.ContentGrid         = ((System.Windows.Controls.Grid)(this.FindName("ContentGrid")));
     this.ClockFaceEllipse    = ((System.Windows.Shapes.Ellipse)(this.FindName("ClockFaceEllipse")));
     this.ClockHandsCanvas    = ((System.Windows.Controls.Canvas)(this.FindName("ClockHandsCanvas")));
     this.ClockStoryboard     = ((System.Windows.Media.Animation.Storyboard)(this.FindName("ClockStoryboard")));
     this.HourAnimation       = ((System.Windows.Media.Animation.DoubleAnimation)(this.FindName("HourAnimation")));
     this.MinuteAnimation     = ((System.Windows.Media.Animation.DoubleAnimation)(this.FindName("MinuteAnimation")));
     this.SecondAnimation     = ((System.Windows.Media.Animation.DoubleAnimation)(this.FindName("SecondAnimation")));
     this.SecondHandTransform = ((System.Windows.Media.RotateTransform)(this.FindName("SecondHandTransform")));
     this.MinuteHandTransform = ((System.Windows.Media.RotateTransform)(this.FindName("MinuteHandTransform")));
     this.HourHandTransform   = ((System.Windows.Media.RotateTransform)(this.FindName("HourHandTransform")));
     this.txtdt  = ((System.Windows.Controls.TextBlock)(this.FindName("txtdt")));
     this.txtdt1 = ((System.Windows.Controls.TextBlock)(this.FindName("txtdt1")));
 }
Exemplo n.º 5
0
 // if you want to rotate any text block ....
 public void Rotate(TextBlock textBlock, int rotationAngleDegrees)
 {
     RotateTransform rTransform = new RotateTransform();
     rTransform.Angle = rotationAngleDegrees;
     textBlock.RenderTransformOrigin = new Point(0.5, 0.5);
     textBlock.RenderTransform = rTransform;
 }
Exemplo n.º 6
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\..\..\Controls\BackgroundWorker\InvertCircularProgressBar.xaml"
                ((PariSpace.LineDesigner.InvertCircularProgressBar)(target)).IsEnabledChanged += new System.Windows.DependencyPropertyChangedEventHandler(this.UserControl_IsEnabledChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.SpinnerScale = ((System.Windows.Media.ScaleTransform)(target));
                return;

            case 4:
                this.SpinnerRotate = ((System.Windows.Media.RotateTransform)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 7
0
        protected override Size ArrangeOverride(Size finalSize)
        {
            if (GetValues(this) != null)
            {
                double total = 0.0;
                for (int i = 0; i < InternalChildren.Count; i++)
                {
                    total += (double)(GetValues(this)[i]);
                }
                double offsetAngle = 0.0;

                double radius = finalSize.Width < finalSize.Height ? finalSize.Width / 2 : finalSize.Height / 2;
                //radius -= 2;
                Point beginFigure = new Point(finalSize.Width / 2, finalSize.Height / 2);
                Point lineToBeforeTransform = new Point(beginFigure.X + radius, beginFigure.Y);
                for (int i = 0; i < InternalChildren.Count; i++)
                {
                    ContentControl container = InternalChildren[i] as ContentControl;
                    double wedgeAngle = (double)(GetValues(this)[i]) * 360 / total;
                    RotateTransform rt = new RotateTransform(offsetAngle, beginFigure.X, beginFigure.Y);
                    container.SetValue(PiePanel.BeginFigurePointProperty, beginFigure);
                    container.SetValue(PiePanel.LineToPointProperty, rt.Transform(lineToBeforeTransform));
                    container.SetValue(PiePanel.WedgeAngleProperty, wedgeAngle);
                    offsetAngle += wedgeAngle;
                    Rect r = new Rect(finalSize);
                    container.Arrange(r);
                }
            }
            return finalSize;
        }
Exemplo n.º 8
0
        private void RotateThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            this.designerItem = DataContext as ContentControl;

            if (this.designerItem != null)
            {
                this.canvas = VisualTreeHelper.GetParent(this.designerItem) as Canvas;

                if (this.canvas != null)
                {
                    this.centerPoint = this.designerItem.TranslatePoint(
                        new Point(this.designerItem.Width * this.designerItem.RenderTransformOrigin.X,
                                  this.designerItem.Height * this.designerItem.RenderTransformOrigin.Y),
                                  this.canvas);

                    Point startPoint = Mouse.GetPosition(this.canvas);
                    this.startVector = Point.Subtract(startPoint, this.centerPoint);

                    this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
                    if (this.rotateTransform == null)
                    {
                        this.designerItem.RenderTransform = new RotateTransform(0);
                        this.initialAngle = 0;
                    }
                    else
                    {
                        this.initialAngle = this.rotateTransform.Angle;
                    }
                }
            }
        }
        public BrushDesignerWindow(object obj, PropertyInfo prop)
        {
            InitializeComponent();
            (GradientGrid.Background as DrawingBrush).RelativeTransform = GGridTrans = new RotateTransform();
            GGridTrans.CenterX = 0.5;
            GGridTrans.CenterY = 0.5;
            isd = new ImageSourceDesigner();

            b = prop.GetValue(obj, null) as Brush;
            setv = (x) => prop.SetValue(obj, x, null);
            if (b.IsFrozen)
            {
                b = b.Clone();
                setv(b);
            }
            if (b is SolidColorBrush)
            {
                cmode = Mode.Solid;
            }
            else if (b is LinearGradientBrush)
            {
                cmode = Mode.LinearGradient;
            }
            else if (b is ImageBrush)
            {
                cmode = Mode.Image;
            }
        }
Exemplo n.º 10
0
 public override void Draw(Canvas c)
 {
     if (base.GetObjectState() == Constants.ObjectState.Alive)
     {
         RotateTransform r = new RotateTransform(Angle + 90);
         alive.spriteImage.RenderTransform = r;
         RenderOptions.SetBitmapScalingMode(alive, BitmapScalingMode.Fant);
         alive.Margin = new System.Windows.Thickness(X, Y, 0, 0);
         c.Children.Add(alive);
     }
     if (base.GetObjectState() == Constants.ObjectState.Hit)
     {
         RotateTransform r = new RotateTransform(Angle + 90);
         hit.spriteImage.RenderTransform = r;
         RenderOptions.SetBitmapScalingMode(hit, BitmapScalingMode.Fant);
         hit.Margin = new System.Windows.Thickness(X, Y, 0, 0);
         c.Children.Add(hit);
     }
     if (base.GetObjectState() == Constants.ObjectState.Dead)
     {
         Ellipse e = new Ellipse();
         e.Width = 64;
         e.Height = 64;
             e.Fill = new SolidColorBrush(Colors.Red);
         e.Margin = new System.Windows.Thickness(X, Y, 0, 0);
         c.Children.Add(e);
     }
 }
        public ParkingSensorViewControl()
        {
            InitializeComponent();

            double scale = 1.0;

            for (int i = 0; i < 4; i++)
            {
                //double angle = -90.0d + 360.0d / 4.0d * (i + 0.5d);
                double angle = angles[i];

                // http://www.comanswer.com/question/silverlight-xamlwriter

                var dt = (DataTemplate)Resources["TemplateXaml"];
                Path pointer = (Path)dt.LoadContent();

                ScaleTransform st = new ScaleTransform(scale, 1.0d);
                beamsSt[i] = st;
                RotateTransform rt = new RotateTransform(angle, 0, 10);
                TranslateTransform tt = new TranslateTransform(50.0d, 0.0d);    // half the length of the beam
                TransformGroup tg = new TransformGroup();
                tg.Children.Add(st);
                tg.Children.Add(rt);
                tg.Children.Add(tt);
                pointer.RenderTransform = tg;

                mainGrid.Children.Add(pointer);
            }
        }
 //飞机角度改变
 public void PlaneRotare(double angle)
 {
     RotateTransform rt = new RotateTransform(-1 * angle);
     rt.CenterX = 0;
     rt.CenterY = 20;
     this.img_plane.RenderTransform = rt;
 }
Exemplo n.º 13
0
        public void rotate()
        {
            RotateTransform rt = new RotateTransform();
            RotateTransform rt2 = new RotateTransform();
           
            if (!rotated)
            {
                cross1RotateToX.Begin();
                cross2RotateToX.Begin();
                rt.Angle = 180+45;
                rt.CenterX = 1.5;
                rt.CenterY = 8;
                rt2.Angle = 180+45;
                rt2.CenterX = 8;
                rt2.CenterY = 1.5;
                rotated = true;
            }
            else
            {
                cross1RotateToPlus.Begin();
                cross2RotateToPlus.Begin();
                rt.Angle = 0;
                rt2.Angle = 0;
                rotated = false;
            }                
            //cross1.RenderTransform = rt;
           

           // cross2.RenderTransform = rt2;

            
        }
Exemplo n.º 14
0
        public override void PerformTranstition(UserControl newPage, UserControl oldPage)
        {
            this.newPage = newPage;
            this.oldPage = oldPage;

            Duration duration = new Duration(time);

            DoubleAnimation animation = new DoubleAnimation();
            animation.Duration = duration;
            animation.To = 90;

            Storyboard sb = new Storyboard();
            sb.Duration = duration;
            sb.Children.Add(animation);
            sb.Completed += sb_Completed;

            RotateTransform sc = new RotateTransform();
            sc.CenterX = centre.X * oldPage.ActualWidth;
            sc.CenterY = centre.Y * oldPage.ActualHeight;
            oldPage.RenderTransform = sc;

            Storyboard.SetTarget(animation, sc);
            //Storyboard.SetTargetProperty(animation, "Angle");
            Storyboard.SetTargetProperty(animation, new PropertyPath("Angle"));

            //oldPage.Resources.Add(sb);

            sb.Begin();
        }
        private void AddNewItem_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            TimeSpan du = TimeSpan.FromMilliseconds(400);
            AddOrDeleteButton tb = sender as AddOrDeleteButton;
            RotateTransform rotateTrans = new RotateTransform();
            tb.RenderTransform = rotateTrans;
            DoubleAnimation rotateAnim = new DoubleAnimation(45, du);
            rotateTrans.BeginAnimation(RotateTransform.AngleProperty, rotateAnim);
            tb.MouseLeftButtonUp -= AddNewItem_MouseLeftButtonUp;
            tb.MouseLeftButtonUp += DeleteItem_MouseLeftButtonUp;
            DependencyObject dListView = tb;
            DependencyObject scrollViewer = tb;
            while (!(dListView is 一个二级部件))
            {
                dListView = VisualTreeHelper.GetParent(dListView);
            }
            while (!(scrollViewer is ScrollViewer))
            {
                scrollViewer = VisualTreeHelper.GetParent(scrollViewer);
            }
            一个二级部件 ListView = dListView as 一个二级部件;

            一条指标 ListViewItem = new 一条指标();
            ListView.指标集合.Add(ListViewItem);
            (scrollViewer as ScrollViewer).ScrollToBottom();
            ScaleTransform scaleTransform = new ScaleTransform();
            ListViewItem.RenderTransform = scaleTransform;
            DoubleAnimation scaleAnim = new DoubleAnimation(0, 1, du);
            scaleTransform.BeginAnimation(ScaleTransform.ScaleYProperty, scaleAnim);
        }
Exemplo n.º 16
0
        public Spinner()
        {
            var duration = TimeSpan.FromSeconds(1.3);

            m_Animation = new DoubleAnimationUsingKeyFrames()
            {
                RepeatBehavior = RepeatBehavior.Forever,
                Duration = duration
            };

            for (int i = 0; i < c_Blobs; i++)
            {
                m_Animation.KeyFrames.Add(new DiscreteDoubleKeyFrame(i * 360.0 / c_Blobs, KeyTime.Paced));
            }

            var rotateTransform = new RotateTransform();
            RenderTransform = rotateTransform;

            for (int i = 0; i < c_Blobs; i++)
            {
                var r = (byte)(0xFF - (((0xFF - 0x17) / c_Blobs) * i));
                var g = (byte)(0xFF - (((0xFF - 0x7F) / c_Blobs) * i));
                var b = (byte)(0xFF - (((0xFF - 0x2E) / c_Blobs) * i));

                m_Brushes[i] = new SolidColorBrush(Color.FromRgb(r, g, b));
                m_Brushes[i].Freeze();
            }
        }
Exemplo n.º 17
0
        private void btnSpinner_MouseEnter(object sender, MouseEventArgs e)
        {
            if (!isSpinning)
            {
                isSpinning = true;

                // Make a double animation object, and register
                // with the Completed event.
                DoubleAnimation dblAnim = new DoubleAnimation();
                dblAnim.Completed += (o, s) => { isSpinning = false; };

                // Button has 4 seconds to finish the spin!
                dblAnim.Duration = new Duration(TimeSpan.FromSeconds(4));

                // Set the start value and end value.
                dblAnim.From = 0;
                dblAnim.To = 360;

                // Now, create a RotateTransform object, and set
                // it to the RenderTransform property of our
                // button
                RotateTransform rt = new RotateTransform();
                btnSpinner.RenderTransform = rt;

                // Now, animation the RotateTransform object.
                rt.BeginAnimation(RotateTransform.AngleProperty, dblAnim);
            }
        }
Exemplo n.º 18
0
        private void RenderImportanceArrow(DrawingContext dc, FrameworkElement mostImportant, FrameworkElement leastImportant)
        {
            var startPoint = FindPoint(mostImportant, new Point(mostImportant.ActualWidth/2, mostImportant.ActualHeight));
            var endPoint = FindPoint(leastImportant, new Point(leastImportant.ActualWidth/2, 0));

            var vector = Point.Subtract(endPoint, startPoint);

            var midPoint = Point.Add(startPoint, Vector.Multiply(vector, 0.66));

            Transform arrowTransform = Transform.Identity;
            double angle;
            if (Math.Abs((angle = Vector.AngleBetween(vector, new Vector(0, -1))) - 0) > double.Epsilon)
            {
                arrowTransform = new RotateTransform(angle, midPoint.X, midPoint.Y);
            }

            var line = BuildPath.From(startPoint).LineTo(endPoint.X, endPoint.Y).Build();
            var arrow = BuildPath.From(midPoint.X - 3, midPoint.Y - 3).LineTo(midPoint.X, midPoint.Y)
                .LineTo(midPoint.X + 3, midPoint.Y - 3).Build();

            dc.DrawGeometry(null, _pen, line);

            dc.PushTransform(arrowTransform);

            dc.DrawGeometry(null, _pen, arrow);

            dc.Pop();
        }
Exemplo n.º 19
0
		private void ChangeLayoutTransform()
		{
			if (placement == AxisPlacement.Left)
				LayoutTransform = new RotateTransform(-90);
			else
				LayoutTransform = new RotateTransform(90);
		}
Exemplo n.º 20
0
        public static void ParkHotelExplorer(bool restore, double width, Canvas canvas, double top, double left, double scale, double rotate)
        {
            _canvas = canvas;
            var hotelExplorer = HotelExplorer.GetInstance();
            hotelExplorer.IsFloating = !restore;
            hotelExplorer.HightLight(!restore);
            var ypos = restore ? top : Canvas.GetTop(hotelExplorer);
            var xpos = restore ? width - left - (hotelExplorer.ActualWidth * scale) : Canvas.GetLeft(hotelExplorer);
            var yTo = restore ? 55 : top;
            var xTo = restore ? 55 : width - left - (hotelExplorer.ActualWidth / scale);
            var zoomFrom = restore ? scale : 1;
            var zoomTo = restore ? 1 : scale;
            var rotateFrom = restore ? rotate : 0;
            var rotateTo = restore ? 0 : rotate;
            var yAnimation = new DoubleAnimation
                                 {
                                     From = ypos,
                                     To = yTo,
                                     Duration = new Duration(TimeSpan.FromMilliseconds(500))
                                 };
            var xAnimation = new DoubleAnimation
                                 {
                                     From = xpos,
                                     To = xTo,
                                     Duration = new Duration(TimeSpan.FromMilliseconds(1000))
                                 };

            hotelExplorer.BeginAnimation(Canvas.TopProperty, yAnimation);
            hotelExplorer.BeginAnimation(Canvas.LeftProperty, xAnimation);

            var zoom = new DoubleAnimation
                           {
                               From = zoomFrom,
                               To = zoomTo,
                               BeginTime = TimeSpan.FromMilliseconds(0),
                               Duration = new Duration(TimeSpan.FromMilliseconds(1000))
                           };

            var rotateAnimation = new DoubleAnimation
                             {
                                 From = rotateFrom,
                                 To = rotateTo,
                                 BeginTime = TimeSpan.FromMilliseconds(0),
                                 Duration = new Duration(TimeSpan.FromMilliseconds(1000))
                             };

            zoom.Completed += HotelZoomCompleted;

            var st = new ScaleTransform();
            var rt = new RotateTransform(rotateTo, 0, 0);

            var group = new TransformGroup();
            group.Children.Add(st);
            group.Children.Add(rt);

            hotelExplorer.Container.WorkingObject.RenderTransform = group;
            st.BeginAnimation(ScaleTransform.ScaleXProperty, zoom);
            st.BeginAnimation(ScaleTransform.ScaleYProperty, zoom);
            st.BeginAnimation(RotateTransform.AngleProperty, rotateAnimation);
        }
Exemplo n.º 21
0
 void CreateSubMagic(RoleBase caster,RoleBase startTarget, RoleBase endTarget, Space space, MagicArgs args)
 {
     AnimationBase animation = new AnimationBase() { Code = args.ResCode, Z = startTarget.Z + 1 };
     double offsetStartY = (startTarget.State == States.Riding ? (startTarget.Profession == Professions.Taoist ? 130 : 110) : 60) * args.Scale;
     double offsetEndY = (endTarget.State == States.Riding ? 100 : 50) * args.Scale;
     Point from = new Point(startTarget.Position.X, startTarget.Position.Y - offsetStartY);
     Point to = new Point(endTarget.Position.X, endTarget.Position.Y - offsetEndY);
     RotateTransform rotateTransform = new RotateTransform() {
         CenterX = animation.Center.X,
         CenterY = animation.Center.Y,
         Angle = GlobalMethod.GetAngle(to.Y - from.Y, to.X - from.X)
     };
     ScaleTransform scaleTransform = new ScaleTransform() {
         CenterX = animation.Center.X,
         CenterY = animation.Center.Y,
         ScaleX = (GlobalMethod.GetDistance(startTarget.Position, endTarget.Position) / Convert.ToInt32(args.Tag)),
         ScaleY = args.Scale
     };
     TransformGroup transformGroup = new TransformGroup();
     transformGroup.Children.Add(scaleTransform);
     transformGroup.Children.Add(rotateTransform);
     animation.RenderTransform = transformGroup;
     animation.Position = from;
     space.AddUIElement(animation);
     EventHandler handler = null;
     animation.End += handler = delegate {
         animation.End -= handler;
         space.RemoveAnimation(animation);
     };
     animation.HeartStart();
 }
        //Editor Ed = new Editor(Edit);

        public Manager(TabControl tabs, StackPanel Background, StackPanel Edit)
        {
            // TODO: Complete member initialization
            this.tabs = tabs;
            this.Background = Background;
            this.Edit = Edit;
            trSkw = new SkewTransform(0, 0);
            trRot = new RotateTransform(0);
            trTns = new TranslateTransform(0, 0);
            trScl = new ScaleTransform(1, 1);
            trSkw2 = new SkewTransform(0, 0);
            trRot2 = new RotateTransform(0);
            trTns2 = new TranslateTransform(0, 0);
            trScl2 = new ScaleTransform(1, 1);
            trGrp2 = new TransformGroup();
            trGrp2.Children.Add(trSkw2);
            trGrp2.Children.Add(trRot2);
            trGrp2.Children.Add(trTns2);
            trGrp2.Children.Add(trScl2);
            trGrp = new TransformGroup();
            trGrp.Children.Add(trSkw);
            trGrp.Children.Add(trRot);
            trGrp.Children.Add(trTns);
            trGrp.Children.Add(trScl);
        }
Exemplo n.º 23
0
        private void SetupAnimationForGear(Canvas gearBox, double ratio, SweepDirection direction)
        {
            var duration = TimeSpan.FromMilliseconds(30000*ratio);

            var animationRotation = new DoubleAnimationUsingKeyFrames
                                        {
                                            Duration = new Duration(duration),
                                            RepeatBehavior = RepeatBehavior.Forever
                                        };

            animationRotation.KeyFrames.Add(new LinearDoubleKeyFrame(0, KeyTime.FromPercent(0)));
            animationRotation.KeyFrames.Add(new LinearDoubleKeyFrame(
                                                direction == SweepDirection.Clockwise ? 360 : -360,
                                                KeyTime.FromPercent(1)));

            var rotateTransform = new RotateTransform();
            gearBox.RenderTransform = rotateTransform;
            gearBox.RenderTransformOrigin = new Point(0.5, 0.5);

            Storyboard.SetTarget(animationRotation, rotateTransform);
            Storyboard.SetTargetProperty(animationRotation, new PropertyPath(RotateTransform.AngleProperty));

            animationRotation.Freeze();

            _storyBoard.Children.Add(animationRotation);
        }
Exemplo n.º 24
0
        private void Slider_Rotate_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            double angle = e.NewValue;
            Element element = Slider_Rotate.Tag as Element;
            if (element != null)
            {
                RotateTransform rotateTransform = new RotateTransform(angle, element.ActualWidth / 2, element.ActualHeight / 2);
                element.RenderTransform = rotateTransform;

                CompositeElement compElement = element as CompositeElement;
                if (compElement != null &&
                    compElement.RelativeElement != null &&
                    compElement.IsMerged)
                {
                    CompositeElement relativeElement = compElement.RelativeElement;
                    double height1 = element.ActualHeight - 7;
                    double height2 = 0;
                    if (compElement.CompositeLocation == CompositeLocation.Bot)
                    {
                        height1 = 0;
                        height2 = compElement.RelativeElement.ActualHeight - 7;
                    }
                    RotateTransform rotateTransform1 = new RotateTransform(angle, element.ActualWidth / 2, height1);
                    element.RenderTransform = rotateTransform1;

                    if (compElement.RootSeal != null)
                    {
                        compElement.RootSeal.RenderTransform = rotateTransform1;
                    }
                    RotateTransform rotateTransform2 = new RotateTransform(angle, relativeElement.ActualWidth / 2, height2);//element.ActualWidth / 2, -(element.ActualHeight + relativeElement.ActualHeight) / 2);
                    compElement.RelativeElement.RenderTransform = rotateTransform2;
                    //RenderTransformOrigin = new Point(element.ActualWidth / 2, (element.ActualHeight + compElement.ActualHeight) / 2);
                }
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// Updates the canvas information (for if canvas size changes)
        /// </summary>
        public void Update(Size canvasSize, int gridSize)
        {
            var previousSize = CanvasSize;

            Center = new Point(canvasSize.Width / 2, canvasSize.Height / 2);

            RotationTransform = new RotateTransform(45, Center.X, Center.Y);
            FlipTransform = new ScaleTransform(1, -1, Center.X, Center.Y);
            Transforms = new TransformGroup();
            Transforms.Children.Add(RotationTransform);
            Transforms.Children.Add(FlipTransform);

            RotationTransformReverse = new RotateTransform(-45, Center.X, Center.Y);
            TransformsReverse = new TransformGroup();
            TransformsReverse.Children.Add(FlipTransform);
            TransformsReverse.Children.Add(RotationTransform);

            CanvasSize = canvasSize;
            Grid = new Size((int)(canvasSize.Width / gridSize), (int)(canvasSize.Height / gridSize));
            GridSquareSize = new Size(gridSize, gridSize);
            LastCanvas = this;

            ClipRegion = new RectangleGeometry(new Rect(new Point(20, 20), new Size(canvasSize.Width - 40, canvasSize.Height - 40)));

            if (OnCanvasSizeChanged != null && !previousSize.Equals(CanvasSize))
                OnCanvasSizeChanged(previousSize, CanvasSize);
        }
Exemplo n.º 26
0
        private void Test()
        {
            var test = new TransformGroup
            {
                Children = new TransformCollection
                {
                    new TranslateTransform { X = 10, Y = 20 },
                    new RotateTransform { Angle = 45 }
                }
            };
            var v = test.Value;


            var st = new TransformGroup { Children = new TransformCollection { new SkewTransform { AngleX = 45 } } };
            var tt = new TranslateTransform { X = 1 };

            var tg1 = new TransformGroup { Children = new TransformCollection { st, tt } };
            var tg2 = new TransformGroup { Children = new TransformCollection { tt, st } };

            var tg3 = new TransformGroup { Children = new TransformCollection { st } };
            var tg4 = new TransformGroup { Children = new TransformCollection { tt } };

            var tg5 = new TransformGroup();
            tg5.Children.Add(new TranslateTransform { X = 1, Y = 2 });
            tg5.Children.Add(new RotateTransform { Angle = -90 });

            var tg6 = new TransformGroup();
            tg6.Children.Add(new RotateTransform { Angle = -90 });
            tg6.Children.Add(new TranslateTransform { X = 1, Y = 2 });

            var p = new RotateTransform { Angle = 90 }.Transform(new Point(1, 2));

            var m3 = new Matrix3DProjection();
        }
Exemplo n.º 27
0
        private void ResizeThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            this.designerItem = this.DataContext as ContentControl;

            if (this.designerItem != null)
            {
                this.canvas = VisualTreeHelper.GetParent(this.designerItem) as ContentPresenter;

                if (this.canvas != null)
                {
                    this.transformOrigin = this.designerItem.RenderTransformOrigin;

                    this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
                    if (this.rotateTransform != null)
                    {
                        this.angle = this.rotateTransform.Angle * Math.PI / 180.0;
                    }
                    else
                    {
                        this.angle = 0.0d;
                    }

                    AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this.canvas);
                    if (adornerLayer != null)
                    {
                        this.adorner = new SizeAdorner(this.designerItem);
                        adornerLayer.Add(this.adorner);
                    }
                }
            }
        }
Exemplo n.º 28
0
        public Sprite(FrameworkElement content)
        {
            Content = content;
            Width = (float)content.Width;
            Height = (float)content.Height;

            TranslateTransform = new TranslateTransform();
            TranslateTransform.X = 0;
            TranslateTransform.Y = 0;

            RotateTransform = new RotateTransform();
            RotateTransform.CenterX = Origin.X;
            RotateTransform.CenterY = Origin.Y;
            RotateTransform.Angle = 0;

            ScaleTransform = new ScaleTransform();
            ScaleTransform.ScaleX = 1;
            ScaleTransform.ScaleY = 1;

            _transformGroup = new TransformGroup();
            _transformGroup.Children.Add(RotateTransform);
            _transformGroup.Children.Add(TranslateTransform);
            _transformGroup.Children.Add(ScaleTransform);
            RenderTransform = _transformGroup;
        }
Exemplo n.º 29
0
        private void RotateThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            adornedElement = this.AdornedElement as FrameworkElement;
            Thumb hitThumb = sender as Thumb;

            if (adornedElement == null || hitThumb == null) return;
            parentElement = adornedElement.Parent as FrameworkElement;

            if (parentElement != null)
            {
                this.centerPoint = adornedElement.TranslatePoint(
                                      new Point(adornedElement.Width * 0.5,
                                      adornedElement.Height * 0.5),
                                      parentElement);

                Point startPoint = Mouse.GetPosition(parentElement);
                this.startVector = Point.Subtract(startPoint, this.centerPoint);

                this.rotateTransform = adornedElement.RenderTransform as RotateTransform;
                if (this.rotateTransform == null)
                {
                    adornedElement.RenderTransform = new RotateTransform(
                            0, adornedElement.Width * 0.5, adornedElement.Height * 0.5);

                    this.initialAngle = 0;
                }
                else
                {
                    this.initialAngle = this.rotateTransform.Angle;
                }
            }
        }
Exemplo n.º 30
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.MainCanvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 2:
                this.OrientationArrow = ((System.Windows.Controls.Canvas)(target));
                return;

            case 3:
                this.ArrowRotateTransform = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 4:
                this.ArrowTranslateTransform = ((System.Windows.Media.TranslateTransform)(target));
                return;

            case 5:
                this.ConnectingLine = ((System.Windows.Shapes.Line)(target));
                return;

            case 6:
                this.Description = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 31
0
        private void btn2_1_Click(object sender, RoutedEventArgs e)
        {
            RotateTransform animatedTranslateTransform = new RotateTransform();
              btn2_1.RenderTransform = animatedTranslateTransform;
              RegisterName("animateButton2", animatedTranslateTransform);

              DoubleAnimationUsingKeyFrames translationAnimation = new DoubleAnimationUsingKeyFrames();
              translationAnimation.KeyFrames.Add(new EasingDoubleKeyFrame(0, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(0))));

              EasingDoubleKeyFrame doubleKeyFrame2 = new EasingDoubleKeyFrame(360, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(10)));

              ElasticEase ease = new ElasticEase();
              ease.Oscillations = 3;
              ease.Springiness = 8;
              ease.EasingMode = EasingMode.EaseOut;

              doubleKeyFrame2.EasingFunction = ease;
              translationAnimation.KeyFrames.Add(doubleKeyFrame2);

              Storyboard.SetTargetName(translationAnimation, "animateButton2");
              Storyboard.SetTargetProperty(translationAnimation, new PropertyPath(RotateTransform.AngleProperty));

              Storyboard strbStoryboard = new Storyboard();
              strbStoryboard.Children.Add(translationAnimation);

              strbStoryboard.Begin(this);
              UnregisterName("animateButton2");
        }
        public 一个一级部件(bool trurForAdd_falseForAddAndInsert)
        {
            //true for added items like 一个一级部件(),一个按钮
            //false for inserted items, 两个按钮
            InitializeComponent();
            桥梁组成一级部件参数 = new 桥梁组成一级部件();
            this.DataContext = 桥梁组成一级部件参数;
            二级部件集合ListView.DataContext = this;
            if (!trurForAdd_falseForAddAndInsert)
            {
                AddNewItem.MouseLeftButtonUp += DeleteItem;
                InsertNewItem.MouseLeftButtonUp += InsertNewItem_MouseLeftButtonUp;

                InsertNewItem.Visibility = Visibility.Visible;
                RotateTransform rotateTrans = new RotateTransform();
                AddNewItem.RenderTransform = rotateTrans;
                DoubleAnimation rotateAnim = new DoubleAnimation(45, TimeSpan.FromMilliseconds(300));
                rotateTrans.BeginAnimation(RotateTransform.AngleProperty, rotateAnim);
            }
            else
            {
                AddNewItem.MouseLeftButtonUp += AddNewItem_MouseLeftButtonUp;
                InsertNewItem.MouseLeftButtonUp += InsertNewItem_MouseLeftButtonUp;
            }
        }
      public void PageLoaded(object sender, RoutedEventArgs args)
      {
         // Create Image element.
         Image rotated90 = new Image();
         rotated90.Width = 150;

         // Create the TransformedBitmap to use as the Image source.
         TransformedBitmap tb = new TransformedBitmap();

         // Create the source to use as the tb source.
         BitmapImage bi = new BitmapImage();
         bi.BeginInit();
         bi.UriSource = new Uri(@"sampleImages/watermelon.jpg", UriKind.RelativeOrAbsolute);
         bi.EndInit();

         // Properties must be set between BeginInit and EndInit calls.
         tb.BeginInit();
         tb.Source = bi;
         // Set image rotation.
         RotateTransform transform = new RotateTransform(90);
         tb.Transform = transform;
         tb.EndInit();
         // Set the Image source.
         rotated90.Source = tb;

         //Add Image to the UI
         Grid.SetColumn(rotated90, 1);
         Grid.SetRow(rotated90, 1);
         transformedGrid.Children.Add(rotated90);

      }
Exemplo n.º 34
0
        public void Render(Canvas _parent)
        {
            rText = new Label();
            rText.Background = new SolidColorBrush(Colors.LightYellow);
            if (type == "Link")
            { rText.Foreground = new SolidColorBrush(Colors.Blue); 
            }
            else
            {
                rText.Foreground = new SolidColorBrush(Colors.Black);
            }
            rText.Content = calloutText;
            rText.FontSize = 10;
            rText.Width = 30;
            rText.MouseEnter +=new System.Windows.Input.MouseEventHandler(rText_MouseEnter);
            rText.MouseLeave += new System.Windows.Input.MouseEventHandler(rText_MouseLeave);
            rText.MouseDown +=new MouseButtonEventHandler(rText_MouseDown);
            _parent.Children.Add(rText);
            Canvas.SetLeft(rText, xpos);
            Canvas.SetTop(rText, ypos);

            Rectangle r1 = new Rectangle();
            r1.Fill = new SolidColorBrush(Colors.LightYellow);
            r1.Width = 8;
            r1.Height = 8;
            _parent.Children.Add(r1);
            Canvas.SetLeft(r1, xpos+5);
            Canvas.SetTop(r1, ypos+15);

            RotateTransform rt = new RotateTransform();
            rt.Angle = 45;
            r1.LayoutTransform = rt;
            

        }
Exemplo n.º 35
0
 public void Draw()
 {
     this.Text.set_Text("");
     if (this.m_tl != null)
     {
         this.Text.set_Text((this.m_tl.Text.Length > 0) ? this.m_tl.Text : this.m_tl.ID);
         this.Text.set_Foreground(new SolidColorBrush(_SilverlightHelper.ConvertToColor(this.m_tl.TextForeColor)));
         this.Text.set_FontFamily(new FontFamily(this.m_tl.FontName));
         this.Text.set_FontSize((double) (this.m_tl.FontSize + 3f));
         if ((this.m_tl.FontStyle & 1) == 1)
         {
             this.Text.set_FontWeight(FontWeights.get_Bold());
         }
         if ((this.m_tl.FontStyle & 2) == 2)
         {
             this.Text.set_FontStyle(FontStyles.get_Italic());
         }
         if ((this.m_tl.FontStyle & 4) == 4)
         {
             this.Text.set_TextDecorations(TextDecorations.get_Underline());
         }
         RotateTransform transform = new RotateTransform();
         transform.set_Angle((double) this.m_tl.Escapement);
         this.Text.set_RenderTransform(transform);
     }
 }
Exemplo n.º 36
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 15 "..\..\ClockWindow.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseDown);

            #line default
            #line hidden

            #line 15 "..\..\ClockWindow.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseUp);

            #line default
            #line hidden

            #line 15 "..\..\ClockWindow.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseLeftButtonUp);

            #line default
            #line hidden
                return;

            case 2:
                this.christianityCalendar = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.persianCalendar = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.rectangleSecond = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 5:
                this.secondHand = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 6:
                this.rectangleMinute = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 7:
                this.minuteHand = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 8:
                this.rectangleHour = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 9:
                this.hourHand = ((System.Windows.Media.RotateTransform)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 37
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.TimeWindow = ((TimeClock.MainWindow)(target));

            #line 9 "..\..\MainWindow.xaml"
                this.TimeWindow.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.DragWindow);

            #line default
            #line hidden
                return;

            case 2:

            #line 43 "..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.close_Window);

            #line default
            #line hidden

            #line 43 "..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.canClose_Window);

            #line default
            #line hidden
                return;

            case 3:
                this.second = ((System.Windows.Controls.Image)(target));
                return;

            case 4:
                this.secondRotate = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 5:
                this.min = ((System.Windows.Controls.Image)(target));
                return;

            case 6:
                this.hour = ((System.Windows.Controls.Image)(target));
                return;

            case 7:
                this.Locker = ((System.Windows.Controls.Button)(target));

            #line 106 "..\..\MainWindow.xaml"
                this.Locker.Click += new System.Windows.RoutedEventHandler(this.Locker_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 38
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\Login.xaml"
                ((Chat.Login)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);

            #line default
            #line hidden
                return;

            case 2:
                this.loginBox = ((System.Windows.Controls.TextBox)(target));

            #line 37 "..\..\Login.xaml"
                this.loginBox.GotFocus += new System.Windows.RoutedEventHandler(this.LoginBox_GotFocus);

            #line default
            #line hidden
                return;

            case 3:
                this.passwordBox = ((System.Windows.Controls.PasswordBox)(target));
                return;

            case 4:
                this.buttonLogin = ((System.Windows.Controls.Button)(target));

            #line 47 "..\..\Login.xaml"
                this.buttonLogin.Click += new System.Windows.RoutedEventHandler(this.Button_Click);

            #line default
            #line hidden
                return;

            case 5:

            #line 66 "..\..\Login.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_2);

            #line default
            #line hidden
                return;

            case 6:
                this.LoadGif = ((System.Windows.Controls.Image)(target));
                return;

            case 7:
                this.rotate = ((System.Windows.Media.RotateTransform)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 39
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.gridLayout = ((System.Windows.Controls.Grid)(target));

            #line 15 "..\..\..\..\Views\ChildWindows\ImageScanWindow.xaml"
                this.gridLayout.AddHandler(System.Windows.Controls.Primitives.ButtonBase.ClickEvent, new System.Windows.RoutedEventHandler(this.Grid_Click));

            #line default
            #line hidden
                return;

            case 2:
                this.btnMin = ((System.Windows.Controls.Button)(target));
                return;

            case 3:
                this.btnMax = ((System.Windows.Controls.Primitives.ToggleButton)(target));
                return;

            case 4:
                this.btnClose = ((System.Windows.Controls.Button)(target));
                return;

            case 5:
                this.gridView = ((System.Windows.Controls.Grid)(target));
                return;

            case 6:
                this.gridScan = ((System.Windows.Controls.Grid)(target));
                return;

            case 7:
                this.scale = ((System.Windows.Media.ScaleTransform)(target));
                return;

            case 8:
                this.translate = ((System.Windows.Media.TranslateTransform)(target));
                return;

            case 9:
                this.rotate = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 10:
                this.img = ((IM.Emoje.Controls.GifImage)(target));
                return;

            case 11:
                this.thumb = ((System.Windows.Controls.Primitives.Thumb)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 40
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.webpage_C = ((Good_Teacher.Controls.WebPage_Control)(target));

            #line 8 "..\..\..\Controls\WebPage_Control.xaml"
                this.webpage_C.Unloaded += new System.Windows.RoutedEventHandler(this.UserControl_Unloaded);

            #line default
            #line hidden
                return;

            case 2:
                this.ToolbarPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 3:
                this.Undo = ((System.Windows.Controls.Button)(target));

            #line 18 "..\..\..\Controls\WebPage_Control.xaml"
                this.Undo.Click += new System.Windows.RoutedEventHandler(this.Undo_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.Redo = ((System.Windows.Controls.Button)(target));

            #line 21 "..\..\..\Controls\WebPage_Control.xaml"
                this.Redo.Click += new System.Windows.RoutedEventHandler(this.Redo_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.Loading = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 6:
                this.noFreeze = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 7:
                this.URL_Label = ((System.Windows.Controls.Label)(target));
                return;

            case 8:
                this.FormHost = ((System.Windows.Forms.Integration.WindowsFormsHost)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 41
0
        /// <summary>
        /// Returns a Windows Media Ellipse from a Rhinocommon Ellipse
        /// </summary>
        /// <param name="input">Rhinocommon Ellipse</param>
        /// <returns>System Windows Media Ellipse</returns>
        public static Sm.EllipseGeometry ToGeometry(this Rg.Ellipse input)
        {
            Sw.Point origin = input.Plane.Origin.ToWindowsPoint();
            double   angle  = Rg.Vector3d.VectorAngle(Rg.Vector3d.YAxis, input.Plane.YAxis, Rg.Plane.WorldXY);

            angle = angle / System.Math.PI * 180;
            Sm.Transform xform = new Sm.RotateTransform(angle, origin.X, origin.Y);

            return(new Sm.EllipseGeometry(origin, input.Radius1, input.Radius2, xform));
        }
Exemplo n.º 42
0
        /// <summary>
        /// Returns a Windows Media Rect from a Rhinocommon Rectangle
        /// </summary>
        /// <param name="input">Rhinocommon Rectangle</param>
        /// <returns>System Windows Media Rect</returns>
        public static Sm.RectangleGeometry ToGeometry(this Rg.Rectangle3d input)
        {
            Sw.Point center = input.Center.ToWindowsPoint();
            double   angle  = Rg.Vector3d.VectorAngle(Rg.Vector3d.YAxis, input.Plane.YAxis, Rg.Plane.WorldXY);

            Sm.Transform xform = new Sm.RotateTransform(angle, center.X, center.Y);

            Sw.Rect rect = new Sw.Rect(center.X - input.Width / 2, center.Y + input.Height / 2, input.Width, input.Height);
            return(new Sm.RectangleGeometry(rect, 0, 0, xform));
        }
Exemplo n.º 43
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
 {
     switch (connectionId)
     {
     case 1:
         this.xformSecond = ((System.Windows.Media.RotateTransform)(target));
         return;
     }
     this._contentLoaded = true;
 }
Exemplo n.º 44
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/TakeMeThere;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot                        = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ContentPanel                      = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.Grid_Compass                      = ((System.Windows.Controls.Grid)(this.FindName("Grid_Compass")));
     this.TargetRotate                      = ((System.Windows.Media.RotateTransform)(this.FindName("TargetRotate")));
     this.DialRotate                        = ((System.Windows.Media.RotateTransform)(this.FindName("DialRotate")));
     this.Grid_Speed                        = ((System.Windows.Controls.Grid)(this.FindName("Grid_Speed")));
     this.TextBlock_Speed                   = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_Speed")));
     this.TextBlock_Speed_Unit              = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_Speed_Unit")));
     this.Grid_AvgSpeed                     = ((System.Windows.Controls.Grid)(this.FindName("Grid_AvgSpeed")));
     this.TextBlock_AvgSpeed                = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_AvgSpeed")));
     this.TextBlock_AvgSpeed_Unit           = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_AvgSpeed_Unit")));
     this.Grid_Course_Compass               = ((System.Windows.Controls.Grid)(this.FindName("Grid_Course_Compass")));
     this.CourseTargetRotate                = ((System.Windows.Media.RotateTransform)(this.FindName("CourseTargetRotate")));
     this.CourseDialRotate                  = ((System.Windows.Media.RotateTransform)(this.FindName("CourseDialRotate")));
     this.Grid_EstimateArrivalTime          = ((System.Windows.Controls.Grid)(this.FindName("Grid_EstimateArrivalTime")));
     this.TextBlock_EstimateArrivalTime     = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_EstimateArrivalTime")));
     this.TextBlock_AvgSpeed_for_ETA        = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_AvgSpeed_for_ETA")));
     this.TextBlock_CurrentTime             = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_CurrentTime")));
     this.TextBlock_ETA                     = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_ETA")));
     this.TextBlock_ETA_Unit                = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_ETA_Unit")));
     this.Image_Arrow                       = ((System.Windows.Controls.Image)(this.FindName("Image_Arrow")));
     this.TextBlock_EAT_Text                = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_EAT_Text")));
     this.Grid_Direction                    = ((System.Windows.Controls.Grid)(this.FindName("Grid_Direction")));
     this.TextBlock_DirectionSign           = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_DirectionSign")));
     this.TextBlock_TrueHeading             = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_TrueHeading")));
     this.Grid_Distance                     = ((System.Windows.Controls.Grid)(this.FindName("Grid_Distance")));
     this.TextBlock_Distance                = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_Distance")));
     this.TextBlock_Distance_Unit           = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_Distance_Unit")));
     this.Grid_TargetLocation               = ((System.Windows.Controls.Grid)(this.FindName("Grid_TargetLocation")));
     this.TextBlock_TargetName              = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_TargetName")));
     this.TextBlock_TargetLatitude          = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_TargetLatitude")));
     this.TextBlock_TargetLongitude         = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_TargetLongitude")));
     this.Grid_GoTargetLocation             = ((System.Windows.Controls.Grid)(this.FindName("Grid_GoTargetLocation")));
     this.Grid_GPSAccuracy                  = ((System.Windows.Controls.Grid)(this.FindName("Grid_GPSAccuracy")));
     this.TextBlock_HorizontalAccuracy      = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_HorizontalAccuracy")));
     this.TextBlock_HorizontalAccuracy_Unit = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_HorizontalAccuracy_Unit")));
     this.Grid_GPSStatus                    = ((System.Windows.Controls.Grid)(this.FindName("Grid_GPSStatus")));
     this.Image_GPSStatus                   = ((System.Windows.Controls.Image)(this.FindName("Image_GPSStatus")));
     this.TextBlock_GPSStatus               = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_GPSStatus")));
     this.Grid_CurrenLocation               = ((System.Windows.Controls.Grid)(this.FindName("Grid_CurrenLocation")));
     this.TextBlock_CurrentLatitude         = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_CurrentLatitude")));
     this.TextBlock_CurrentLongitude        = ((System.Windows.Controls.TextBlock)(this.FindName("TextBlock_CurrentLongitude")));
     this.Grid_GoCurrentLocaion             = ((System.Windows.Controls.Grid)(this.FindName("Grid_GoCurrentLocaion")));
     this.Appbar_ListButton                 = ((Microsoft.Phone.Shell.ApplicationBarIconButton)(this.FindName("Appbar_ListButton")));
     this.Appbar_MapButton                  = ((Microsoft.Phone.Shell.ApplicationBarIconButton)(this.FindName("Appbar_MapButton")));
 }
Exemplo n.º 45
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.accelerateButton = ((System.Windows.Controls.Button)(target));

            #line 13 "..\..\MainWindow.xaml"
                this.accelerateButton.PreviewMouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.accelerateButton_PreviewMouseUp);

            #line default
            #line hidden

            #line 13 "..\..\MainWindow.xaml"
                this.accelerateButton.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.accelerateButton_PreviewMouseDown);

            #line default
            #line hidden
                return;

            case 2:
                this.brakeButton = ((System.Windows.Controls.Button)(target));

            #line 14 "..\..\MainWindow.xaml"
                this.brakeButton.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.brakeButton_PreviewMouseDown);

            #line default
            #line hidden

            #line 14 "..\..\MainWindow.xaml"
                this.brakeButton.PreviewMouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.brakeButton_PreviewMouseUp);

            #line default
            #line hidden
                return;

            case 3:
                this.backSpeedLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.speedLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.transform = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 6:
                this.textBox = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 46
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/DataConnectorUI2;component/controls/Spinner.xaml", System.UriKind.Relative));
     this.spinnerAnimate   = ((System.Windows.Media.Animation.Storyboard)(this.FindName("spinnerAnimate")));
     this.tfmSpinnerScale  = ((System.Windows.Media.ScaleTransform)(this.FindName("tfmSpinnerScale")));
     this.tfmSpinnerRotate = ((System.Windows.Media.RotateTransform)(this.FindName("tfmSpinnerRotate")));
 }
Exemplo n.º 47
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is Color)
            {
                Color  cColor      = (Color)value;
                string TragetColor = string.Format(@"#{0:X2}{1:X2}{2:X2}{3:X2}",
                                                   cColor.A, cColor.R, cColor.G, cColor.B);
                return(TragetColor);
            }
            if (value is StyleColor)
            {
                var sc = (StyleColor)value;
                if (sc.FillType == ColorFillType.Solid)
                {
                    return(new System.Windows.Media.SolidColorBrush(this.FromArgb(sc.ARGB)));
                }
                else if (sc.FillType == ColorFillType.Gradient)
                {
                    var lineb = new System.Windows.Media.LinearGradientBrush();
                    lineb.StartPoint = new System.Windows.Point(0d, 0.5d);
                    lineb.EndPoint   = new System.Windows.Point(1d, 0.5d);
                    var newFrames = sc.Frames;
                    if (newFrames == null || newFrames.Count == 0)
                    {
                        newFrames    = new Dictionary <double, int>();
                        newFrames[0] = -1;
                        newFrames[1] = -16777216;
                    }
                    foreach (var keypair in newFrames)
                    {
                        var gradientStop = new System.Windows.Media.GradientStop(
                            this.FromArgb(keypair.Value),
                            keypair.Key);
                        lineb.GradientStops.Add(gradientStop);
                    }

                    var aRotateTransform = new System.Windows.Media.RotateTransform();
                    aRotateTransform.CenterX = 0.5;
                    aRotateTransform.CenterY = 0.5;
                    aRotateTransform.Angle   = sc.Angle;
                    lineb.RelativeTransform  = aRotateTransform;
                    return(lineb);
                }
            }

            else
            {
                return(new System.Windows.Media.SolidColorBrush(Color.FromArgb(0, 255, 255, 255)));
            }


            return(Brushes.White);
        }
Exemplo n.º 48
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.transform = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 2:
                this.tLogin = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 3:
                this.txtLogin = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.warning = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 5:
                this.txtPassword = ((System.Windows.Controls.PasswordBox)(target));
                return;

            case 6:
                this.showPass = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.passShow = ((System.Windows.Controls.Button)(target));
                return;

            case 8:

            #line 34 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Submit_Click);

            #line default
            #line hidden
                return;

            case 9:

            #line 56 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Registr_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 49
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Jukebox.Client2;component/RefreshButton.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.Rectangle1 = ((System.Windows.Shapes.Rectangle)(this.FindName("Rectangle1")));
     this.Plane1     = ((System.Windows.Media.PlaneProjection)(this.FindName("Plane1")));
     this.Transform1 = ((System.Windows.Media.RotateTransform)(this.FindName("Transform1")));
 }
Exemplo n.º 50
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Spritehand.PhysicsBehaviors;component/ucExplode.xaml", System.UriKind.Relative));
     this.sbExplode     = ((System.Windows.Media.Animation.Storyboard)(this.FindName("sbExplode")));
     this.LayoutRoot    = ((System.Windows.Controls.Canvas)(this.FindName("LayoutRoot")));
     this.rotateExplode = ((System.Windows.Media.RotateTransform)(this.FindName("rotateExplode")));
     this.path          = ((System.Windows.Shapes.Path)(this.FindName("path")));
 }
Exemplo n.º 51
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 5 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.OnMouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 2:
                this.Reloj = ((System.Windows.Shapes.Ellipse)(target));
                return;

            case 3:
                this.InternaReloj = ((System.Windows.Shapes.Ellipse)(target));
                return;

            case 4:
                this.CanvasReloj = ((System.Windows.Controls.Canvas)(target));
                return;

            case 5:
                this.AgujaHoras = ((System.Windows.Shapes.Line)(target));
                return;

            case 6:
                this.AgujaHorasRotateTransform = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 7:
                this.AgujaMinutos = ((System.Windows.Shapes.Line)(target));
                return;

            case 8:
                this.AgujaMinutosRotateTransform = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 9:
                this.AgujaSegundos = ((System.Windows.Shapes.Line)(target));
                return;

            case 10:
                this.AgujaSegundosRotateTransform = ((System.Windows.Media.RotateTransform)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 52
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.test = ((TheSystem.UserControls.Spinner)(target));
                return;

            case 2:
                this.noFreeze = ((System.Windows.Media.RotateTransform)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 53
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.MainCanvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 2:
                this.CanvasRotate = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 3:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.label3 = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.label4 = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.ellipse1 = ((System.Windows.Shapes.Ellipse)(target));
                return;

            case 7:
                this.ellipse2 = ((System.Windows.Shapes.Ellipse)(target));
                return;

            case 8:
                this.image1 = ((System.Windows.Controls.Image)(target));
                return;

            case 9:
                this.label2 = ((System.Windows.Controls.Label)(target));
                return;

            case 10:
                this.ellipseSmile = ((System.Windows.Shapes.Ellipse)(target));
                return;

            case 11:
                this.labeluf = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 54
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ic = ((System.Windows.Controls.ItemsControl)(target));
                return;

            case 2:
                this.Angle = ((System.Windows.Media.RotateTransform)(target));
                return;
            }
            this._contentLoaded = true;
        }
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/ESRI.SilverlightViewer;component/Widgets/OverviewMapWidget.xaml", System.UriKind.Relative));
     this.OverviewMapPanel         = ((System.Windows.Controls.Border)(this.FindName("OverviewMapPanel")));
     this.OverviewPanelTransform   = ((System.Windows.Media.TranslateTransform)(this.FindName("OverviewPanelTransform")));
     this.myOverviewMap            = ((ESRI.ArcGIS.Client.Toolkit.OverviewMap)(this.FindName("myOverviewMap")));
     this.OverviewToggler          = ((System.Windows.Controls.HyperlinkButton)(this.FindName("OverviewToggler")));
     this.OverviewTogglerTransform = ((System.Windows.Media.RotateTransform)(this.FindName("OverviewTogglerTransform")));
 }
Exemplo n.º 56
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ButtonRotate = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 2:
                this.ButtonBrush = ((System.Windows.Media.SolidColorBrush)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 57
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Player_Hitbox = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 2:
                this.rotateTransform = ((System.Windows.Media.RotateTransform)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 58
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.p2 = ((System.Windows.Media.ImageBrush)(target));
                return;

            case 2:
                this.TransRotate11 = ((System.Windows.Media.RotateTransform)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 59
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.sliderRotation = ((USB_GUI.SliderRotation)(target));
                return;

            case 2:
                this.canvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 3:
                this.ellipseBack = ((System.Windows.Shapes.Ellipse)(target));

            #line 8 "..\..\SliderRotation.xaml"
                this.ellipseBack.MouseLeave += new System.Windows.Input.MouseEventHandler(this.ellipseBack_MouseLeave);

            #line default
            #line hidden

            #line 8 "..\..\SliderRotation.xaml"
                this.ellipseBack.MouseMove += new System.Windows.Input.MouseEventHandler(this.ellipseBack_MouseMove);

            #line default
            #line hidden

            #line 8 "..\..\SliderRotation.xaml"
                this.ellipseBack.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.ellipseBack_MouseUp);

            #line default
            #line hidden

            #line 8 "..\..\SliderRotation.xaml"
                this.ellipseBack.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.ellipseBack_MouseDown);

            #line default
            #line hidden
                return;

            case 4:
                this.handle = ((System.Windows.Shapes.Ellipse)(target));
                return;

            case 5:
                this.rotate = ((System.Windows.Media.RotateTransform)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 60
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.StickyCanvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 2:
                this.AnimatedRotateTransform = ((System.Windows.Media.RotateTransform)(target));
                return;
            }
            this._contentLoaded = true;
        }