private void Save_Click(object sender, RoutedEventArgs e) { SaveFileDialog saveDialog = new System.Windows.Forms.SaveFileDialog { AddExtension = true, Filter = "(*.txt)|*.txt|Все файлы (*.*)|*.* " }; if (saveDialog.ShowDialog() == DialogResult.OK) { using (FileStream fs = new FileStream(saveDialog.FileName, FileMode.OpenOrCreate, FileAccess.Write)) { FlowDocument flow = new FlowDocument(); flow = ChequeBuilder.GetCheque(); TextRange textRange = new TextRange(flow.ContentStart, flow.ContentEnd); textRange.Save(fs, System.Windows.DataFormats.Text); } } }
public ChequePage() { InitializeComponent(); this.Scroll.Document = ChequeBuilder.GetCheque(); }