summaryrefslogtreecommitdiff
path: root/Noddybox.WindowsPhone.Silverlight/ViewModels/FileDialogViewModel.cs
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2012-06-27 22:49:23 +0000
committerIan C <ianc@noddybox.co.uk>2012-06-27 22:49:23 +0000
commit2c39a1ef8c13bd8d0321f79b0ce2850d0a590b45 (patch)
tree72ba36255d4aabe03c3d063f501248cc4680c79c /Noddybox.WindowsPhone.Silverlight/ViewModels/FileDialogViewModel.cs
parent1c036de8e527038f00b7ff07fc1ef4b80f23a846 (diff)
Done Save, Load and Delete dialogs.
Diffstat (limited to 'Noddybox.WindowsPhone.Silverlight/ViewModels/FileDialogViewModel.cs')
-rw-r--r--Noddybox.WindowsPhone.Silverlight/ViewModels/FileDialogViewModel.cs35
1 files changed, 34 insertions, 1 deletions
diff --git a/Noddybox.WindowsPhone.Silverlight/ViewModels/FileDialogViewModel.cs b/Noddybox.WindowsPhone.Silverlight/ViewModels/FileDialogViewModel.cs
index afc8e63..0dd7e55 100644
--- a/Noddybox.WindowsPhone.Silverlight/ViewModels/FileDialogViewModel.cs
+++ b/Noddybox.WindowsPhone.Silverlight/ViewModels/FileDialogViewModel.cs
@@ -39,6 +39,7 @@ namespace Noddybox.WindowsPhone.Silverlight.ViewModels
private string filename;
private string path;
private List<FileInfo> fileList;
+ private string mask;
#endregion
@@ -46,7 +47,7 @@ namespace Noddybox.WindowsPhone.Silverlight.ViewModels
private void GetFileList()
{
- FileList = FileInfo.GetFiles(path);
+ FileList = FileInfo.GetFiles(path, Mask);
}
#endregion
@@ -94,11 +95,42 @@ namespace Noddybox.WindowsPhone.Silverlight.ViewModels
}
}
+ /// <summary>
+ /// The file mask to use.
+ /// </summary>
+ public string Mask
+ {
+ get {return mask;}
+ set
+ {
+ SetValue(ref mask, value, "Mask");
+ Filename = String.Empty;
+ GetFileList();
+ }
+ }
+
#endregion
#region Public members
/// <summary>
+ /// Get the path of the selected file.
+ /// </summary>
+ public string SelectedFile
+ {
+ get {return path + Filename;}
+ }
+
+ /// <summary>
+ /// Refresh the current directory listing.
+ /// </summary>
+ public void RefreshFileList()
+ {
+ Filename = String.Empty;
+ GetFileList();
+ }
+
+ /// <summary>
/// Called when a file is selected.
/// </summary>
/// <param name="file">The selected file.</param>
@@ -149,6 +181,7 @@ namespace Noddybox.WindowsPhone.Silverlight.ViewModels
/// <param name="startPath">The path to start selecting from.</param>
public FileDialogViewModel(string startPath)
{
+ Mask = "*";
path = startPath;
Filename = String.Empty;
GetFileList();