-
Notifications
You must be signed in to change notification settings - Fork 86
global element
RobertTheGrey edited this page Jan 12, 2013
·
1 revision
Declares a property that's available to all templates while rendering.
<global x="a" y="b" />Results in C#:
object _x = a;
public object x {get {return _x;} set {_x = value;}}
object _y = b;
public object y {get {return _y;} set {_y = value;}}Although object seems like an inconvenient type, it works quite well when used in simple value assignments like <set x="42"/> and expression output like ${x}.
<global x="a" y="b" type="T"/>Results in C#:
T _x = a;
public T x {get {return _x;} set {_x = value;}}
T _y = b;
public T y {get {return _y;} set {_y = value;}}