public CreateGridWindow(MonchaDevice Device, MonchaDeviceMesh Mesh) { InitializeComponent(); this._device = Device; this._mesh = Mesh; WidthLabel.Content = this._device.DeviceZone.Width; HeightLabel.Content = this._device.DeviceZone.Height; }
private void Window_Loaded(object sender, RoutedEventArgs e) { WidthUpDn.Value = this._mesh.GetLength(1); HeightUpDn.Value = this._mesh.GetLength(0); Canvas.Canvas.AddRange( CadCanvas.GetMesh( new MonchaDeviceMesh(MonchaDeviceMesh.MakeMeshPoint((int)HeightUpDn.Value.Value, (int)WidthUpDn.Value.Value), string.Empty, this._mesh.MeshType), this._device, MonchaHub.GetThinkess * AppSt.Default.anchor_size, false ), true); }
private void WidthUpDn_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double?> e) { if (this.IsLoaded) { Canvas.Canvas.AddRange( CadCanvas.GetMesh( new MonchaDeviceMesh(MonchaDeviceMesh.MakeMeshPoint((int)HeightUpDn.Value.Value, (int)WidthUpDn.Value.Value), string.Empty, this._mesh.MeshType), this._device, MonchaHub.GetThinkess * AppSt.Default.anchor_size, false ), true); } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { MessageBoxResult messageBoxResult = MessageBox.Show("Сохранить сетку?", "Внимание", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning); switch (messageBoxResult) { case MessageBoxResult.Yes: this._mesh.SubscribePoint(false); this._mesh.Points = MonchaDeviceMesh.MakeMeshPoint((int)HeightUpDn.Value.Value, (int)WidthUpDn.Value.Value); this._mesh.SubscribePoint(true); break; case MessageBoxResult.No: break; case MessageBoxResult.Cancel: e.Cancel = true; break; } }