본문 바로가기


[XNA , WPF] XNA 에서 코드레벨로 WPF 생성하기

필요한 레퍼런스는

이고  필요한 using 은

using System.Threading;
using System.Windows;
using System.Windows.Controls;


Created with colorer-take5 library. Type 'csharp'
XNA , Game1.cs 중 일부

        Texture2D tex;
        protected override void LoadContent()
            spriteBatch = new SpriteBatch(GraphicsDevice);
            tex = Content.Load<Texture2D>("logo2");
            this.Window.Title = "currentThread :" + Thread.CurrentThread.ManagedThreadId;
            //[0] 새로운 wpf 어플을 생성하기 위해 새로운 스레드 생성 , 스레트타입은 STA
            Thread t = new Thread(startThread);
            t.ApartmentState = ApartmentState.STA;
        void startThread()
            //[1] Application 객체를 선언하고 생성
            Application app = new Application();
            //[2] StartUp 이벤트를 건다.
            app.Startup += new StartupEventHandler(app_Startup);
            //[3] 그리고 시작!

        void app_Startup(object sender, StartupEventArgs e)
            //[4] 새로운 윈도우를 생성한다
            Window win = new Window();
            win.Width = 300;
            win.Height = 300;
            win.Title = "currentThread :" + Thread.CurrentThread.ManagedThreadId;
            //[5] 새로운 윈도우를 표시한다

            Button bt = new Button();
            bt.Content = "XNA 에서 WPF 생성��기";
            win.Content = bt;

역시나 윈도우폼과 마찮가지로 STA 타입의 스레드가 필요하다.
그러나 윈폼과 Application 의 사용법이 다른점에 주의! (그냥 Application.Run 하면 안된다.)

또한 닷넷4.0의 경우 System.Xaml 을 필히 참조 시켜줘야 겠다. 
  • 이전 댓글 더보기
  • BlogIcon cheap mont blanc pens 2015.01.09 03:41

    이용약관위배로 관리자 삭제된 댓글입니다.

  • BlogIcon furla purses outlet 2015.01.09 06:45

    이용약관위배로 관리자 삭제된 댓글입니다.

  • 匿名 2015.01.14 18:27

    이용약관위배로 관리자 삭제된 댓글입니다.

  • 匿名 2015.01.14 18:29

    이용약관위배로 관리자 삭제된 댓글입니다.

  • 匿名 2015.01.15 12:22

    이용약관위배로 관리자 삭제된 댓글입니다.

  • BlogIcon mont blanc pen 2015.01.31 14:00

    일에Saints big underdogs in Cup final vs

    David Corner of Sunderland in action during the 1985 League Cup final against Norwich City at Wembley Stadium in London. Sunderland boss Gus Poyet even fears his team could even be embarrassed if they play as poorly as they did in their recent 4 1 loss to Arsenal.

    Sunderland though have enjoyed some success against City, including winning their last four 그마

  • BlogIcon louis vuitton outlet 2015.02.06 02:38

    법에The most effective 10 The majority of well-known New york Artists

    Expenses Martin Fran,tory burch outlet online, also known as the particular "Piano Man,louis vuitton store, in . was made inside Brooklyn in addition to raised on Extended Tropical isle. Just like a usually informed pianist,louis vuitton handbags, singer in addition to composer, Fran is really valued regarding their own Usa indiv메일

  • 匿名 2015.02.11 14:03

















  • BlogIcon gucci sneakers 2015.02.12 03:10

    습어Extend Miracle jingle bell band

    We have arrived at the final build from the Louisville Jewellery Examiner's "12 Times associated with Xmas Jewellery Projects associated with 2012. inch Hopefully a person loved the final fourteen days associated with Xmas projects as well as ideas. It had been certainly a larger task compared to We believed prior to We required this upon,authentic burberry outle할선

  • BlogIcon tory burch reva shoes 2015.02.18 23:10

    되메Worldwide Account with regard to Pet Well being Selects HEWLETT PACKARD

    HEWLETT PACKARD these days introduced how the Worldwide Account with regard to Pet Well being (IFAW) gucci outlet online offers selected HEWLETT PACKARD Converged National infrastructure to aid it's procedures within 15 workplaces all over the world along with enhanced technologies overall performance to satisfy needs assoc일리

  • BlogIcon louis vuitton handbags 2015.02.20 13:58

    지습Steps to make Angling Fishing lures

    Producing your personal angling fishing lures could be enjoyable,gucci ouelt, satisfying,tory burch outlet, as well as helpful simply because they perform capture seafood really effectively. It's affordable to create all of them and you will make use of wood blanks for example broom deals with or even discard wooden you'll find almost anyplace. Angling fishin려히

  • BlogIcon fulinglasses review 2015.03.05 17:04

    되메in line with the Mayo Clinic 4out of fiveindividuals within the U.S. will experience low back pain once or more through their lives.

    Back pain is a quite common complaint. it's among the most typical causes for individuals to overlook work or make a visit to the doctor's office,tiffany co sunglasses.

    there's a bright side. maximumback pain can also be prevented and when back pain treatme다로

  • BlogIcon louis vuitton handbags 2015.03.07 16:31

    한단Chevrolet HHR LS 07 chev hhr rear brakes how do you take shoes

    Refer to Vehicle Lifting,gucci oulet. Remove the tire and wheel assembly. Remove the adjuster assembly (2) from the brake shoes

    Position the hook end of the J 38400 (1) under the universal spring and lightly pull the universal spring end out of the shoe web hole,tory burch outlet. Hold the universal spring while removing the trai한를

  • 리어Horse soring is really subject related to lively N

    CALIFORNIA Witnesses together with considerably numerous views concerning the level related to dog improper use inside the walking horse company showed up before the congressional cell Thurs, leaving behind several our elected representatives unclear items to believe.

    "It's as you are usually via nfl jerseys wholesale two numerous attributes법어

  • 리지Disturbance Acrylics,ray ban outlet

    Polymer fresh paint is probably probably the most flexible associated with press,cheap ray bans, it may be diluted along with drinking water as well as used within the type of watercolor or even utilized directly from the pipe in order to imitate essential oil paints. As soon as dried out the actual fresh paint is actually water-resistant and therefore severa를네

  • BlogIcon chemise burberry femme 2015.03.27 21:10

    분서l'&eacute;tiquette comme une chose importante,Lac de la proximit&eacute; de la surface de Liu Zhuang trois Nord.| | Wei (155 - 220), au d&eacute;but de la guerre de l'Union sovi&eacute;tique, Yang a dit: "il y a un objet,D'autres. Hangzhou femme normale permet de echarpe burberry homme pas cher lire, sa m&egrave;re et sa m&egrave;re l'imp&eacute;ratrice Wu.Tu n'as pas laiss&eacute; la partie r&eac일이

  • BlogIcon burberry purses 2015.03.29 14:59

    마를film to show Sunday at 2013 QFilm Festival in Long Beach

    LONG BEACH >> Sergio Romero furla outlet knew it would be difficult for his mother to accept that the 37 year old was gay, but it still shocked and hurt him to learn she preferred her son to be an active gang member than to be gay.

    her, I was louis vuitton handbags more of a man as a gang member than being gay, said Romero as he sat in메마

  • BlogIcon burberry trench sale 2015.04.03 22:10

    가지Report On Magical Realism Warns Of Increased Incidences Of Women's Tears Flooding The Entire World

    NEW YORK that such occurrences pose a grave threat to the global economy and millions of human lives, a report presented Thursday at a United Nations summit on magical realism highlights an alarming increase in incidences in which the whole world is completely flooded by the tears of a grieving wo에관

  • BlogIcon michael kors wallet sale 2015.04.04 19:55

    마메Proven brutality key to being North Korea's heir apparent

    To be a credible candidate for the leadership of North Korea, a man needs plenty of blood on his hands.

    Overt ruthlessness and a penchant for gratuitous violence are seen as essential leadership qualities in a country whose political culture is founded on the notion that North Korea is under a permanent state of siege by the United St는없

  • BlogIcon furla online 2015.04.04 21:31

    없부I've the S320 using the tranny within,furla handbags online

    Client: How do i Realize that I have to lso are check out? Basically realize properly,gucci sneakers, I've understand method of understanding in the event that cleaning the actual PCB had been successfull unless of course We obtain an additional check out since the vehicle won't walk out sagging setting by itself? Is actually which pro로비