Exemplo n.º 1
0
        public override IView ConvertToView(FigmaNode currentNode, ViewNode parent, ViewRenderService rendererService)
        {
            string text = string.Empty;

            if (currentNode is IFigmaNodeContainer container)
            {
                var figmaText = container.children
                                .OfType <FigmaText>()
                                .FirstOrDefault();

                if (figmaText != null)
                {
                    text = figmaText.characters;
                }
            }

            IView msLogoView = null;

            if (rendererService is ViewRenderService viewRendererService)
            {
                msLogoView = viewRendererService.RenderByName <IView>(LogoImageName, null);
            }

            var flatButton = new FixedFlatButton(text, msLogoView.NativeObject as NSView);

            IButton button = TransitionHelper.CreateButtonFromFigmaNode(flatButton, currentNode);

            return(button);
        }
        public override IView ConvertToView(FigmaNode currentNode, ViewNode parent, ViewRenderService rendererService)
        {
            string text = string.Empty;

            if (currentNode is IFigmaNodeContainer container)
            {
                var figmaText = container.children.OfType <FigmaText>().FirstOrDefault();
                if (figmaText != null)
                {
                    text = figmaText.characters;
                }
            }

            var flatButton = new FixedFlatButton(text);
            var button     = TransitionHelper.CreateButtonFromFigmaNode(flatButton, currentNode);

            return(button);
        }