publicにできない!
public
がだめならinternal
で!
前回の記事で紹介したクラスのアクセス指定子はinternal
ですが、これをpublic
にするとビルドエラーが出ます!
error WME1038: Method 'IntervalTimer.Delay(System.TimeSpan)' has a parameter of type 'System.Threading.Tasks.Task' in its signature. Although this type is not a valid Windows Runtime type, it implements interfaces that are valid Windows Runtime types. Consider changing the method signature to use one of the following types instead: ''.
IntervalTimer.Delay
のシグネチャーにWindowsランタイム型でないクラスのTask
が入っているから、ということのようです。
Windows ランタイム コンポーネントのエラー条件の診断を読むと、
とあります。
Windowsランタイム型でないクラスを「公開」してはいけないようです。public
でだめなら、というわけでinternal
にするとOKですね!
いろいろ難しい!