2016-06-21 07:14:32 +08:00
|
|
|
<UserControl x:Class="Wox.Plugin.WebSearch.SettingsControl"
|
2014-03-29 16:13:36 +08:00
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
2016-06-21 07:14:32 +08:00
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
xmlns:vm="clr-namespace:Wox.Plugin.WebSearch"
|
|
|
|
mc:Ignorable="d"
|
|
|
|
Background="White"
|
|
|
|
d:DataContext="{d:DesignInstance vm:SettingsViewModel}"
|
2015-01-07 18:45:55 +08:00
|
|
|
d:DesignHeight="300" d:DesignWidth="500">
|
2014-03-29 16:13:36 +08:00
|
|
|
<Grid Margin="10">
|
|
|
|
<Grid.RowDefinitions>
|
2016-06-21 07:14:32 +08:00
|
|
|
<RowDefinition Height="40" />
|
|
|
|
<RowDefinition />
|
|
|
|
<RowDefinition Height="40" />
|
2014-03-29 16:13:36 +08:00
|
|
|
</Grid.RowDefinitions>
|
2014-07-21 22:27:57 +08:00
|
|
|
<StackPanel Orientation="Horizontal" Grid.Row="0">
|
2016-06-21 07:14:32 +08:00
|
|
|
<CheckBox IsChecked="{Binding Settings.EnableSuggestion}"
|
|
|
|
Margin="0 10 10 10"
|
|
|
|
Name="EnableSuggestion"
|
|
|
|
Content="{DynamicResource wox_plugin_websearch_enable_suggestion}" />
|
|
|
|
<ComboBox ItemsSource="{Binding Settings.Suggestions}"
|
|
|
|
SelectedItem="{Binding Settings.SelectedSuggestion}"
|
2019-11-11 02:59:37 +08:00
|
|
|
IsEnabled="{Binding ElementName=EnableSuggestion, Path=IsChecked}" Margin="10,3,10,10" />
|
2016-06-21 07:14:32 +08:00
|
|
|
<!-- Not sure why binding IsEnabled directly to Settings.EnableWebSaerchSuggestion is not working -->
|
2019-11-10 17:43:40 +08:00
|
|
|
<Label Content="Open search in:" Margin="40 3 0 8"/>
|
|
|
|
<RadioButton Name="NewWindowBrowser" GroupName="OpenSearchBehaviour" Content="New window" Click="OnNewBrowserWindowClick" Margin="10" />
|
|
|
|
<RadioButton Name="NewTabInBrowser" GroupName="OpenSearchBehaviour" Content="New tab" Click="OnNewTabClick" Margin="10" />
|
2014-07-21 22:27:57 +08:00
|
|
|
</StackPanel>
|
2016-06-21 07:14:32 +08:00
|
|
|
<ListView ItemsSource="{Binding Settings.SearchSources}"
|
|
|
|
SelectedItem="{Binding Settings.SelectedSearchSource}"
|
|
|
|
Grid.Row="1">
|
2014-03-29 16:13:36 +08:00
|
|
|
<ListView.View>
|
|
|
|
<GridView>
|
2016-06-21 07:14:32 +08:00
|
|
|
<GridViewColumn Header="{DynamicResource wox_plugin_websearch_action_keyword}">
|
2014-03-29 16:13:36 +08:00
|
|
|
<GridViewColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2016-06-21 07:14:32 +08:00
|
|
|
<TextBlock Text="{Binding ActionKeyword}" />
|
2014-03-29 16:13:36 +08:00
|
|
|
</DataTemplate>
|
|
|
|
</GridViewColumn.CellTemplate>
|
|
|
|
</GridViewColumn>
|
2016-06-21 07:14:32 +08:00
|
|
|
<GridViewColumn Header="{DynamicResource wox_plugin_websearch_url}">
|
2014-03-29 16:13:36 +08:00
|
|
|
<GridViewColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2016-06-21 07:14:32 +08:00
|
|
|
<TextBlock Text="{Binding Url}" />
|
2014-03-29 16:13:36 +08:00
|
|
|
</DataTemplate>
|
|
|
|
</GridViewColumn.CellTemplate>
|
|
|
|
</GridViewColumn>
|
|
|
|
</GridView>
|
|
|
|
</ListView.View>
|
|
|
|
</ListView>
|
2014-07-21 22:27:57 +08:00
|
|
|
<StackPanel Grid.Row="2" HorizontalAlignment="Right" Orientation="Horizontal">
|
2016-06-21 07:14:32 +08:00
|
|
|
<Button Click="OnDeleteSearchSearchClick" Width="100" Margin="10"
|
|
|
|
Content="{DynamicResource wox_plugin_websearch_delete}" />
|
|
|
|
<Button Click="OnEditSearchSourceClick" Width="100" Margin="10"
|
|
|
|
Content="{DynamicResource wox_plugin_websearch_edit}" />
|
|
|
|
<Button Click="OnAddSearchSearchClick" Width="100" Margin="10"
|
|
|
|
Content="{DynamicResource wox_plugin_websearch_add}" />
|
2014-03-29 16:13:36 +08:00
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
2016-06-21 07:14:32 +08:00
|
|
|
</UserControl>
|