Skip to content

Instantly share code, notes, and snippets.

@MilenPavlov
MilenPavlov / gist:a73a401d6299c02cc329
Last active July 19, 2017 09:14
Xamarin iOS – Create custom TreeView control for iPad / iPhone
This example uses Storyboards and iPad app. We have few entities here the TreeViewController (also holding the TreeViewSource delegate and my TreeNode Class) and TreeViewCell where I’m adding UIViews programatically.
Code as follows:
1) TreeViewController class:
public partial class TvViewController : UIViewController
{
public TvViewController(IntPtr handle) : base(handle)
@MilenPavlov
MilenPavlov / gist:84fb89e04f735c90874c
Created April 9, 2015 08:08
Using new async Google Maps in Xamarin Android
//_mapFragment.Map is now obsolete with latest Google Play services.. new approach is needed...
private void SetUpMap()
{
_mapFragment = FragmentManager.FindFragmentByTag("map") as MapFragment;
if (_mapFragment == null)
{
GoogleMapOptions mapOptions = new GoogleMapOptions()
.InvokeMapType(GoogleMap.MapTypeHybrid)
.InvokeZoomControlsEnabled(true)
.InvokeCompassEnabled(true);
@MilenPavlov
MilenPavlov / gist:98e210e3ffe1fbe4ecd9
Last active September 14, 2020 10:42
ContentObserver for Xamarin Android Photos using MediaStore.IntentActionStillImageCamera
//PhotoObserver.cs
public class Media
{
public System.DateTime Added { get; set; }
public File File { get; set; }
public System.DateTime Modified { get; set; }
public string Type { get; set; }
public override string ToString()
Snippet Name: iOS Utils
Platform: Xamarin.iOS
Function: Check if running iOS 8, is phone, is tall, and envoke on UI Thread
Snippet:
public static class Utils
{
public static NSObject Invoker;