-
Notifications
You must be signed in to change notification settings - Fork 0
/
SettingControl.xaml
52 lines (49 loc) · 3.09 KB
/
SettingControl.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<UserControl x:Class="Flow.Launcher.Plugin.OneTimePassword.SettingControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Flow.Launcher.Plugin.OneTimePassword" d:DataContext="{d:DesignInstance vm:SettingControlViewModel}" d:DesignWidth="650" d:DesignHeight="800" mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ListView x:Name="ListView" Grid.Row="0" Margin="18,18,18,0" BorderBrush="DarkGray" BorderThickness="1" ItemsSource="{Binding Otps, Mode=TwoWay}">
<ListView.View>
<GridView>
<GridViewColumn Width="60" Header="{DynamicResource flowlauncher_plugin_otp_editor_form_icon_label}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<Image Width="20" Height="20" Margin="6,0,0,0">
<Image.Style>
<Style TargetType="Image">
<Setter Property="Source" Value="{Binding Path=Icon}" />
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Icon}" Value="{x:Null}">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="550" Header="{DynamicResource flowlauncher_plugin_otp_editor_form_label_label}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock VerticalAlignment="Center" Text="{Binding Label}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<StackPanel Grid.Row="1" HorizontalAlignment="Right" Orientation="Horizontal">
<Button Width="100" Margin="10" Click="OnDelete" Content="{DynamicResource flowlauncher_plugin_otp_setting_delete_button}" />
<Button Width="100" Margin="10" Click="OnEdit" Content="{DynamicResource flowlauncher_plugin_otp_setting_edit_button}" />
<Button Width="100" Margin="10,10,18,10" Click="OnAdd" Content="{DynamicResource flowlauncher_plugin_otp_setting_add_button}" />
</StackPanel>
</Grid>
</UserControl>