void OnTabClick(object sender, EventArgs e)
        {
            if (TabClicked != null)
            {
                StyleTab tab = (StyleTab)sender;

                Indicator.MoveTo(tab.X);

                TabClicked(sender, e);
            }
        }
        public StyleTabBar()
        {
            BackgroundColor = Color.White;

            MyStyles        = new StyleTab();
            MyStyles.Text   = "MY STYLES";
            MyStyles.Click += OnTabClick;

            Templates        = new StyleTab();
            Templates.Text   = "TEMPLATES";
            Templates.Click += OnTabClick;

            Indicator = new StyleIndicator();
        }
Ejemplo n.º 3
0
        public void ScrollTo(StyleTab styleTab)
        {
            Device.BeginInvokeOnMainThread(delegate
            {
                double x = styleTab.X;
                double y = 0;

                if ((int)x != 0)
                {
                    x += styleTab.Width;
                }

                bool animated = true;

#if __ANDROID__
                animated = false;
#endif
                Container.ScrollToAsync(x, y, animated);
            });
        }
 public void ScrollTo(StyleTab tab)
 {
     Device.BeginInvokeOnMainThread(delegate {
         Indicator.MoveTo(tab.X);
     });
 }