コード例 #1
0
        private void OnImageSelectButtonClicked(object sender, EventArgs args)
        {
            FileChooserDialog fileChooser = new FileChooserDialog(
                "Choose an image file to open",
                this,
                FileChooserAction.Open,
                "Cancel", ResponseType.Cancel,
                "Open", ResponseType.Accept);
            var filter = new FileFilter();

            filter.Name = "Images";
            filter.AddMimeType("image/*");
            fileChooser.AddFilter(filter);
            if (fileChooser.Run() == (int)ResponseType.Accept)
            {
                _model.ImageUri = new Uri(fileChooser.Filename);
                RenderBaseImagePreview();
                RenderKaleidoscope();
            }
            fileChooser.Destroy();
            filter.Destroy();
        }