Windows 8 アプリ ストア コードに type-o がありました。奇妙な結果が得られたので、もう一度調べてみると、値が間違っていることに気付きましたが、それでもコンパイルしてエラーなしで実行できました。これはおかしいと思い、Windows 8 コンソール アプリケーションで試してみましたが、そのコンテキストではコンパイル エラーです。何を与える?
アプリストアのバージョン:
var image = new TextBlock()
{
Text = "A", //Text is "A"
FontSize = //FontSize is set to 100
Height = 100, //Height is NaN
Width = 100, //Width is 100
Foreground= new SolidColorBrush(Colors.Blue)
};
コンソール版:
public class test
{
public int test1 { get; set; }
public int test2 { get; set; }
public int test3 { get; set; }
public int test4 { get; set; }
}
class Program
{
static void Main(string[] args)
{
test testObject = new test()
{
test1 = 5,
test2 =
test3 = 6, //<-The name 'test3' does not exist in the current context
test4 = 7
};
}
}