Updated bindings for launcher

This commit is contained in:
Divyansh
2020-03-30 16:27:26 -07:00
parent 6cc00a5a0f
commit 6dd13e4939
2 changed files with 4 additions and 12 deletions

View File

@@ -417,7 +417,8 @@
<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}" TextChanged="SearchBox_TextChanged" MinWidth="720" >
<AutoSuggestBox x:Name="SearchBox" x:FieldModifier="public" PlaceholderText="Launch an app" FontSize="24" Style="{StaticResource CustomStyledAutoSuggestBox}" MinWidth="720"
ItemsSource="{Binding Results.Results}" >
<AutoSuggestBox.QueryIcon>
<SymbolIcon Symbol="Find"/>
</AutoSuggestBox.QueryIcon>
@@ -442,8 +443,8 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Image x:Name="AppIcon" Source="{Binding Icon}" Height="36" Margin="8,0,0,0" Grid.RowSpan="2" HorizontalAlignment="Left" />
<TextBlock x:Name="Title" Grid.Column="1" Text="{Binding Title}" FontWeight="SemiBold" FontSize="20" VerticalAlignment="Bottom"/>
<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">
<Interactivity:Interaction.Behaviors>

View File

@@ -52,15 +52,6 @@ namespace PowerLauncher.UI
new SearchApp() { Title = "Yammer", Icon = "ms-appx:///Assets/Images/Yammer.png" }
};
}
private void SearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
{
if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
{
var Suggestion = SearchResults.Where(p => p.Title.StartsWith(sender.Text, StringComparison.OrdinalIgnoreCase)).ToArray();
sender.ItemsSource = Suggestion;
}
}
}