Samsung / Tizen.CircularUI

Tizen Wearable CircularUI project is to develop an open source software motivate software developer to creating Tizen Wearable Xamarin Forms app more easily and efficiently.
Other
80 stars 32 forks source link

Can not programmatically change displayed page in IndexPage. #284

Closed patuwwy closed 4 years ago

patuwwy commented 4 years ago

Describe the bug Can not programmatically change displayed page in IndexPage.

To Reproduce Steps to reproduce the behavior:

I am trying to set page2 as active at start.

public void ShowTopNavigation()
        {
            IndexPage indexPage = new IndexPage();

            ContentPage page1 = new ContentPage();
            ContentPage page2 = new ContentPage();
            ContentPage page3 = new ContentPage();

            indexPage.Children.Add(page1);
            indexPage.Children.Add(page2);
            indexPage.Children.Add(page3);

            indexPage.CurrentPage = page2;

            Application.Current.MainPage = indexPage;
        }

page1 is displayed, top indicator has first element active

Expected behavior Second page should be displayed.

Environment (please complete the following information):

myroot commented 4 years ago

Thanks for reporting issue, We have issue on update CurrentPage on initialize time We will fix this issue, but you can also fix early with workaround code like below

        public void ShowTopNavigation()
        {
            IndexPage indexPage = new IndexPage();

            ContentPage page1 = new ContentPage();
            ContentPage page2 = new ContentPage();
            ContentPage page3 = new ContentPage();

            indexPage.Children.Add(page1);
            indexPage.Children.Add(page2);
            indexPage.Children.Add(page3);
            Device.BeginInvokeOnMainThread(() =>
            {
                 indexPage.CurrentPage = page2;                
            });

            Application.Current.MainPage = indexPage;
        }
patuwwy commented 4 years ago

Thanks for reporting issue, We have issue on update CurrentPage on initialize time We will fix this issue, but you can also fix early with workaround code like below

Thanks!