public void ConnectToShapes(CompositeCollection coll) { _bodyVm = ParentVm.FindShape(LocalModelObject.BodyName, coll); if (_bodyVm == null) { MessageBox.Show("The shape pointed to by " + LocalModelObject.BodyName + " does not exists in CO " + ParentVm.Name, "Error parsing file", MessageBoxButton.OK, MessageBoxImage.Error); } }
public override void Commit() { if (AddNewReservation()) { ParentVm.UpdateList(); Window.Close(); } }
public void RemovePoint(LfDragablePointViewModel point) { if (LocalModelObject == null) { return; } PointVms.Remove(point); LocalModelObject.RemovePoint(point.ModelObject); InvalidateAll(); ParentVm.OnPropertyChanged(""); }
public async Task ChangeSourceAsync(StorageFile file) { if (file != null) { Source = MediaSource.CreateFromStorageFile(file); MediaControllingViewModel.ChangeMediaPlayerSource(Source); CurrentStorageFile = file; await VideoPropsViewModel.UpdateVideoPropsByStorageFile(file); ParentVm.RefreshTitle(); ViewModelLocator.Current.TeachingTipsViewModel.StartIfAppropriate(3); } }
public void ConnectToShapes(StateShapeCollectionViewModel shapes) { _aVm = ParentVm.FindShape(ModelObject.AName, shapes); if (_aVm == null) { MessageBox.Show("The shape A pointed to by " + ModelObject.Name + " does not exists in CO " + ParentVm.Name, "Error parsing file", MessageBoxButton.OK, MessageBoxImage.Error); } _bVm = ParentVm.FindShape(ModelObject.BName, shapes); if (_bVm == null) { MessageBox.Show("The shape B pointed to by " + ModelObject.Name + " does not exists in CO " + ParentVm.Name, "Error parsing file", MessageBoxButton.OK, MessageBoxImage.Error); } }
private async Task ActionConnect() { IsLoading = true; var res = await AppServices.Client.Connect(ConnectHost); if (res == false) { await ParentVm.ShowMessage($"Не удалось подключиться к серверу {ConnectHost}", "Ошибка"); IsLoading = false; return; } Status = CloudTabStatus.ClientMode; IsLoading = false; }
public new void ConnectToShapes(CompositeCollection coll) { _aVm = ParentVm.FindShape(ModelObject.AName, coll); if (_aVm == null) { MessageBox.Show("The shape A pointed to by " + ModelObject.Name + " does not exists in CO " + ParentVm.Name, "Error parsing file", MessageBoxButton.OK, MessageBoxImage.Error); } if (ModelObject.BName != "notDef") { _bVm = ParentVm.FindShape(ModelObject.BName, coll); if (_bVm == null) { MessageBox.Show("The shape B pointed to by " + ModelObject.Name + " does not exists in CO " + ParentVm.Name, "Error parsing file", MessageBoxButton.OK, MessageBoxImage.Error); } } }
public LfDragablePointViewModel AddPoint(Point point) { if (LocalModelObject == null) { return(null); } LfDragablePoint np = new LfDragablePoint(GetFreeVertexIndex(), point.X, point.Y); LfDragablePointViewModel newPoint = new LfDragablePointViewModel(this, ParentVm, MainVm, this, np); PointVms.Add(newPoint); LocalModelObject.AddPoint(newPoint.ModelObject); InvalidateAll(); ParentVm.OnPropertyChanged(""); return(newPoint); }
public override void Commit() { if (Current.Id == 0) { if (!AddNewKunde()) { return; } } else { if (!SaveKunde()) { return; } } ParentVm.UpdateList(); Window.Close(); }
public ObjectFactoryPropertiesViewModel( TreeViewViewModel treeParent, CompoundObjectViewModel parentVm, MainViewModel mainVm, ObjectFactoryProperties modelObject, CoSystemViewModel systemViewModel) : base(treeParent, parentVm, mainVm, systemViewModel) { _modelObject = modelObject; if (_modelObject != null) { _bodyObject = ParentVm.FindBodyObject(_modelObject.Body); } foreach (SpawnObject so in LocalModelObject.SpawnObjects) { SpawnObjectViewModel sovm = new SpawnObjectViewModel(this, parentVm, mainVm, this, so); SpawnObjects.Add(sovm); } UpdateCornerPoints(); }
public LfDragablePointViewModel InsertPoint(Point insertMe, LfDragablePointViewModel insertBeforeMe) { if (LocalModelObject == null) { return(null); } LfDragablePoint np = new LfDragablePoint(GetFreeVertexIndex(), insertMe.X, insertMe.Y); LfDragablePointViewModel newPoint = new LfDragablePointViewModel(this, ParentVm, MainVm, this, np); int index = 0; if (insertBeforeMe != null) { index = PointVms.IndexOf(insertBeforeMe); } if (index >= 0) { PointVms.Insert(index, newPoint); } if (insertBeforeMe != null) { LocalModelObject.InsertPoint(newPoint.ModelObject, insertBeforeMe.ModelObject); } else { LocalModelObject.InsertPoint(newPoint.ModelObject, null); } InvalidateAll(); ParentVm.OnPropertyChanged(""); return(newPoint); }
public Point ShapePointFromScene(Point scenePoint) { Point coPoint = ParentVm.GetCoPointFromScenePoint(scenePoint); return(ParentVm.CoPointInShape(coPoint, this)); }
// This method returns with the supplied point (expressed in the // shape's coordinate system) converted to the coordinate system // of the scene (i.e. that of the top level CompoundObject). public Point ScenePointFromShape(Point shapePoint) { return(ParentVm.GetScenePointFromCoPoint(ParentVm.ShapePointInCo(shapePoint, this))); }
private void BaseTabModel_PropertyChanged(object sender, PropertyChangedEventArgs e) { ParentVm.OnPropertychanged(e.PropertyName); }