Ejemplo n.º 1
0
 public static Xaml2009Window LoadWindowFromXaml(string xamlFile)
 {
     // Get the XAML content from an external file.
     using (FileStream fs = new FileStream(xamlFile, FileMode.Open))
     {
         Xaml2009Window window = (Xaml2009Window)XamlReader.Load(fs);
         return(window);
     }
 }
Ejemplo n.º 2
0
        public static Xaml2009Window LoadWindowFromXaml(string xamlFile)
        {
            using (FileStream fs = new FileStream(xamlFile, FileMode.Open))
            {
                Xaml2009Window window = (Xaml2009Window)XamlReader.Load(fs);

                return(window);
            }
        }
Ejemplo n.º 3
0
        static void Main()
        {
            Program app = new Program();

            app.ShutdownMode = ShutdownMode.OnLastWindowClose;

            Window1 window1 = new Window1("Window2.xaml");

            window1.Show();

            Xaml2009Window window2 = Xaml2009Window.LoadWindowFromXaml("Xaml2009.xaml");

            window2.Show();

            app.Run();
        }
Ejemplo n.º 4
0
        static void Main()
        {
            // Create a program that will show two different windows,
            // and will wait until both are closed before ending.
            Program app = new Program();

            app.ShutdownMode = ShutdownMode.OnLastWindowClose;

            // First approach: window with XAML content.
            Window1 window1 = new Window1("Window1.xaml");

            window1.Show();

            // Second approach: XAML for complete window.
            Xaml2009Window window2 = Xaml2009Window.LoadWindowFromXaml("Xaml2009.xaml");

            window2.Show();

            app.Run();
        }