protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); //Intent intent = Intent; string action = Intent.Action; string type = Intent.Type; global::Xamarin.Forms.Forms.Init(this, bundle); var app = new MrkViewerApp(); if (Intent.ActionView.Equals(action) && !String.IsNullOrEmpty(type)) { Android.Net.Uri fileUri = (Android.Net.Uri)Intent.Data; if (fileUri != null) { var fileContent = File.ReadAllText(fileUri.Path); var name = fileUri.LastPathSegment; app.SetExternDocument(new Core.Services.MarkdownFile() { FileName = name, Content = fileContent }); } } LoadApplication(app); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); _app = new MrkViewerApp(); LoadApplication(_app); // https://dzone.com/articles/ios-file-association-preview return(base.FinishedLaunching(app, options)); }
public MainPage() { this.InitializeComponent(); app = new MrkViewerApp(); LoadApplication(app); }