public MainWindow() { InitializeComponent(); this.WindowState = System.Windows.WindowState.Maximized; ZoomManager.ZoomPanel = zoomControl; for (int i = 0; i < 19; i++) { TestControl t = new TestControl(); wrapPanel.Children.Add(t); } zoomControl.ZoomCompleted += (s, e) => { //wrapPanel.ZoomedFactor = zoomControl.ZoomFactor; }; zoomControl.ZoomToObject(ParentGrid); this.MouseDown += (s, e) => { if (e.ClickCount > 1) { zoomControl.ResetZoom(); } else { //wrapPanel.ZoomedFactor = ZoomManager.ZoomPanel.ZoomFactor; } }; }
public virtual void OnZoomCompleted() { if (ZoomCompleted != null) { ZoomCompleted(this, new EventArgs()); } var t = new TestControl(); LayoutRoot.Children.Add(t); t.Scale = 1 / ZoomManager.ZoomPanel.GetScaleFactor(t); t.NestedLevel = NestedLevel + 1; }