Cannot hit one when search like "c# new followed by square braces", etc:
var dialog = new ABCDialog{
Title = xxxx,
Content = ...
};
dialog.Buttons = new[] { dialog.OkButton };
Buttons are like IEnumerable Buttons {get;set;} OkButton is a getter.
Thanks!
This is an array initialization syntax. You're creating a new array that looks like: Button[]
with one item dialog.OkButton
inside of it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.