示例#1
0
            public TextureViewModel(Rmv2MeshNode meshNode, PackFileService packfileService, TexureType texureType)
            {
                _packfileService = packfileService;
                _meshNode        = meshNode;
                _texureType      = texureType;
                Path             = _meshNode.MeshModel.GetTexture(texureType)?.Path;

                PreviewCommand = new RelayCommand(() => TexturePreviewController.CreateVindow(Path, _packfileService));
                BrowseCommand  = new RelayCommand(BrowseTexture);
                RemoveCommand  = new RelayCommand(RemoveTexture);
            }
示例#2
0
        public Control GetView(RageLib.FileSystem.Common.File file)
        {
            var data = file.GetData();

            var ms          = new MemoryStream(data);
            var textureFile = new TextureFile();

            try
            {
                textureFile.Open(ms);
            }
            finally
            {
                ms.Close();
            }

            var view       = new TexturePreviewView();
            var controller = new TexturePreviewController(view);

            controller.TextureFile = textureFile;

            return(view);
        }