private void canvas1_PointerPressed(object sender, PointerRoutedEventArgs e) { Point pxy = e.GetCurrentPoint((CanvasAnimatedControl)sender).Position; Vector2 p = pxy.ToVector2(); MainPage.debugTxt.Text = p.X.ToString() + " | " + p.Y.ToString(); controller.PointerPressed((UserTool)toolList.SelectedItem, sender, e); redo.IsEnabled = controller.CanRedo(); undo.IsEnabled = controller.CanUndo(); }
private void refresh_Click(object sender, RoutedEventArgs e) { BGMPlayer.PlayButton9(); //controller.outputCoordinates[0].geometryList.Clear(); controller = null; controller = LevelLoader.GetLevel(localLevel.ID); controller.historyDfaList.Clear(); controller.outputCoordinates[0].refreshCanvas(canvas1); redo.IsEnabled = controller.CanRedo(); undo.IsEnabled = controller.CanUndo(); for (int i = 0; i < controller.givenConditionsId.Count; i++) { Models.Geometry.Geometry geometry = controller.coordinate.GetGeometryById(controller.givenConditionsId[i]); if (geometry is Point2) { Point2 p2 = geometry as Point2; p2.resultPoint.lineColor = Color.FromArgb(255, 201, 84, 191); } } controller.outputCoordinates[0].refreshGeometrys(); //刷新 controller.missionSuccess += success; }
private void Page_Loaded(object sender, RoutedEventArgs e) { //controller = new Controllers.Geometry.Controllers(); //controller.PreInitialized(LevelLoader.GetLevel(1)); //第一关的控制器 //controller = LevelLoader.GetLevel(1); controller.outputCoordinates[0].WindowHeight = (float)canvas1.ActualHeight; controller.outputCoordinates[0].WindowWidth = (float)canvas1.ActualWidth; maxHeightWidth = new Vector2((float)canvas1.ActualWidth, (float)canvas1.ActualHeight); //text1.Text = maxHeightWidth.X.ToString() + " | " + maxHeightWidth.Y.ToString(); listView1.SelectedIndex = 2; controller.historyDfaList.Clear(); redo.IsEnabled = controller.CanRedo(); undo.IsEnabled = controller.CanUndo(); controller.missionSuccess += success; }