public Control BindingContainer {
get {
Control container = NamingContainer;
- if ((container.stateMask & BINDING_CONTAINER) == 0)
+ if (container != null && (container.stateMask & BINDING_CONTAINER) == 0)
container = container.BindingContainer;
return container;
}
protected internal bool IsViewStateEnabled
{
get {
- throw new NotImplementedException ();
+ if (Page == null)
+ return false;
+
+ for (Control control = this; control != null; control = control.Parent)
+ if (!control.EnableViewState)
+ return false;
+
+ return true;
}
}
return;
/* apply the style sheet skin here */
- if (page.StyleSheetTheme != null) {
+ if (page.StyleSheetPageTheme != null) {
ControlSkin cs = page.StyleSheetPageTheme.GetControlSkin (GetType(), SkinID);
if (cs != null)
cs.ApplySkin (this);
trace.Write ("control", String.Format ("InitRecursive {0} {1}", _userId, type_name));
}
#endif
-
if (HasControls ()) {
if ((stateMask & IS_NAMING_CONTAINER) != 0)
namingContainer = this;
stateMask |= INITING;
#if NET_2_0
+ ApplyTheme ();
+
if (Adapter != null)
Adapter.OnInit (EventArgs.Empty);
else
#if NET_2_0
internal ControlSkin controlSkin;
- internal void ApplyThemeRecursive ()
+ internal void ApplyTheme ()
{
#if MONO_TRACE
TraceContext trace = (Context != null && Context.Trace.IsEnabled) ? Context.Trace : null;
trace.Write ("control", String.Format ("ApplyThemeRecursive {0} {1}", _userId, type_name));
}
#endif
- ControlSkin controlSkin = Page.PageTheme.GetControlSkin (GetType(), SkinID);
- if (controlSkin != null)
- controlSkin.ApplySkin (this);
-
- if (HasControls ()) {
- int len = _controls.Count;
- for (int i=0;i<len;i++)
- {
- Control c = _controls[i];
- c.ApplyThemeRecursive ();
- }
+ if (Page.PageTheme != null) {
+ ControlSkin controlSkin = Page.PageTheme.GetControlSkin (GetType (), SkinID);
+ if (controlSkin != null)
+ controlSkin.ApplySkin (this);
}
#if MONO_TRACE