日期:2014-05-20 浏览次数:21024 次
<UserControl x:Class="FileSaveDialogDemo.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
<Canvas x:Name="LayoutRoot" Background="White">
<Button x:Name="btnSaveFile" Width="100" Height="20"
Content="Save File" Click="btnSaveFile_Click"
Canvas.Top="10" Canvas.Left="10"></Button>
<TextBlock x:Name="tblError" Canvas.Top="40" Canvas.Left="10"></TextBlock>
</Canvas>
</UserControl>
using System;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using FileSaveDialogDemo.FilesServiceReference;
namespace FileSaveDialogDemo
{
public partial class MainPage : UserControl
{
#region Fields
private SaveFileDialog dialog;
#endregion
#region Constructors
public MainPage()
{
InitializeComponent();
this.dialog = new SaveFileDialog();