Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
 public MainPage()
 {
     this.InitializeComponent();
     app = new MrkViewerApp();
     LoadApplication(app);
 }