Example #1
0
        void OnStyleClick(object sender, EventArgs e)
        {
            StyleListItem item = (StyleListItem)sender;

            Device.BeginInvokeOnMainThread(async delegate
            {
                await Navigation.PushAsync(new MainController(item.Data.Path, item.Data.Filename));
#if __ANDROID__
                ContentView.HideMapViews();
#endif
            });
        }
Example #2
0
        public void RenderList(List <Octokit.RepositoryContent> contents)
        {
            styleList.Clear();

            foreach (var content in contents)
            {
                var item = new StyleListItem();

                item.Click += (object sender, EventArgs e) =>
                {
                    if (ItemClick != null)
                    {
                        ItemClick(sender, e);
                    }
                };

                styleList.AddSubview(item);

                item.Update(content);
            }

            UpdateListLayout();
        }
Example #3
0
        public void ShowStyles(List <DownloadResult> results)
        {
            styleList.Clear();

            foreach (DownloadResult result in results)
            {
                var item = new StyleListItem();

                item.Click += (object sender, EventArgs e) =>
                {
                    if (ItemClick != null)
                    {
                        ItemClick(sender, e);
                    }
                };

                styleList.AddSubview(item);

                item.Update(result);
            }

            UpdateListLayout();
        }
Example #4
0
        protected override void OnElementChanged(ElementChangedEventArgs <RelativeLayout> e)
        {
            base.OnElementChanged(e);

            if (e.NewElement != null)
            {
                View = e.NewElement as StyleListItem;

#if __IOS__
                Layer.BorderWidth = View.BorderWidth;
                Layer.BorderColor = View.BorderColor.ToNativeColor().CGColor;

                if (View.Elevated)
                {
                    var path = UIKit.UIBezierPath.FromRect(Bounds);
                    Layer.MasksToBounds = false;
                    Layer.ShadowColor   = Colors.CartoNavy.ToNativeColor().CGColor;
                    Layer.ShadowOffset  = new CoreGraphics.CGSize(2.0f, 2.0f);
                    Layer.ShadowOpacity = 0.5f;
                    Layer.ShadowPath    = path.CGPath;
                }
#endif
            }
        }
Example #5
0
        public void RenderMap(DownloadResult result, int index)
        {
            StyleListItem item = Items[index];

            item.Update(result);
        }