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 }); }
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(); }
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(); }
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 } }
public void RenderMap(DownloadResult result, int index) { StyleListItem item = Items[index]; item.Update(result); }