static void OnStyleWidget(object obj) { if (obj is Widget w) { StyleWidget?.Invoke(w); } }
void ApplyStyles(object widget, string style) { if (widget != null && !string.IsNullOrEmpty(style)) { var styles = style.Split(' '); for (int i = 0; i < styles.Length; i++) { var currentStyle = styles[i]; var styleHandlers = GetStyleList(currentStyle); if (styleHandlers != null) { for (int j = 0; j < styleHandlers.Count; j++) { var styleHandler = styleHandlers[j]; styleHandler(widget); } } } } StyleWidget?.Invoke(widget); }