Пример #1
0
        public UIElement(string htmlTag, bool isSvg)
        {
            Initialize();

            _gcHandle           = GCHandle.Alloc(this, GCHandleType.Weak);
            _isFrameworkElement = this is FrameworkElement;

            var type = GetType();
            var tag  = HtmlElementHelper.GetHtmlTag(type, htmlTag);

            HtmlTag = tag.Name;
            Handle  = GCHandle.ToIntPtr(_gcHandle);
            HtmlId  = Handle;
            if (isSvg)
            {
                _wasmConfig |= WasmConfig.IsSvg;
            }
            if (tag.IsExternallyDefined)
            {
                _wasmConfig |= WasmConfig.IsExternalElement;
            }

            Uno.UI.Xaml.WindowManagerInterop.CreateContent(
                htmlId: HtmlId,
                htmlTag: HtmlTag,
                handle: Handle,
                uiElementRegistrationId: UIElementNativeRegistrar.GetForType(type),
                htmlTagIsSvg: HtmlTagIsSvg,
                isFocusable: false
                );

            InitializePointers();
            UpdateHitTest();
        }
Пример #2
0
        public UIElement(string htmlTag, bool isSvg)
        {
            _log      = this.Log();
            _logDebug = _log.IsEnabled(LogLevel.Debug) ? _log : null;

            Initialize();

            _gcHandle           = GCHandle.Alloc(this, GCHandleType.Weak);
            _isFrameworkElement = this is FrameworkElement;

            HtmlTag      = GetHtmlTag(htmlTag);
            HtmlTagIsSvg = isSvg;

            var type = GetType();

            Handle = GCHandle.ToIntPtr(_gcHandle);
            HtmlId = Handle;

            Uno.UI.Xaml.WindowManagerInterop.CreateContent(
                htmlId: HtmlId,
                htmlTag: HtmlTag,
                handle: Handle,
                uiElementRegistrationId: UIElementNativeRegistrar.GetForType(type),
                htmlTagIsSvg: HtmlTagIsSvg,
                isFocusable: false
                );

            InitializePointers();
            UpdateHitTest();
        }
Пример #3
0
        public UIElement(string htmlTag = "div", bool isSvg = false)
        {
            Initialize();

            _gcHandle           = GCHandle.Alloc(this, GCHandleType.Weak);
            _isFrameworkElement = this is FrameworkElement;
            HtmlTag             = htmlTag;
            HtmlTagIsSvg        = isSvg;

            var type = GetType();

            Handle = GCHandle.ToIntPtr(_gcHandle);
            HtmlId = Handle;


            Uno.UI.Xaml.WindowManagerInterop.CreateContent(
                htmlId: HtmlId,
                htmlTag: HtmlTag,
                handle: Handle,
                uiElementRegistrationId: UIElementNativeRegistrar.GetForType(type),
                htmlTagIsSvg: HtmlTagIsSvg,
                isFocusable: false
                );

            InitializePointers();
            UpdateHitTest();
        }