private void HandleWireframePropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            switch (e.PropertyName)
            {
            case nameof(WireframeEditControlsViewModel.SelectedTextureFilePath):

                RecordCameraPosition();

                // update the texture before updating the frame (and calling refresh)
                UpdateToSelectedAnimationTextureFile(WireframeEditControlsViewModel.SelectedTextureFilePath);

                UpdateToSavedCameraPosition();

                if (SelectedState.Self.SelectedFrame != null && WireframeEditControlsViewModel.SelectedTextureFilePath != null)
                {
                    var achxFolder = FileManager.GetDirectory(SelectedState.Self.SelectedChain.Name);
                    achxFolder = FileManager.GetDirectory(ProjectManager.Self.FileName);

                    string relativeFileName = FileManager.MakeRelative(WireframeEditControlsViewModel.SelectedTextureFilePath.FullPath, achxFolder);

                    SelectedState.Self.SelectedFrame.TextureName = relativeFileName;

                    AnimationFrameChange?.Invoke(this, null);

                    PropertyGridManager.Self.Refresh();

                    RefreshAll();
                }


                break;

            case nameof(WireframeEditControlsViewModel.IsMagicWandSelected):
                ReactToMagicWandChange(this, null);
                break;

            case nameof(WireframeEditControlsViewModel.IsSnapToGridChecked):
                ReactToSnapToGridChecedChange();
                break;
            }
        }
Exemple #2
0
 public string RelativeTo(FilePath otherFilePath)
 {
     return(FileManager.MakeRelative(this.FullPath, otherFilePath.FullPath));
 }