Interaction logic for TilesetImageImportDialog.xaml
Inheritance: System.Windows.Window
コード例 #1
0
        private void AddImage(List<WriteableBitmap> tempTiles, BitmapSource image, string path)
        {
            var boxModel = new TilesetImageImportDialogViewModel(path);
            var box = new TilesetImageImportDialog();
            box.DataContext = boxModel;
            box.ShowDialog();

            if (box.Result == System.Windows.MessageBoxResult.OK)
            {
                ExtractImage(tempTiles, image, boxModel.Spacing, boxModel.Offset);
            }
        }
コード例 #2
0
        private TilesetImageImportDialogViewModel PromptImage(BitmapSource image, string path)
        {
            var boxModel = new TilesetImageImportDialogViewModel(path);
            var box = new TilesetImageImportDialog();
            box.DataContext = boxModel;
            box.ShowDialog();

            if (box.Result == System.Windows.MessageBoxResult.OK)
                return boxModel;
            else
                return null;
        }