private new void Initialize()
        {
            // FIXME this should not be handled using Events.AddHandler, since those handlers are removable via the plugin

            // hook up the TemplateApplied callback so we
            // can notify controls when their template has
            // been instantiated as a visual tree.
            Events.AddHandler(this, EventIds.FrameworkElement_TemplateAppliedEvent, template_applied);
            Events.AddOnEventHandler(this, EventIds.UIElement_LoadedEvent, invoke_loaded_cb);

            MeasureOverrideCallback      measure              = null;
            ArrangeOverrideCallback      arrange              = null;
            GetDefaultTemplateCallback   getTemplate          = null;
            StyleResourceChangedCallback styleResourceChanged = null;

            if (OverridesLayoutMethod("MeasureOverride"))
            {
                measure = FrameworkElement.measure_cb;
            }
            if (OverridesLayoutMethod("ArrangeOverride"))
            {
                arrange = FrameworkElement.arrange_cb;
            }
            if (OverridesGetDefaultTemplate())
            {
                getTemplate = FrameworkElement.get_default_template_cb;
            }
            styleResourceChanged = FrameworkElement.style_resource_changed_cb;

            NativeMethods.framework_element_register_managed_overrides(native, measure, arrange, getTemplate, styleResourceChanged);
        }
Beispiel #2
0
		private new void Initialize ()
		{
			// FIXME this should not be handled using Events.AddHandler, since those handlers are removable via the plugin

			// hook up the TemplateApplied callback so we
			// can notify controls when their template has
			// been instantiated as a visual tree.
			Events.AddHandler (this, EventIds.FrameworkElement_TemplateAppliedEvent, template_applied);

			if (OverridesLayoutMethod ("MeasureOverride"))
				measure_cb = new MeasureOverrideCallback (InvokeMeasureOverride);
			if (OverridesLayoutMethod ("ArrangeOverride"))
				arrange_cb = new ArrangeOverrideCallback (InvokeArrangeOverride);
			if (OverridesGetDefaultTemplate ())
				get_default_template_cb = InvokeGetDefaultTemplate;
			loaded_hook_cb = InvokeLoadedHook;
			NativeMethods.framework_element_register_managed_overrides (native, measure_cb, arrange_cb, get_default_template_cb, loaded_hook_cb);
		}