Missing .NET features in Metro style application?

后端 未结 4 689
谎友^
谎友^ 2021-02-07 05:03

Mostly out of curiosity, I started programming a small \"Metro Style\" project in Visual Studio 2011, the one that was released in Windows Developer Preview. It combines XAML fo

4条回答
  •  忘了有多久
    2021-02-07 05:28

    I don't have the Preview installed, so I can't check. But here are two thoughts:

    1. System.Console is probably not available, because there is no Console in Metro style applications. Check if Debug.WriteLine is available. It writes directly to the Debug window in Visual Studio.

    2. Metro style applications are not supposed to block threads for extended durations. Everything that takes more than a few milliseconds should be done in an asynchronous way. Look for some way to execute an asynchronous callback after some time, e.g., a timer. Or you might be able to await the end of a time span (like TaskEx.Delay in the Async CTP).

提交回复
热议问题