-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
168 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using CommunityToolkit.Mvvm.Input; | ||
using System.Threading.Tasks; | ||
|
||
namespace SimpleList.ViewModels | ||
{ | ||
public partial class SearchViewModel : ObservableObject | ||
{ | ||
public SearchViewModel(DriveViewModel drive) | ||
{ | ||
_drive = drive; | ||
} | ||
|
||
[RelayCommand] | ||
private async Task Search() | ||
{ | ||
if (string.IsNullOrEmpty(FileName)) | ||
return; | ||
if (Mode == SearchMode.Local) | ||
{ | ||
_drive.FilterByName(FileName); | ||
} else | ||
{ | ||
await _drive.SearchFile(FileName); | ||
} | ||
} | ||
|
||
public enum SearchMode | ||
{ | ||
Local, | ||
Global, | ||
} | ||
|
||
private readonly DriveViewModel _drive; | ||
[ObservableProperty] private string _fileName; | ||
[ObservableProperty] private SearchMode _mode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,12 @@ | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
using Microsoft.UI.Xaml.Controls.Primitives; | ||
using Microsoft.UI.Xaml.Data; | ||
using Microsoft.UI.Xaml.Input; | ||
using Microsoft.UI.Xaml.Media; | ||
using Microsoft.UI.Xaml.Navigation; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
|
||
// To learn more about WinUI, the WinUI project structure, | ||
// and more about our project templates, see: http://aka.ms/winui-project-info. | ||
|
||
namespace SimpleList.Views | ||
{ | ||
public sealed partial class RenameFileView : ContentDialog | ||
{ | ||
public RenameFileView() | ||
{ | ||
this.InitializeComponent(); | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ContentDialog | ||
x:Class="SimpleList.Views.SearchView" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:vm="using:SimpleList.ViewModels" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
x:Uid="SearchView" | ||
d:DataContext="{x:Bind vm:SearchViewModel}" | ||
PrimaryButtonText="OK" | ||
CloseButtonText="Cancel" | ||
DefaultButton="Primary" | ||
PrimaryButtonCommand="{Binding SearchCommand}"> | ||
|
||
<StackPanel> | ||
<ComboBox x:Uid="SearchView_Mode" SelectedIndex="{Binding Mode, Mode=TwoWay}" Loaded="LoadDefaultValue"> | ||
<ComboBoxItem Content="Local" /> | ||
<ComboBoxItem Content="Global" /> | ||
</ComboBox> | ||
<TextBox x:Uid="SearchView_FileName" Text="{Binding FileName, Mode=TwoWay}" /> | ||
</StackPanel> | ||
</ContentDialog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
// To learn more about WinUI, the WinUI project structure, | ||
// and more about our project templates, see: http://aka.ms/winui-project-info. | ||
|
||
namespace SimpleList.Views | ||
{ | ||
public sealed partial class SearchView : ContentDialog | ||
{ | ||
public SearchView() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void LoadDefaultValue(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) | ||
{ | ||
(sender as ComboBox).SelectedIndex = 0; | ||
} | ||
} | ||
} |