Beispiel #1
0
        public static async Task CreateAsync(IUIVisualizerService _uiVisualizerService, MasterViewModel viewModel)
        {
            ProgressionTree   progression         = new ProgressionTree();
            ITypeFactory      localizationFactory = viewModel.GetTypeFactory();
            RodskaApplication app = (RodskaApplication)RodskaApplication.Current;
            var localeVM          = localizationFactory.CreateInstanceWithParametersAndAutoCompletion <ProgressTreeViewModel>(progression);

            viewModel.Dispatcher.Invoke(() =>
            {
                app.SetDocument(progression);
            });
            await Task.CompletedTask;
        }
Beispiel #2
0
        public static new void CreateEditor(ContentControl document)
        {
            RodskaApp app = (RodskaApp)RodskaApp.Current;

            document.Content = null;
            ITypeFactory typeFactory = app.currentMainVM.GetTypeFactory();
            MainWindow   mainWindow  = (MainWindow)app.MainWindow;

            if (mainWindow.CurrentDocument == null)
            {
                return;
            }
            ProgressionTree        tree      = (ProgressionTree)mainWindow.CurrentDocument;
            ProgressTreeViewModel  viewModel = typeFactory.CreateInstanceWithParametersAndAutoCompletion <ProgressTreeViewModel>(tree);
            ProgressionTreeControl control   = new ProgressionTreeControl(viewModel);

            document.Content = control;
        }
Beispiel #3
0
        public static ProgressionTree LoadFromFile(Catel.Runtime.Serialization.Xml.XmlSerializer seri, FileStream stream)
        {
            ProgressionTree tree = new ProgressionTree();

            try
            {
                stream.Position = 0;

                seri.Warmup(new List <Type>()
                {
                    typeof(TreeEntry), typeof(ProgressionEntry), typeof(ProgressionTree)
                });
                tree = SavableModelBase <ProgressionTree> .Load(stream, seri);
            } catch (SerializationException ex)
            {
                Console.WriteLine(ex.Message);
            }
            return(tree);
            // return seri.Deserialize<ProgressionTree>(stream);
        }