public void AnimateItem(FrameworkElement item) { var translate = new TranslateTransform(0, 300); item.RenderTransform = translate; item.Opacity = 0; Animate.The(TranslateTransform.YProperty) .From(300) .To(0) .Delay(_delay) .For(300.MilliSeconds()) .Create() .AnimateOn(translate); Animate.The(UIElement.OpacityProperty) .From(0) .To(100) .Delay(_delay) .For(300.MilliSeconds()) .Create() .AnimateOn(item); _delay += Amount_To_Increase_Delay; }
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); } }
private void LayoutRoot_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { PointCollection points = new PointCollection(); foreach (Point p in poly.Points) points.Add(p); Point newPoint = e.GetPosition(poly); points.Add(newPoint); poly.Points = points; // placeholder Ellipse ph = new Ellipse { Fill = new SolidColorBrush(Colors.Black), Width = 4D, Height = 4D }; TranslateTransform t = new TranslateTransform { X = newPoint.X - 2D, Y = newPoint.Y - 2D }; ph.RenderTransform = t; cnv.Children.Add(ph); // TextBlock tb = new TextBlock { Foreground = new SolidColorBrush(Colors.Gray), FontSize = 8 }; tb.Text = newPoint.ToString(); tb.RenderTransform = t; cnv.Children.Add(tb); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Base = ((System.Windows.Controls.Canvas)(target)); return; case 2: this.Knob = ((System.Windows.Controls.Canvas)(target)); return; case 3: this.KnobBase = ((System.Windows.Shapes.Ellipse)(target)); return; case 4: this.knobPosition = ((System.Windows.Media.TranslateTransform)(target)); return; case 5: this.slider_rudder = ((System.Windows.Controls.Slider)(target)); return; case 6: this.slider_throttle = ((System.Windows.Controls.Slider)(target)); return; } this._contentLoaded = true; }
/// <summary> /// Bounces the specified element. /// </summary> /// <param name="element">The element.</param> /// <param name="direction">The direction.</param> /// <param name="whenDone">The when done.</param> public static void Bounce(UIElement element, Direction direction, EventHandler whenDone = null) { var translateTransform = new TranslateTransform(); element.RenderTransform = translateTransform; switch (direction) { case Direction.Up: translateTransform.BeginAnimation( TranslateTransform.YProperty, CreateDoubleAnimation( 0, -15, 0.2, (o, e) => translateTransform.BeginAnimation(TranslateTransform.YProperty, CreateDoubleAnimationWithEasing(-15, 0, 0.8, new BounceEase { Bounces = 3, EasingMode = EasingMode.EaseOut })), whenDone)); break; case Direction.Down: translateTransform.BeginAnimation( TranslateTransform.YProperty, CreateDoubleAnimation( 0, 15, 0.2, (o, e) => translateTransform.BeginAnimation(TranslateTransform.YProperty, CreateDoubleAnimationWithEasing(15, 0, 0.8, new BounceEase { Bounces = 3, EasingMode = EasingMode.EaseOut })), whenDone)); break; } }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; System.Windows.Application.LoadComponent(this, new System.Uri("/UcbManagementInformation;component/Views/Reporting/ReportWizard/ReportWizard.xam" + "l", System.UriKind.Relative)); this.ThePage = ((System.Windows.Controls.Page)(this.FindName("ThePage"))); this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot"))); this.ChartStates = ((System.Windows.VisualStateGroup)(this.FindName("ChartStates"))); this.ShowingChart = ((System.Windows.VisualState)(this.FindName("ShowingChart"))); this.HiddenChart = ((System.Windows.VisualState)(this.FindName("HiddenChart"))); this.AdvancedPanelStates = ((System.Windows.VisualStateGroup)(this.FindName("AdvancedPanelStates"))); this.Showing = ((System.Windows.VisualState)(this.FindName("Showing"))); this.Hidden = ((System.Windows.VisualState)(this.FindName("Hidden"))); this.ViewBusyIndicator = ((System.Windows.Controls.BusyIndicator)(this.FindName("ViewBusyIndicator"))); this.SelectDataGrid = ((System.Windows.Controls.Grid)(this.FindName("SelectDataGrid"))); this.DataItemsTreeView = ((System.Windows.Controls.TreeView)(this.FindName("DataItemsTreeView"))); this.GenerateReport = ((System.Windows.Controls.Button)(this.FindName("GenerateReport"))); this.QuickView = ((System.Windows.Controls.Button)(this.FindName("QuickView"))); this.ToggleAdvanced = ((System.Windows.Controls.Primitives.ToggleButton)(this.FindName("ToggleAdvanced"))); this.SelectedDataItemListBox = ((System.Windows.Controls.ListBox)(this.FindName("SelectedDataItemListBox"))); this.AdvancedPanel = ((System.Windows.Controls.StackPanel)(this.FindName("AdvancedPanel"))); this.AdvancedJoins = ((System.Windows.Controls.Button)(this.FindName("AdvancedJoins"))); this.ChartingButton = ((System.Windows.Controls.Button)(this.FindName("ChartingButton"))); this.ChartGrid = ((System.Windows.Controls.Grid)(this.FindName("ChartGrid"))); this.ChartTranslateTransform = ((System.Windows.Media.TranslateTransform)(this.FindName("ChartTranslateTransform"))); this.AddChartButton = ((System.Windows.Controls.Button)(this.FindName("AddChartButton"))); this.CloseChartButton = ((System.Windows.Controls.Button)(this.FindName("CloseChartButton"))); }
//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); }
/// <internalonly /> protected internal override ProceduralAnimation CreateEffectAnimation(EffectDirection direction) { FrameworkElement target = GetTarget(); if (_translateTransform == null) { Transform existingTransform = target.RenderTransform; if (existingTransform != null) { _translateTransform = existingTransform as TranslateTransform; if (_translateTransform == null) { TransformGroup transformGroup = existingTransform as TransformGroup; if (transformGroup != null) { foreach (Transform transform in transformGroup.Children) { _translateTransform = transform as TranslateTransform; if (_translateTransform != null) { break; } } } } } } if (_translateTransform == null) { throw new InvalidOperationException("The element does not have a translate transform associated with it."); } ShakeAnimation animation = new ShakeAnimation(_translateTransform, Duration, _shakeDistance); animation.Interpolation = GetEffectiveInterpolation(); return animation; }
public MainWindow() { view = new ViewParams(); InitializeComponent(); scale = new ScaleTransform(1, 1, 0, 0); pan = new TranslateTransform(0, plot.Height); signals = new SignalCollection(this); signals.scaleSignalStrokes(scale); signals.updateLabels(); resetTransform(); ports = SerialPort.GetPortNames(); Console.WriteLine("ports:"); foreach(string port in ports){ comportList.Items.Add(port.ToString()); Console.WriteLine(port); } arduinoPort = new SerialPort(); arduinoPort.Parity = Parity.None; arduinoPort.StopBits = StopBits.One; arduinoPort.DataBits = 8; arduinoPort.BaudRate = 9600; arduinoPort.ReadTimeout = 200; if (comportList.Items.Count > 0) { arduinoPort.PortName = comportList.Items[0].ToString(); } else { Console.WriteLine("No ports available"); connectButton.IsEnabled = false; } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.BallR = ((System.Windows.Shapes.Ellipse)(target)); return; case 2: this.ttR = ((System.Windows.Media.TranslateTransform)(target)); return; case 3: this.BallG = ((System.Windows.Shapes.Ellipse)(target)); return; case 4: this.ttG = ((System.Windows.Media.TranslateTransform)(target)); return; case 5: this.BallB = ((System.Windows.Shapes.Ellipse)(target)); return; case 6: this.ttB = ((System.Windows.Media.TranslateTransform)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Rectangle1 = ((System.Windows.Shapes.Rectangle)(target)); return; case 2: this.AnimatedTranslateTransform = ((System.Windows.Media.TranslateTransform)(target)); return; case 3: this.Rectangle2 = ((System.Windows.Shapes.Rectangle)(target)); return; case 4: this.AnimatedTranslateTransform2 = ((System.Windows.Media.TranslateTransform)(target)); return; case 5: this.Rectangle3 = ((System.Windows.Shapes.Rectangle)(target)); return; case 6: this.AnimatedTranslateTransform3 = ((System.Windows.Media.TranslateTransform)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Crumbs = ((Teudu.InfoDisplay.BoardCrumbs)(target)); return; case 2: this.TitleContainer = ((System.Windows.Controls.StackPanel)(target)); return; case 3: this.TitlePosition = ((System.Windows.Media.TranslateTransform)(target)); return; case 4: this.BoardContainer = ((System.Windows.Controls.StackPanel)(target)); return; case 5: this.BoardPosition = ((System.Windows.Media.TranslateTransform)(target)); #line 36 "..\..\..\..\Controls\BoardPagedControl.xaml" this.BoardPosition.Changed += new System.EventHandler(this.TranslateTransform_Changed); #line default #line hidden return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.myAnimate = ((System.Windows.Media.TranslateTransform)(target)); return; case 2: this.myAnimate2 = ((System.Windows.Media.TranslateTransform)(target)); return; case 3: this.myAnimate3 = ((System.Windows.Media.TranslateTransform)(target)); return; case 4: this.myAnimate4 = ((System.Windows.Media.TranslateTransform)(target)); return; case 5: this.myAnimate5 = ((System.Windows.Media.TranslateTransform)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.SP = ((System.Windows.Controls.StackPanel)(target)); return; case 2: this.clipPath = ((System.Windows.Shapes.Path)(target)); return; case 3: #line 37 "..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 4: this.TT = ((System.Windows.Media.TranslateTransform)(target)); return; } this._contentLoaded = true; }
void gdValues_MouseMove(object sender, MouseEventArgs e) { if (inFocus) { TranslateTransform rt = new TranslateTransform(); rt.Y = e.GetPosition(this).Y - 400; gdValues.RenderTransform = rt; start = rt.Y; foreach (var c in gdValues.Children) { double lblTop = lblSelectedValue.PointToScreen(new Point(0, 0)).Y; if ((c as UIElement).PointToScreen(new Point(0, 0)).Y >= lblTop - 20 && (c as UIElement).PointToScreen(new Point(0, 0)).Y <= lblTop + 20) { (c as Label).Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF005DFF")); selectedText = (c as Label).Content.ToString(); (c as Label).BorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF005DFF")); element = (c as UIElement); } else { (c as Label).BorderBrush = new SolidColorBrush(Colors.White); (c as Label).Background = new SolidColorBrush(Colors.Transparent); } } } }
public void DrawArray(int* array, int size, int y, string name) { TranslateTransform infots = new TranslateTransform((-260) % 300, y); TextBlock infoText = new TextBlock(); infoText.RenderTransform = infots; infoText.Text = name; infoText.Height = 30; infoText.Width = 50; animationContainer.Children.Add(infoText); for (int i = 0; i < size; i++) { Rectangle rect = new Rectangle(); TextBlock text = new TextBlock(); text.Text = array[i].ToString(); text.Height = 30; text.Width = 50; rect.Height = array[i] ; rect.Width = 30; rect.Fill = new SolidColorBrush(Colors.LightBlue); TranslateTransform textts = new TranslateTransform((-200 + 50 * i) % 300, y); TranslateTransform backts = new TranslateTransform((-215 + 50 * i) % 300, y); text.RenderTransform = textts; rect.RenderTransform = backts; animationContainer.Children.Add(rect); animationContainer.Children.Add(text); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 27 "..\..\..\..\Controls\LoadingPopup.xaml" ((System.Windows.Media.Animation.DoubleAnimationUsingKeyFrames)(target)).Completed += new System.EventHandler(this.MainShowAnimation_Completed); #line default #line hidden return; case 2: #line 39 "..\..\..\..\Controls\LoadingPopup.xaml" ((System.Windows.Media.Animation.DoubleAnimationUsingKeyFrames)(target)).Completed += new System.EventHandler(this.MainHideAnimation_Completed); #line default #line hidden return; case 3: this.MessageContainer = ((System.Windows.Controls.Grid)(target)); return; case 4: this.PopUpTransform = ((System.Windows.Media.TranslateTransform)(target)); return; } this._contentLoaded = true; }
public CountDownWpf() { InitializeComponent(); countdownTimer = new Timer {Interval = 1000}; countdownTimer.Elapsed += countdownTimer_Elapsed; RenderTransform = new TranslateTransform() {X = 900, Y=300}; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Base = ((System.Windows.Controls.Canvas)(target)); return; case 2: this.Knob = ((System.Windows.Controls.Canvas)(target)); return; case 3: this.KnobBase = ((System.Windows.Shapes.Ellipse)(target)); return; case 4: this.knobPosition = ((System.Windows.Media.TranslateTransform)(target)); return; case 5: #line 120 "..\..\..\..\Views\Joystick.xaml" ((System.Windows.Media.Animation.Storyboard)(target)).Completed += new System.EventHandler(this.centerKnob_Completed); #line default #line hidden return; } this._contentLoaded = true; }
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(); }
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; }
public static void Start(UIElement element) { if (Element != null) throw new Exception("Another element is being dragged. Only one element at a time may be dragged."); Element = element; Element.CaptureMouse(); Element.MouseMove += new MouseEventHandler(UIElement_MouseMove); TransformGroup tg = Element.RenderTransform as TransformGroup; if (tg == null) { tg = CreateTransformGroup(); Element.RenderTransform = tg; }//end if TranslateTransform tt = tg.Children.Where(t => t is TranslateTransform).SingleOrDefault() as TranslateTransform; if (tt == null) tt = new TranslateTransform(); tt.X = 0; tt.Y = 0; OnDragStarted(Element); }
public void SetTransform() { if (pageHolder == null) return; TranslateTransform t = new TranslateTransform(pageHolder.HeadersSizeActive.Width + 3, 3); gr.Transform = t; }
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; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Carousel = ((System.Windows.Controls.StackPanel)(target)); return; case 2: this.CarouselTransform = ((System.Windows.Media.TranslateTransform)(target)); return; case 3: #line 25 "..\..\carouselTest.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Left_Click); #line default #line hidden return; case 4: #line 28 "..\..\carouselTest.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Right_Click); #line default #line hidden return; } this._contentLoaded = true; }
public override void PerformTranstition(UserControl newPage, UserControl oldPage) { this.newPage = newPage; this.oldPage = oldPage; Duration duration = new Duration(TimeSpan.FromSeconds(1)); DoubleAnimation animation = new DoubleAnimation(); animation.Duration = duration; switch (direction) { case WipeDirection.LeftToRight: animation.To = oldPage.ActualWidth; break; case WipeDirection.RightToLeft: animation.To = -oldPage.ActualWidth; break; } Storyboard sb = new Storyboard(); sb.Duration = duration; sb.Children.Add(animation); sb.Completed += sb_Completed; TranslateTransform sc = new TranslateTransform(); oldPage.RenderTransform = sc; Storyboard.SetTarget(animation, sc); Storyboard.SetTargetProperty(animation, new PropertyPath("X")); //oldPage.Resources.Add(sb); sb.Begin(); }
public SolverOutput(BitmapSource data, List<Solver.Colorizer> colorpalette, IEnumerable<Charge> charges) { InitializeComponent(); _outputdata = data; _charges = new List<Charge>(charges); gridField.Background = new ImageBrush(data); recMapHelper.Fill = Helper.ConvertToBrush(colorpalette); foreach (Charge charge in _charges) { if (charge.IsActive) { var newfPoint = new FieldPoint { Height = 6, Width = 6, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top, Margin = new Thickness(0, 0, 0, 0), Mcharge = charge }; var tgroup = new TransformGroup(); var tt = new TranslateTransform(charge.Location.X + 14, charge.Location.Y + 14); tgroup.Children.Add(tt); gridField.Children.Add(newfPoint); newfPoint.RenderTransform = tgroup; } } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.wayRed = ((System.Windows.Shapes.Ellipse)(target)); return; case 2: this.tt_red = ((System.Windows.Media.TranslateTransform)(target)); return; case 3: this.wayGreen = ((System.Windows.Shapes.Ellipse)(target)); return; case 4: this.tt_green = ((System.Windows.Media.TranslateTransform)(target)); return; case 5: this.wayBlue = ((System.Windows.Shapes.Ellipse)(target)); return; case 6: this.tt_blue = ((System.Windows.Media.TranslateTransform)(target)); return; } this._contentLoaded = true; }
void sp_MouseMove(object sender, MouseEventArgs e) { if (dragging_ && !firstDown_) { Point currentPosition = e.GetPosition(dragTarget_); var transform = dragTarget_.RenderTransform as TranslateTransform; if (transform == null) { transform = new TranslateTransform(); dragTarget_.RenderTransform = transform; } transform.X += currentPosition.X - clickPosition.X; transform.Y += currentPosition.Y - clickPosition.Y; clickPosition = e.GetPosition(dragTarget_); //transform.X = currentPosition.X - clickPosition.X; //transform.Y = currentPosition.Y - clickPosition.Y; if (transform.X + dragTarget_.ActualWidth > canvas.MinWidth) { canvas.MinWidth = canvas.Width = transform.X + dragTarget_.ActualWidth * 2; canvas.InvalidateMeasure(); scroller.InvalidateMeasure(); scroller.InvalidateScrollInfo(); } } else if (firstDown_) firstDown_ = false; }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; System.Windows.Application.LoadComponent(this, new System.Uri("/Offline%20Social;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.newStatus1 = ((System.Windows.Controls.StackPanel)(this.FindName("newStatus1"))); this.red = ((System.Windows.Controls.Image)(this.FindName("red"))); this.newStatus1Transform = ((System.Windows.Media.TranslateTransform)(this.FindName("newStatus1Transform"))); this.newStatus2 = ((System.Windows.Controls.StackPanel)(this.FindName("newStatus2"))); this.red2 = ((System.Windows.Controls.Image)(this.FindName("red2"))); this.newStatus2Transform = ((System.Windows.Media.TranslateTransform)(this.FindName("newStatus2Transform"))); this.liveFeeds1 = ((System.Windows.Controls.StackPanel)(this.FindName("liveFeeds1"))); this.green1 = ((System.Windows.Controls.Image)(this.FindName("green1"))); this.liveFeeds1Transform = ((System.Windows.Media.TranslateTransform)(this.FindName("liveFeeds1Transform"))); this.liveFeeds2 = ((System.Windows.Controls.StackPanel)(this.FindName("liveFeeds2"))); this.green2 = ((System.Windows.Controls.Image)(this.FindName("green2"))); this.liveFeeds2Transform = ((System.Windows.Media.TranslateTransform)(this.FindName("liveFeeds2Transform"))); this.os = ((System.Windows.Controls.Image)(this.FindName("os"))); this.aboutUs = ((System.Windows.Controls.StackPanel)(this.FindName("aboutUs"))); this.blue = ((System.Windows.Controls.Image)(this.FindName("blue"))); this.aboutUsTransform = ((System.Windows.Media.TranslateTransform)(this.FindName("aboutUsTransform"))); this.help = ((System.Windows.Controls.StackPanel)(this.FindName("help"))); this.violet = ((System.Windows.Controls.Image)(this.FindName("violet"))); this.helpTransform = ((System.Windows.Media.TranslateTransform)(this.FindName("helpTransform"))); this.queued = ((System.Windows.Controls.StackPanel)(this.FindName("queued"))); this.redbelow = ((System.Windows.Controls.Image)(this.FindName("redbelow"))); this.queuedCount = ((System.Windows.Controls.TextBlock)(this.FindName("queuedCount"))); this.queuedTransform = ((System.Windows.Media.TranslateTransform)(this.FindName("queuedTransform"))); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.gridLayout = ((System.Windows.Controls.Grid)(target)); return; case 2: this.translate = ((System.Windows.Media.TranslateTransform)(target)); return; case 3: this.rectBG = ((System.Windows.Shapes.Rectangle)(target)); return; case 4: this.bdContent = ((System.Windows.Controls.Border)(target)); return; case 5: this.ccContent = ((System.Windows.Controls.ContentControl)(target)); return; } this._contentLoaded = true; }
public void LoadClick(object sender, EventArgs e) { //MarkAllUiElementsWithTags(); //to delete it later var but = sender as Button; var move = new TranslateTransform(0, 0); var anim = new DoubleAnimation() { Duration = new Duration(TimeSpan.FromSeconds(0.7)), To = but.Margin.Left + Load.Width + 5, AccelerationRatio = 0.5, }; anim.Completed += MoveToLoad; but.RenderTransform = move; move.BeginAnimation(TranslateTransform.XProperty, anim); var moveOther = new TranslateTransform(0, 0); var animOther = new DoubleAnimation() { Duration = new Duration(TimeSpan.FromSeconds(0.5)), To = -Create.Width - 5, AccelerationRatio = 0.5, }; Create.RenderTransform = moveOther; moveOther.BeginAnimation(TranslateTransform.XProperty, animOther); }
protected override void OnRender(DrawingContext drawingContext) { base.OnRender(drawingContext); if (AdornedElement.RenderSize.Width < 20) return; TranslateTransform transform = new TranslateTransform ( AdornedElement.RenderSize.Width - 15, (AdornedElement.RenderSize.Height - 5) / 2 ); transform = new TranslateTransform ( AdornedElement.RenderSize.Width / 2 - 3.5, AdornedElement.RenderSize.Height / 2 - 10 ); drawingContext.PushTransform(transform); Geometry geometry = ascGeometry; if (this.Direction == ListSortDirection.Descending) geometry = descGeometry; drawingContext.DrawGeometry(Brushes.LightGray, null, geometry); drawingContext.Pop(); }
/// <summary> /// ImageControls constructor /// </summary> /// <param name="uiImage">User's Image</param> /// <param name="uiImageCanvas">Canvas the image is displayed on</param> /// <param name="uiProcImage">Processed Image</param> /// <param name="uiProcImageCanvas">Canvas that the processed image is displayed on</param> public ImageControls(Image uiImage, Canvas uiImageCanvas, Image uiProcImage, Canvas uiProcImageCanvas) { image = uiImage; imageCanvas = uiImageCanvas; procImage = uiProcImage; procImageCanvas = uiProcImageCanvas; //Create transform group that includes ScaleTransform (zooming) and TranslateTransform (panning) TransformGroup group = new TransformGroup(); ScaleTransform xform = new ScaleTransform(); group.Children.Add(xform); TranslateTransform tt = new TranslateTransform(); TranslateTransform ttp = new TranslateTransform(); group.Children.Add(tt); group.Children.Add(ttp); //Add transform group to both images. Cant add to canvas because there is no boundry for the canvas, thus the images will expand outside the GUI image.RenderTransform = group; image.MouseWheel += image_MouseWheel; image.MouseLeftButtonDown += image_MouseLeftButtonDown; image.MouseLeftButtonUp += image_MouseLeftButtonUp; image.MouseMove += image_MouseMove; procImage.RenderTransform = group; procImage.MouseWheel += procImage_MouseWheel; procImage.MouseLeftButtonDown += procImage_MouseLeftButtonDown; procImage.MouseLeftButtonUp += procImage_MouseLeftButtonUp; procImage.MouseMove += procImage_MouseMove; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.trnsf_g = ((System.Windows.Media.TranslateTransform)(target)); return; case 2: this.UserName = ((System.Windows.Controls.TextBox)(target)); return; case 3: this.Password = ((System.Windows.Controls.PasswordBox)(target)); return; case 4: this.ConfirmPassword = ((System.Windows.Controls.PasswordBox)(target)); return; case 5: this.Register = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
public void OnIsOpenChanged(bool isOpen) { if (double.IsNaN(this.Width)) { return; } TranslateTransform animatedTranslateTransform = new TranslateTransform(); this.RenderTransform = animatedTranslateTransform; if (this.FindName("AnimatedTranslateTransform") != null) { this.UnregisterName("AnimatedTranslateTransform"); } this.RegisterName("AnimatedTranslateTransform", animatedTranslateTransform); DoubleAnimation translationAnimation = new DoubleAnimation(); translationAnimation.From = isOpen ? this.Width : 0; translationAnimation.To = isOpen ? 0 : this.Width; translationAnimation.Duration = new Duration(new TimeSpan(0,0,0,0,300)); translationAnimation.EasingFunction = new PowerEase() { Power = 3, EasingMode = isOpen ? EasingMode.EaseOut : EasingMode.EaseIn }; Storyboard.SetTargetName(translationAnimation, "AnimatedTranslateTransform"); Storyboard.SetTargetProperty(translationAnimation, new PropertyPath(TranslateTransform.XProperty)); Storyboard translationStoryboard = new Storyboard(); translationStoryboard.Children.Add(translationAnimation); translationStoryboard.Begin(this); }
public RectangleEditor() { InitializeComponent(); ScaleFactor = 1.0f; group = new TransformGroup(); trans = new TranslateTransform(); group.Children.Add(trans); marker.RenderTransform = group; pointerUp.RenderTransform = group; pointerDown.RenderTransform = group; pointerUp.Cursor = Cursors.SizeNWSE; pointerDown.Cursor = Cursors.SizeNWSE; marker.Cursor = Cursors.SizeAll; marker.MouseDown += new MouseButtonEventHandler(marker_MouseDown); marker.MouseMove += new MouseEventHandler(marker_MouseMove); marker.MouseUp += new MouseButtonEventHandler(MouseUpHandler); pointerUp.MouseDown += new MouseButtonEventHandler(pointerUp_MouseDown); pointerUp.MouseMove += new MouseEventHandler(pointerUp_MouseMove); pointerUp.MouseUp += new MouseButtonEventHandler(MouseUpHandler); pointerDown.MouseDown += new MouseButtonEventHandler(pointerDown_MouseDown); pointerDown.MouseMove += new MouseEventHandler(pointerDown_MouseMove); pointerDown.MouseUp += new MouseButtonEventHandler(MouseUpHandler); viewBox.SizeChanged += new SizeChangedEventHandler(viewBox_SizeChanged); Loaded += new RoutedEventHandler(RectangleEditor_Loaded); }
/// <summary> /// Provides the behavior for the Arrange pass of Silverlight layout. Classes can override this method to define their own Arrange pass behavior. /// </summary> /// <param name="finalSize">The final area within the parent that this object should use to arrange itself and its children.</param> /// <returns> /// The actual size that is used after the element is arranged in layout. /// </returns> protected override Size ArrangeOverride(Size finalSize) { if (Symbol is ESRI.ArcGIS.Client.Symbols.MarkerSymbol) { UIElement child = GetChild(); Transform childTransform = child == null ? null : child.RenderTransform; if (childTransform != null) { // Arrange the symbol following it's desired size, the final size which is taking care of the transform is not the good one Size size = child.DesiredSize.Height == 0 && child.DesiredSize.Width == 0 ? finalSize : child.DesiredSize; child.Arrange(new Rect(new Point(0, 0), size)); // Now we need to translate the symbol in order that the visual part of the symbol be in the snapshot Rect rect = childTransform.TransformBounds(new Rect(new Point(0, 0), child.DesiredSize)); // visual position of the symbol after transformation child.RenderTransformOrigin = new Point(0, 0); // for the swatch, the transform origin must be (0,0) whatever the transform origin used in the map if (rect.X != 0 || rect.Y != 0) RenderTransform = new TranslateTransform { X = -rect.X, Y = -rect.Y }; // Center the symbol return finalSize; } } return base.ArrangeOverride(finalSize); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.SplashScreen = ((CarTradingUnlimited.Splasher)(target)); #line 5 "..\..\Splasher.xaml" this.SplashScreen.Closing += new System.ComponentModel.CancelEventHandler(this.SplashScreen_Closing); #line default #line hidden #line 5 "..\..\Splasher.xaml" this.SplashScreen.Loaded += new System.Windows.RoutedEventHandler(this.SplashScreen_Loaded); #line default #line hidden return; case 2: this.trans1 = ((System.Windows.Media.TranslateTransform)(target)); return; case 3: this.trans2 = ((System.Windows.Media.TranslateTransform)(target)); return; } this._contentLoaded = true; }
protected override void OnMouseMove(MouseEventArgs e) { Window wnd = Window.GetWindow(this); Point currentLocation = e.MouseDevice.GetPosition(wnd); var move = new TranslateTransform( currentLocation.X - _previousLocation.X, currentLocation.Y - _previousLocation.Y); if (e.LeftButton == MouseButtonState.Pressed) { var group = new TransformGroup(); if (_previousTransform != null) { group.Children.Add(_previousTransform); } group.Children.Add(move); RenderTransform = group; } else { Cursor = Cursors.Hand; } _previousLocation = currentLocation; _previousTransform = RenderTransform; MainWindow.Instance.CalculatePositions(); base.OnMouseMove(e); }
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.translate = ((System.Windows.Media.TranslateTransform)(target)); return; case 3: this.tbX = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.tbY = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.rect1 = ((System.Windows.Shapes.Rectangle)(target)); return; } this._contentLoaded = true; }
public void Initialize(UIElement element) { this.child = element; if (child != null) { TransformGroup group = new TransformGroup(); ScaleTransform st = new ScaleTransform(); group.Children.Add(st); TranslateTransform tt = new TranslateTransform(); group.Children.Add(tt); child.RenderTransform = group; child.RenderTransformOrigin = new Point(0.0, 0.0); child.MouseWheel += child_MouseWheel; child.MouseLeftButtonDown += child_MouseLeftButtonDown; child.MouseLeftButtonUp += child_MouseLeftButtonUp; child.MouseMove += child_MouseMove; child.PreviewMouseRightButtonDown += new MouseButtonEventHandler(child_PreviewMouseRightButtonDown); } }
protected override void OnRender(System.Windows.Media.DrawingContext drawingContext) { TranslateTransform translation = this.RenderTransform as TranslateTransform; if( translation == null) { translation = new TranslateTransform(); this.RenderTransform = translation; } double width = this.Width; double height = this.Height; if (double.IsNaN(width)) { width = this.ActualWidth; } if (double.IsNaN(height)) { height = this.ActualHeight; } translation.X = -width * 0.5; translation.Y = -height * 0.5; base.OnRender(drawingContext); }
public Wall(Canvas container, Point position, double width, double height) { this.container = container; this.position = position; this.width = width; this.height = height; this.image = new ImageBrush(); Debug.WriteLine("IMG width: " + imageSource.PixelWidth + ", height: " + imageSource.PixelHeight); this.image.ImageSource = imageSource; this.image.Stretch = Stretch.None; transform = new TranslateTransform(); transform.X = -this.position.X; transform.Y = -this.position.Y; st = new ScaleTransform(); st.ScaleX = 1.55; st.ScaleY = 2; this.image.RelativeTransform = st; this.image.Transform = transform; this.imageContainer = new Canvas(); this.imageContainer.Width = width; this.imageContainer.Height = height; this.imageContainer.Background = this.image; this.container.Children.Add(this.imageContainer); Canvas.SetLeft(this.imageContainer, this.position.X); Canvas.SetTop(this.imageContainer, this.position.Y); Canvas.SetZIndex(this.imageContainer, 2); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ColorBtn = ((System.Windows.Controls.Button)(target)); return; case 2: this.Rect = ((System.Windows.Shapes.Rectangle)(target)); return; case 3: this.MovingRect = ((System.Windows.Shapes.Rectangle)(target)); return; case 4: this.RedirectionalRect = ((System.Windows.Shapes.Rectangle)(target)); return; case 5: this.Trans = ((System.Windows.Media.TranslateTransform)(target)); return; case 6: this.SplineTest = ((System.Windows.Shapes.Rectangle)(target)); return; case 7: this.SplineTestTrans = ((System.Windows.Media.TranslateTransform)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.sprite = ((XP.SpriteBattler)(target)); #line 10 "..\..\..\Sprites\SpriteBattler.xaml" this.sprite.Loaded += new System.Windows.RoutedEventHandler(this.SpriteBattler_Loaded); #line default #line hidden return; case 2: this.colorEffect = ((XP.Effects.ColorEffect)(target)); return; case 3: this.damageTextBlock = ((System.Windows.Controls.TextBlock)(target)); return; case 4: this.translate = ((System.Windows.Media.TranslateTransform)(target)); return; } this._contentLoaded = true; }
public void SetupRecordingWindow(Rect selectedArea) { _selectedArea = selectedArea; RecordingAreaIndicator.SetValue(LeftProperty, selectedArea.X-2); RecordingAreaIndicator.SetValue(TopProperty, selectedArea.Y-2); RecordingAreaIndicator.Width = selectedArea.Width+4; RecordingAreaIndicator.Height = selectedArea.Height+4; StartButton.Click += StartButtonOnClick; StopButton.Click += StopButtonOnClick; ReplayButton.Click+=ReplayButtonOnClick; _controlGridRenderTransform = new TranslateTransform(); ControlGrid.RenderTransform = _controlGridRenderTransform; _controlGridRenderTransform.X = selectedArea.X-2 + selectedArea.Width+4; _controlGridRenderTransform.Y = selectedArea.Y-2 + selectedArea.Height+2 - ControlGrid.ActualHeight; Fps = 25; _timer = new DispatcherTimer { Interval = new TimeSpan(0, 0, 0, 0, 1000 / Fps) }; _timer.Tick += CaptureOnTick; CaptureBitmaps = new List<Bitmap>(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.image = ((System.Windows.Controls.Image)(target)); return; case 2: this.leftEllipse = ((System.Windows.Shapes.Ellipse)(target)); return; case 3: this.leftTransform = ((System.Windows.Media.TranslateTransform)(target)); return; case 4: this.rightEllipse = ((System.Windows.Shapes.Ellipse)(target)); return; case 5: this.rightTransform = ((System.Windows.Media.TranslateTransform)(target)); return; } this._contentLoaded = true; }
public override GeneralTransform GetDesiredTransform(GeneralTransform transform) { var group = new TransformGroup(); group.Children.Add((Transform)transform); group.Children.Add(_tTranslate = new TranslateTransform(HorizontalOffset, VerticalOffset)); return group; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.JoystickLayout = ((PlaneController.Resources.Joystick)(target)); return; case 2: this.Base = ((System.Windows.Controls.Canvas)(target)); #line 11 "..\..\..\Resources\Joystick.xaml" this.Base.MouseLeave += new System.Windows.Input.MouseEventHandler(this.Base_MouseLeave); #line default #line hidden #line 11 "..\..\..\Resources\Joystick.xaml" this.Base.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Base_MouseUp); #line default #line hidden return; case 3: this.Knob = ((System.Windows.Controls.Canvas)(target)); #line 52 "..\..\..\Resources\Joystick.xaml" this.Knob.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Knob_Clicked); #line default #line hidden #line 52 "..\..\..\Resources\Joystick.xaml" this.Knob.MouseMove += new System.Windows.Input.MouseEventHandler(this.Knob_Moving); #line default #line hidden return; case 4: this.KnobBase = ((System.Windows.Shapes.Ellipse)(target)); return; case 5: this.knobPosition = ((System.Windows.Media.TranslateTransform)(target)); return; case 6: #line 122 "..\..\..\Resources\Joystick.xaml" ((System.Windows.Media.Animation.Storyboard)(target)).Completed += new System.EventHandler(this.centerKnob_Completed); #line default #line hidden return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.layout = ((System.Windows.Controls.Border)(target)); return; case 2: #line 123 "..\..\..\View\MainView.xaml" ((System.Windows.Controls.Border)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Border_MouseLeftButtonDown); #line default #line hidden return; case 3: #line 127 "..\..\..\View\MainView.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnMin_Click); #line default #line hidden return; case 4: #line 129 "..\..\..\View\MainView.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnMax_Click); #line default #line hidden return; case 5: #line 131 "..\..\..\View\MainView.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnClose_Click); #line default #line hidden return; case 6: this.btnUsreInfo = ((System.Windows.Controls.Button)(target)); return; case 7: this.tt = ((System.Windows.Media.TranslateTransform)(target)); return; case 8: this.btnCloseUserInfo = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.stbwin = ((System.Windows.Controls.Canvas)(target)); return; case 2: this.AnimatedTranslateTransform = ((System.Windows.Media.TranslateTransform)(target)); return; case 3: this.stb2 = ((System.Windows.Media.Animation.Storyboard)(target)); return; case 4: this.banhxe1 = ((System.Windows.Controls.Image)(target)); return; case 5: this.stb4 = ((System.Windows.Media.Animation.Storyboard)(target)); return; case 6: this.banhxe2 = ((System.Windows.Controls.Image)(target)); return; case 7: this.stb6 = ((System.Windows.Media.Animation.Storyboard)(target)); return; case 8: this.banhxe3 = ((System.Windows.Controls.Image)(target)); return; case 9: this.stb8 = ((System.Windows.Media.Animation.Storyboard)(target)); return; case 10: this.banhxe4 = ((System.Windows.Controls.Image)(target)); return; case 11: this.stb10 = ((System.Windows.Media.Animation.Storyboard)(target)); return; case 12: this.banhxe5 = ((System.Windows.Controls.Image)(target)); return; case 13: this.stb12 = ((System.Windows.Media.Animation.Storyboard)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Base = ((System.Windows.Controls.Canvas)(target)); #line 9 "..\..\..\Views\Joystick.xaml" this.Base.MouseMove += new System.Windows.Input.MouseEventHandler(this.onMouseMove); #line default #line hidden #line 10 "..\..\..\Views\Joystick.xaml" this.Base.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.onMouseMove); #line default #line hidden #line 10 "..\..\..\Views\Joystick.xaml" this.Base.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.onMouseMove); #line default #line hidden return; case 2: this.BorderMouse = ((System.Windows.Shapes.Ellipse)(target)); return; case 3: this.BorderStick = ((System.Windows.Shapes.Ellipse)(target)); return; case 4: this.Knob = ((System.Windows.Controls.Canvas)(target)); return; case 5: this.KnobBase = ((System.Windows.Shapes.Ellipse)(target)); return; case 6: this.knobPosition = ((System.Windows.Media.TranslateTransform)(target)); return; case 7: #line 121 "..\..\..\Views\Joystick.xaml" ((System.Windows.Media.Animation.Storyboard)(target)).Completed += new System.EventHandler(this.centerKnob_Completed); #line default #line hidden return; } this._contentLoaded = true; }
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; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.SpriteSheetOffset = ((System.Windows.Media.TranslateTransform)(target)); return; } this._contentLoaded = true; }
WriteableBitmap CreateSourceFor(ImageSourceId id) { BitmapSource original = ImageSource; // Note: need to recreate temporaryImage each time, because Silverlight // has some very strange ideas about when to update the image dimensions Image temporaryImage = new Image(); TintEffect temporaryTintEffect = null; if (id.WantsPreTint) { temporaryTintEffect = TintEffect.Create(id.TintEffectMode); temporaryImage.Effect = temporaryTintEffect; temporaryTintEffect.Color = id.ColorForPreTint; } temporaryImage.Width = original.PixelWidth; temporaryImage.Height = original.PixelHeight; temporaryImage.Source = original; int width, height; SWM.TranslateTransform transform; if (id.UseOriginalDimentions) { width = original.PixelWidth; height = original.PixelHeight; transform = null; } else { width = id.SourceWidth; height = id.SourceHeight; transform = new SWM.TranslateTransform(); transform.X = -id.SourceX; transform.Y = -id.SourceY; } WriteableBitmap output = new WriteableBitmap(width, height); output.Render(temporaryImage, transform); output.Invalidate(); if (temporaryTintEffect != null) { temporaryImage.Effect = null; temporaryTintEffect.Release(); } return(output); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Postagens = ((System.Windows.Controls.TextBlock)(target)); #line 16 "..\..\..\userControls\Mural.xaml" this.Postagens.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Postagens_MouseLeftButtonDown); #line default #line hidden return; case 2: this.Animacao = ((System.Windows.Media.Animation.Storyboard)(target)); return; case 3: this.notas = ((System.Windows.Controls.TextBlock)(target)); #line 31 "..\..\..\userControls\Mural.xaml" this.notas.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Notas_MouseLeftButtonDown); #line default #line hidden return; case 4: this.Outra = ((System.Windows.Media.Animation.Storyboard)(target)); return; case 5: #line 46 "..\..\..\userControls\Mural.xaml" ((System.Windows.Controls.TextBlock)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.TextBlock_MouseLeftButtonDown); #line default #line hidden return; case 6: this.Outro = ((System.Windows.Media.Animation.Storyboard)(target)); return; case 7: this.MyRectangle = ((System.Windows.Media.TranslateTransform)(target)); return; case 8: this.PrincipalContent = ((System.Windows.Controls.StackPanel)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.throttleSlider = ((System.Windows.Controls.Slider)(target)); return; case 2: this.throttleValue = ((System.Windows.Controls.Label)(target)); return; case 3: this.elevatorValue = ((System.Windows.Controls.Label)(target)); return; case 4: this.aileronValue = ((System.Windows.Controls.Label)(target)); return; case 5: this.rudderSlider = ((System.Windows.Controls.Slider)(target)); return; case 6: this.rudderValue = ((System.Windows.Controls.Label)(target)); return; case 7: this.Base = ((System.Windows.Controls.Canvas)(target)); return; case 8: this.Knob = ((System.Windows.Controls.Canvas)(target)); return; case 9: this.KnobBase = ((System.Windows.Shapes.Ellipse)(target)); return; case 10: this.knobPosition = ((System.Windows.Media.TranslateTransform)(target)); return; case 11: #line 160 "..\..\..\Views\Joystick.xaml" ((System.Windows.Media.Animation.Storyboard)(target)).Completed += new System.EventHandler(this.centerKnob_Completed); #line default #line hidden return; } this._contentLoaded = true; }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; System.Windows.Application.LoadComponent(this, new System.Uri("/pollAp;component/Page1.xaml", System.UriKind.Relative)); this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot"))); this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel"))); this.image1 = ((System.Windows.Controls.Image)(this.FindName("image1"))); this.myStoryboard8 = ((System.Windows.Media.Animation.Storyboard)(this.FindName("myStoryboard8"))); this.LayoutRoot1 = ((System.Windows.Controls.StackPanel)(this.FindName("LayoutRoot1"))); this.myStoryboard = ((System.Windows.Media.Animation.Storyboard)(this.FindName("myStoryboard"))); this.myElasticEase = ((System.Windows.Media.Animation.ElasticEase)(this.FindName("myElasticEase"))); this.myRectangle = ((System.Windows.Shapes.Rectangle)(this.FindName("myRectangle"))); this.LayoutRoot2 = ((System.Windows.Controls.StackPanel)(this.FindName("LayoutRoot2"))); this.myStoryboard1 = ((System.Windows.Media.Animation.Storyboard)(this.FindName("myStoryboard1"))); this.myElasticEase1 = ((System.Windows.Media.Animation.ElasticEase)(this.FindName("myElasticEase1"))); this.myRectangle1 = ((System.Windows.Shapes.Rectangle)(this.FindName("myRectangle1"))); this.LayoutRoot3 = ((System.Windows.Controls.StackPanel)(this.FindName("LayoutRoot3"))); this.myStoryboard2 = ((System.Windows.Media.Animation.Storyboard)(this.FindName("myStoryboard2"))); this.myElasticEase2 = ((System.Windows.Media.Animation.ElasticEase)(this.FindName("myElasticEase2"))); this.myRectangle2 = ((System.Windows.Shapes.Rectangle)(this.FindName("myRectangle2"))); this.LayoutRoot4 = ((System.Windows.Controls.StackPanel)(this.FindName("LayoutRoot4"))); this.myStoryboard3 = ((System.Windows.Media.Animation.Storyboard)(this.FindName("myStoryboard3"))); this.myElasticEase3 = ((System.Windows.Media.Animation.ElasticEase)(this.FindName("myElasticEase3"))); this.myRectangle3 = ((System.Windows.Shapes.Rectangle)(this.FindName("myRectangle3"))); this.LayoutRoot5 = ((System.Windows.Controls.StackPanel)(this.FindName("LayoutRoot5"))); this.myStoryboard4 = ((System.Windows.Media.Animation.Storyboard)(this.FindName("myStoryboard4"))); this.myElasticEase4 = ((System.Windows.Media.Animation.ElasticEase)(this.FindName("myElasticEase4"))); this.myRectangle4 = ((System.Windows.Shapes.Rectangle)(this.FindName("myRectangle4"))); this.LayoutRoot6 = ((System.Windows.Controls.StackPanel)(this.FindName("LayoutRoot6"))); this.myStoryboard5 = ((System.Windows.Media.Animation.Storyboard)(this.FindName("myStoryboard5"))); this.myElasticEase5 = ((System.Windows.Media.Animation.ElasticEase)(this.FindName("myElasticEase5"))); this.myRectangle5 = ((System.Windows.Shapes.Rectangle)(this.FindName("myRectangle5"))); this.LayoutRoot7 = ((System.Windows.Controls.StackPanel)(this.FindName("LayoutRoot7"))); this.myStoryboard6 = ((System.Windows.Media.Animation.Storyboard)(this.FindName("myStoryboard6"))); this.myElasticEase6 = ((System.Windows.Media.Animation.ElasticEase)(this.FindName("myElasticEase6"))); this.myRectangle6 = ((System.Windows.Shapes.Rectangle)(this.FindName("myRectangle6"))); this.LayoutRoot8 = ((System.Windows.Controls.StackPanel)(this.FindName("LayoutRoot8"))); this.myStoryboard7 = ((System.Windows.Media.Animation.Storyboard)(this.FindName("myStoryboard7"))); this.myElasticEase7 = ((System.Windows.Media.Animation.ElasticEase)(this.FindName("myElasticEase7"))); this.myRectangle7 = ((System.Windows.Shapes.Rectangle)(this.FindName("myRectangle7"))); this.LayoutRoot9 = ((System.Windows.Controls.StackPanel)(this.FindName("LayoutRoot9"))); this.myStoryboard9 = ((System.Windows.Media.Animation.Storyboard)(this.FindName("myStoryboard9"))); this.myElasticEase9 = ((System.Windows.Media.Animation.ElasticEase)(this.FindName("myElasticEase9"))); this.myRectangle9 = ((System.Windows.Shapes.Rectangle)(this.FindName("myRectangle9"))); this.LayoutRoot10 = ((System.Windows.Controls.StackPanel)(this.FindName("LayoutRoot10"))); this.myStoryboard10 = ((System.Windows.Media.Animation.Storyboard)(this.FindName("myStoryboard10"))); this.myElasticEase10 = ((System.Windows.Media.Animation.ElasticEase)(this.FindName("myElasticEase10"))); this.myRectangle10 = ((System.Windows.Shapes.Rectangle)(this.FindName("myRectangle10"))); this.MyAnimatedTranslateTransform = ((System.Windows.Media.TranslateTransform)(this.FindName("MyAnimatedTranslateTransform"))); }
private void frm_nav_Navigated(object sender, NavigationEventArgs e) { double translateTo = 0.0, translateFrom = 0.0; var currentStep = (int)App.Current.Properties[Constants.ApplicationProperties.CurrentStep]; var nextStep = (int)App.Current.Properties[Constants.ApplicationProperties.NextStep]; //switch (currentStep) //{ // case Constants.ApplicationProperties.Steps.step1: // translateTo = txb_pg1.Margin.Top - rectangle1.Margin.Top; // break; // case Constants.ApplicationProperties.Steps.step2: // translateTo = txb_pg2.Margin.Top - rectangle1.Margin.Top; // translateFrom = txb_pg1.Margin.Top; // break; // case Constants.ApplicationProperties.Steps.step3: // translateTo = txb_pg2.Margin.Top - rectangle1.Margin.Top; // translateFrom = txb_pg1.Margin.Top; // break; // default: // break; //} translateTo = nextStep; translateFrom = currentStep; App.Current.Properties["stepSlider"] = translateTo; var transform = new TranslateTransform(); Duration duration = new Duration(new TimeSpan(0, 0, 0, 2, 0)); DoubleAnimation anim = new DoubleAnimation(translateFrom, translateTo, duration); transform.BeginAnimation(TranslateTransform.YProperty, anim); rectangle1.RenderTransform = transform; }