Exemplo n.º 1
0
        private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            var builder = new ContainerBuilder();
            builder.RegisterModule(new DefaultWiringModule());
            container = builder.Build();

            viewmodel = container.Resolve<IViewModel>();

            try
            {
                var content = await App.ReadFileAsync(App.GetDataFilePath());
                var loadedViewModel = JsonConvert.DeserializeObject<ViewModel>(content);
                viewmodel.SetData(loadedViewModel);
            }
            catch (Exception ex)
            {
                Console.WriteLine("WTF");
                Console.WriteLine(ex.StackTrace);
            }
        }