Working up/down arrow key

This commit is contained in:
Divyansh
2020-04-03 14:45:02 -07:00
parent 293a8a8199
commit 1a15a062ef
3 changed files with 26 additions and 40 deletions

View File

@@ -415,10 +415,9 @@
<Grid>
<Grid x:Name="ShadowReceiverGrid"/>
<Grid x:Name="PowerBar" CornerRadius="4" Height="72" Background="{StaticResource BackdropAcrylicBrush}" Translation="0,0,16" Shadow="{StaticResource ShellBarShadow}" Margin="12" VerticalAlignment="Top" HorizontalAlignment="Center" MinWidth="240">
<AutoSuggestBox x:Name="SearchBox" x:FieldModifier="public" PlaceholderText="Launch an app" FontSize="24" Style="{StaticResource CustomStyledAutoSuggestBox}" MinWidth="720"
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ItemsSource="{Binding Results.Results}">
<AutoSuggestBox x:Name="SearchBox" x:FieldModifier="public" PlaceholderText="Launch an app" FontSize="24" Style="{StaticResource CustomStyledAutoSuggestBox}"
MinWidth="720"
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ItemsSource="{Binding Results.Results}">
<AutoSuggestBox.QueryIcon>
<SymbolIcon Symbol="Find"/>
</AutoSuggestBox.QueryIcon>
@@ -443,7 +442,7 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Image x:Name="AppIcon" Height="36" Margin="8,0,0,0" Grid.RowSpan="2" HorizontalAlignment="Left" Source="{Binding Image}"/>
<Image x:Name="AppIcon" Height="36" Margin="8,0,0,0" Grid.RowSpan="2" HorizontalAlignment="Left" />
<TextBlock x:Name="Title" Grid.Column="1" Text="{Binding Result.Title}" FontWeight="SemiBold" FontSize="20" VerticalAlignment="Bottom"/>
<TextBlock x:Name="Path" Grid.Column="1" Text="C:\Program Files\WindowsApps\Microsoft\Folder " Grid.Row="1" Opacity="0.6" VerticalAlignment="Top"/>
<StackPanel Orientation="Horizontal" Opacity="0" HorizontalAlignment="Right" Grid.RowSpan="2" Grid.Column="1">

View File

@@ -1,17 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace PowerLauncher.UI
{
@@ -20,7 +7,7 @@ namespace PowerLauncher.UI
public LauncherControl()
{
this.InitializeComponent();
ShellBarShadow.Receivers.Add(ShadowReceiverGrid);
ShellBarShadow.Receivers.Add(ShadowReceiverGrid);
}
}
}
}

View File

@@ -260,26 +260,26 @@ namespace PowerLauncher
_launcher = (PowerLauncher.UI.LauncherControl)host.Child;
_launcher.DataContext = _viewModel;
_launcher.SearchBox.TextChanged += QueryTextBox_TextChanged;
_launcher.SearchBox.SuggestionChosen += SearchBox_SuggestionChosen;
_launcher.SearchBox.Focus(Windows.UI.Xaml.FocusState.Programmatic);
//_launcher.SearchBox.SuggestionChosen += SearchBox_SuggestionChosen;
//_launcher.SearchBox.Focus(Windows.UI.Xaml.FocusState.Programmatic);
_viewModel.PropertyChanged += (o, e) =>
{
if (e.PropertyName == nameof(MainViewModel.MainWindowVisibility))
{
if (Visibility == System.Windows.Visibility.Visible)
{
Activate();
_launcher.SearchBox.Focus(Windows.UI.Xaml.FocusState.Programmatic);
UpdatePosition();
_settings.ActivateTimes++;
if (!_viewModel.LastQuerySelected)
{
_viewModel.LastQuerySelected = true;
}
}
}
};
//_viewModel.PropertyChanged += (o, e) =>
//{
// if (e.PropertyName == nameof(MainViewModel.MainWindowVisibility))
// {
// if (Visibility == System.Windows.Visibility.Visible)
// {
// Activate();
// _launcher.SearchBox.Focus(Windows.UI.Xaml.FocusState.Programmatic);
// UpdatePosition();
// _settings.ActivateTimes++;
// if (!_viewModel.LastQuerySelected)
// {
// _viewModel.LastQuerySelected = true;
// }
// }
// }
//};
}
private void SearchBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args)
@@ -295,7 +295,7 @@ namespace PowerLauncher
{
Console.WriteLine("here");
}
}
}
}
private void QueryTextBox_TextChanged(Windows.UI.Xaml.Controls.AutoSuggestBox sender, Windows.UI.Xaml.Controls.AutoSuggestBoxTextChangedEventArgs args)