开发者

windowless wpf application example?

Any ad开发者_StackOverflow社区vice or links or sample application (for VS2010) re how to develop a "windowless" WPF application?

That is the ones that look quite modern and don't seem to have the historical window chrome around the edges - they seem to have rounded edges etc...


I wrote a project that did exactly what you are talking about, we used the following project from Microsoft, http://code.msdn.microsoft.com/WPFShell Initially I tried writing it myself by turning off the chrome, not a good idea unless you don't want to be able to drag your window around in the standard windows method.


Just remove StartupUri and in the Application Startup method dont load a window:

public partial class App

{

    public static bool IsTrue ;

    public App()
    {
        Startup += AppStartup;
    }


    public void DoWork()
    {
        for (int i = 0; i < 10; i++)
        {
            Thread.Sleep(1000);
            Trace.WriteLine("blah");
        }
        IsTrue = false;

    }
    void AppStartup(object sender, StartupEventArgs e)
    {
        IsTrue = true;
        new Thread(DoWork).Start();
        while (IsTrue)
        { }
        Current.Shutdown();
    }
}

}

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜