Rect,在哪里?

Sin*_*atr 1 c# rect

这让我疯狂,然后创建新的控制台应用程序项目

// adding it as reference of course
using System.Windows;

// somewhere in method
var rect = new Rect(1, 2, 3, 4); // no Rect
Run Code Online (Sandbox Code Playgroud)

找不到类型或命名空间名称"Rect"(您是否缺少using指令或程序集引用?)

会发生什么事Rect

Ham*_*jam 8

您应该添加WindowsBase.dll作为项目的参考.