private void MoveXY(SelectedBorder element, double toX, double toY, double width, double height) { PennerDoubleAnimation daX = new PennerDoubleAnimation() { To = toX, Equation = Equations.QuartEaseOut, Duration = TimeSpan.FromSeconds(0.5) }; PennerDoubleAnimation daY = new PennerDoubleAnimation() { To = toY, Equation = Equations.QuartEaseOut, Duration = TimeSpan.FromSeconds(0.5) }; PennerDoubleAnimation daW = new PennerDoubleAnimation() { To = width, Equation = Equations.QuintEaseOut, Duration = TimeSpan.FromSeconds(0.3) }; PennerDoubleAnimation daH = new PennerDoubleAnimation() { To = height, Equation = Equations.QuintEaseOut, Duration = TimeSpan.FromSeconds(0.3) }; element.BeginAnimation(Canvas.LeftProperty, daX); element.BeginAnimation(Canvas.TopProperty, daY); element.BeginAnimation(WidthProperty, daW); element.BeginAnimation(HeightProperty, daH); }
private void InitializeSelectedBorder() { mySelectedBorder = new SelectedBorder(); selectedCanvas.Children.Add(mySelectedBorder); FrameworkElement element = ListObject[SelectedIndex]; Point pt = element.TranslatePoint(new Point(0, 0), selectedCanvas); mySelectedBorder.Width = element.Width; mySelectedBorder.Height = element.Height; mySelectedBorder.X = pt.X; mySelectedBorder.Y = pt.Y; }
private void AddSheetMetaData(Sheet sheet) { if (sheet.TitleBlock != null) { sheet.TitleBlock.Delete(); } if (sheet.Border != null) { sheet.Border.Delete(); } TitleBlockDefinition tempTitleBlockDef = GetTitleBlock(); TitleBlockLocationEnum titleBlockLocation = GetTitleBlockLocation(); string[] promptStrings = new string[] { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }; TitleBlock titleBlockForCreatedSheet = sheet.AddTitleBlock(tempTitleBlockDef, titleBlockLocation, promptStrings); if (SelectedBorder.Equals("Default Border")) { sheet.AddDefaultBorder(); } else { sheet.AddBorder(BorderDefinition: GetBorderDefinition(SelectedBorder)); } sheet.ExcludeFromCount = ExcludeFromCount; sheet.ExcludeFromPrinting = ExcludeFromPrinting; sheet.Name = SheetName; sheet.Orientation = this.GetPageOrientation(); if (drawDoc.ActiveSheet != sheet) { sheet.Activate(); } }