void StyleScopeClose(StyleScope scope) { scope.OnDisposed -= StyleScopeClose; if (_styleGroupStack.Peek() != scope.Group) { throw new System.Exception("Unexpected style group attempting to close."); } _styleGroupStack.Pop(); }
protected StyleScope styleScope(StyleGroup styleGroup) { var scope = new StyleScope(styleGroup); scope.OnDisposed += StyleScopeClose; _styleGroupStack.Push(scope.Group); return(scope); }