Interaction logic for TilesetImageImportDialog.xaml
상속: 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);
            }
        }
        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;
        }