Exemplo n.º 1
0
        private void ImportMesh(object sender, RoutedEventArgs e)
        {
            ImportMesh import = new ImportMesh();

            import.AvailableTopologies = new ObservableCollection <Topology>(typeof(Topology).GetEnumValues().Cast <Topology>().ToList());

            var result = import.ShowDialog();

            if (result == true)
            {
                AssetMetadata.createMeshMetadata(import.asset);
                viewmodel.Meshes.Add(import.asset);
            }
            else
            {
                if (!string.IsNullOrEmpty(import.Error))
                {
                    viewmodel.LogEvent(import.Error);
                }
            }
        }
Exemplo n.º 2
0
        internal MetadataHandler(Action <Action> invoke, AssetViewmodel viewmodel)
        {
            this.viewmodel = viewmodel;

            displayError = error => invoke(() => viewmodel.LogEvent(error));

            assetWatcher = new RawAssetWatcher(viewmodel,
                                               error =>
            {
                invoke(() =>
                {
                    viewmodel.LogEvent(error);
                });
            },
                                               success =>
            {
                invoke(() => viewmodel.LogEvent(success));
            },
                                               asset =>
            {
                invoke(() => updateDependents(asset));
            }
                                               );
        }