Languages

Menu
Sites
Language
Can I implement TwoButtonPopup using ElmSharp?

Can I implement TwoButtonPopup using ElmSharp?

I'm working on a Galaxy Watch widget.
The project inherited WidgetBase.

And I tried Xamarin.Forms' TwoButtonPopup.
But I received this error message.

"You MUST call Xamarin.Forms.Init(); prior to using it."
I am a beginner in creating a widget and this environment is very difficult.

The code on this site did not work.
http://tizenschool.org/tutorial/117/contents/12

Please help me.

Edited by: GwangGyu Choi on 22 Aug, 2019

Responses

1 Replies
Tizen .NET

Hi,

Yes, You can implement TwoButtonPopup using ElmSharp.

You can check out the sample code here and find the popup styles here. Also refer to the simple code below.

    public class TwoButtonPopup : Popup
    {
        Layout _layout;
        Button _leftButton;
        Button _rightButton;

        public TwoButtonPopup(EvasObject parent) : base(parent)
        {
            Style = "circle";

            _layout = new Layout(parent);
            _layout.SetTheme("layout", "popup", "content/circle/buttons2");
            _layout.Show();
            SetContent(_layout);

            _layout.SetPartText("elm.text.title", "Popup Title");
            _layout.SetPartText("elm.text", "Two Button Popup Text");

            _leftButton = new Button(parent)
            {
                Style = "popup/circle/left_delete"
            };

            _leftButton.Clicked += (s, e) =>
            {
                Console.WriteLine("left button clicked");
            };

            SetPartContent("button1", _leftButton);

            _rightButton = new Button(parent)
            {
                Style = "popup/circle/right_check"
            };

            _rightButton.Clicked += (s, e) =>
            {
                Console.WriteLine("right button clicked");
            };
            SetPartContent("button2", _rightButton);
        }
    }

Thanks.