private void LoadXamlForWpf()
        {
            try
            {
                var localLoader = new WpfXamlLoader();

                var window = (Window)localLoader.Load(Xaml);
                window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                window.DataContext = new TestViewModel();
                window.Show();

            }
            catch (Exception e)
            {
                ShowProblemLoadingError(e);
            }
        }
Esempio n. 2
0
        private void LoadXamlForWpf()
        {
            try
            {
                var visualTree = new WpfXamlLoader().Load(Xaml);

                var window = GetVisualizerWindow(visualTree);
                window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                window.DataContext = new TestViewModel();
                window.Show();

            }
            catch (XamlLoadException e)
            {
                ShowProblemLoadingError(e);
            }
        }
 protected GivenAXamlXmlLoader()
 {
     Loader = new WpfXamlLoader();
 }