|
using System.IO;
using Microsoft.Win32;
using RehostedDesigner.Designer.ViewModels.Contracts;
namespace RehostedDesigner.FileSystemManagerModule
{
public class StandardFileSystemManagerViewModel
{
readonly IDesignerViewModel _designerViewModel;
public StandardFileSystemManagerViewModel(IDesignerViewModel designerViewModel)
{
this._designerViewModel = designerViewModel;
}
public RelayCommand ExportCommand
{
get
{
return new RelayCommand(obj =>
{
var surface = (IDesignerSurface)this._designerViewModel.CurrentSurface;
surface.Designer.Flush();
var dlg = new SaveFileDialog {FileName = "Workflow", Filter = "XAML Dateien (.xaml)|*.xaml"};
if (dlg.ShowDialog().GetValueOrDefault())
{
using (var fs = new FileStream(dlg.FileName, FileMode.Create, FileAccess.Write))
{
using (var sw = new StreamWriter(fs))
{
sw.Write(surface.Designer.Text);
sw.Flush();
}
}
}
}, obj => this._designerViewModel.CurrentSurface is IDesignerSurface);
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.