Ejemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            IIO = new IOService();
            InterViewService = new InterViewerService(IIO);

            Console.WriteLine(IIO.GetDocumentDirectory());

            //練習用
            var documents = IIO.GetDocumentDirectory();

            //練習用
            var filename = Path.Combine(documents, "Write.txt");

            File.WriteAllText(filename, "Write this text into a file");

            //預設先撈範本
            //IEnumerable<string> fileOrDirectory = GetDirPngFile("Sliders");
            List <Template> fileOrDirectory = InterViewService.GetTemplates();

            //把Sliders下的.png集合發給grid

            CollectionViewInit(fileOrDirectory);

            CheckButtonIsSelected(btnTemplate);


            //Slider按鈕
            btnTemplate.TouchUpInside += (object sender, EventArgs e) =>
            {
                _AddOrEdit = _Add;
                InvokeOnMainThread(() =>
                {
                    CheckButtonIsSelected(btnTemplate);
                    //取得Sliders下的.png送給grid
                    var templates = InterViewService.GetTemplates();

                    CollectionViewInit(templates);
                });
            };
            btnDocuments.TouchUpInside += (object sender, EventArgs e) =>
            {
                _AddOrEdit = _Edit;
                InvokeOnMainThread(() =>
                {
                    CheckButtonIsSelected(btnDocuments);


                    CollectionViewInit(InterViewService.GetDocuments());
                    //CollectionViewInit(GetDirPngFile("Documents"));
                });
            };
            btnImages.TouchUpInside += (object sender, EventArgs e) =>
            {
                FileManagerController._queryMode = new QueryMode()
                {
                    status = "PNG"
                };
                InvokeOnMainThread(() =>
                {
                    PerformSegue(@"moveToFileManagerSegue", this);
                });
            };
            btnAdd.TouchUpInside += (object sender, EventArgs e) =>
            {
                FileManagerController._queryMode = new QueryMode()
                {
                    status = "PDF"
                };
                InvokeOnMainThread(() =>
                {
                    PerformSegue(@"moveToFileManagerSegue", this);
                });
            };
        }