|
15 | 15 | xmlns:behaviors="clr-namespace:Diffusion.Toolkit.Behaviors" |
16 | 16 | xmlns:system="clr-namespace:System;assembly=System.Runtime" |
17 | 17 | xmlns:mdXaml="clr-namespace:MdXaml;assembly=MdXaml" |
| 18 | + xmlns:query="clr-namespace:Diffusion.Common.Query;assembly=Diffusion.Common" |
18 | 19 | lex:LocalizeDictionary.Provider="{StaticResource LocalizationProvider}" |
19 | 20 | lex:LocalizeDictionary.Separation="." |
20 | 21 | lex:LocalizeDictionary.DefaultProvider="{StaticResource LocalizationProvider}" |
|
37 | 38 | <converters:InverseBoolToVisibilityConverter x:Key="invBoolToVisCol"></converters:InverseBoolToVisibilityConverter> |
38 | 39 | <converters:FolderModeVisibilityConverter x:Key="addrVis"></converters:FolderModeVisibilityConverter> |
39 | 40 | <converters:FilterActiveConverter x:Key="FilterActiveConverter"></converters:FilterActiveConverter> |
| 41 | + <converters:TagsModeConverter x:Key="TagsModeConverter"></converters:TagsModeConverter> |
40 | 42 | <converters:SizeConverter x:Key="SizeConverter"></converters:SizeConverter> |
41 | 43 | <converters:ZeroConverter x:Key="ZeroConverter"></converters:ZeroConverter> |
42 | 44 | <converters:NumberFormatConverter x:Key="NumberFormatConverter"></converters:NumberFormatConverter> |
|
676 | 678 | </Button> |
677 | 679 | </Grid> |
678 | 680 | </controls:AccordionControl.ButtonAreaContent> |
679 | | - <ItemsControl ItemsSource="{Binding Path=MainModel.Tags}" PreviewMouseWheel="UIElement_OnPreviewMouseWheel"> |
680 | | - <ItemsControl.ItemTemplate> |
681 | | - <DataTemplate> |
682 | | - <Grid Background="Transparent" HorizontalAlignment="Stretch" Margin="2,0,2,0"> |
683 | | - <Grid.ColumnDefinitions> |
684 | | - <ColumnDefinition Width="20"/> |
685 | | - <ColumnDefinition/> |
686 | | - </Grid.ColumnDefinitions> |
687 | | - <CheckBox VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="{Binding IsTicked}" Click="TagCheck_OnClick"></CheckBox> |
688 | | - <Button Grid.Column="1" Style="{StaticResource SmallButton}" |
| 681 | + <Grid Background="Transparent"> |
| 682 | + <Grid.RowDefinitions> |
| 683 | + <RowDefinition Height="16"/> |
| 684 | + <RowDefinition Height="*"/> |
| 685 | + </Grid.RowDefinitions> |
| 686 | + <StackPanel Orientation="Horizontal"> |
| 687 | + <RadioButton IsChecked="{Binding TagsMode, Converter={StaticResource TagsModeConverter}, ConverterParameter=AND}" GroupName="TagsMode" Margin="0,0,10,0" Content="AND"></RadioButton> |
| 688 | + <RadioButton IsChecked="{Binding TagsMode, Converter={StaticResource TagsModeConverter}, ConverterParameter=OR}" GroupName="TagsMode" Content="OR"></RadioButton> |
| 689 | + </StackPanel> |
| 690 | + <ItemsControl Grid.Row="1" ItemsSource="{Binding Path=MainModel.Tags}" PreviewMouseWheel="UIElement_OnPreviewMouseWheel"> |
| 691 | + <ItemsControl.ItemTemplate> |
| 692 | + <DataTemplate> |
| 693 | + <Grid Background="Transparent" HorizontalAlignment="Stretch" Margin="2,0,2,0"> |
| 694 | + <Grid.ColumnDefinitions> |
| 695 | + <ColumnDefinition Width="20"/> |
| 696 | + <ColumnDefinition/> |
| 697 | + </Grid.ColumnDefinitions> |
| 698 | + <CheckBox VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="{Binding IsTicked}" Click="TagCheck_OnClick"></CheckBox> |
| 699 | + <Button Grid.Column="1" Style="{StaticResource SmallButton}" |
689 | 700 | Tag="{Binding .}" |
690 | 701 | AllowDrop="True" |
691 | 702 | ToolTip="{Binding Name}" |
692 | 703 | Click="Tag_OnClick" |
693 | 704 | RenderTransformOrigin="0.179,0.476"> |
694 | | - <Button.ContextMenu> |
695 | | - <ContextMenu DataContext="{Binding Path=PlacementTarget.Tag, RelativeSource={RelativeSource Self}}"> |
696 | | - <MenuItem Header="{lex:Loc Search.Navigation.Tags.ContextMenu.Rename}" Command="{Binding Source={StaticResource Proxy}, Path=Data.RenameTagCommand}" CommandParameter="{Binding .}"></MenuItem> |
697 | | - <MenuItem Header="{lex:Loc Search.Navigation.Tags.ContextMenu.Remove}" Command="{Binding Source={StaticResource Proxy}, Path=Data.RemoveTagCommand}" CommandParameter="{Binding .}"></MenuItem> |
698 | | - </ContextMenu> |
699 | | - </Button.ContextMenu> |
700 | | - <Button.Template> |
701 | | - <ControlTemplate TargetType="{x:Type Button}"> |
702 | | - <Grid> |
703 | | - <Grid.Style> |
704 | | - <Style TargetType="Grid"> |
705 | | - <Setter Property="Background" Value="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"/> |
706 | | - <Style.Triggers> |
707 | | - <DataTrigger Binding="{Binding IsTicked}" Value="true"> |
708 | | - <Setter Property="Background" Value="{StaticResource HighlightBrush}"></Setter> |
709 | | - </DataTrigger> |
710 | | - </Style.Triggers> |
711 | | - </Style> |
712 | | - </Grid.Style> |
713 | | - <Grid.ColumnDefinitions> |
714 | | - <ColumnDefinition Width="0"></ColumnDefinition> |
715 | | - <ColumnDefinition Width="*"/> |
716 | | - <ColumnDefinition Width="70"/> |
717 | | - </Grid.ColumnDefinitions> |
718 | | - <fa:FontAwesome Icon="Filter" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="{StaticResource DisabledForegroundBrush}"></fa:FontAwesome> |
719 | | - <Label FontFamily="Calibri" FontWeight="Light" FontSize="16" Padding="4" Grid.Column="1" Content="{Binding Name, Converter={StaticResource UnderlineConverter}}"></Label> |
720 | | - <Label FontFamily="Calibri" FontWeight="Light" FontSize="16" Padding="4" Grid.Column="2" Content="{Binding TagCount, Converter={StaticResource NumberFormatConverter}}" HorizontalAlignment="Right"></Label> |
721 | | - </Grid> |
722 | | - </ControlTemplate> |
723 | | - </Button.Template> |
724 | | - </Button> |
725 | | - </Grid> |
726 | | - </DataTemplate> |
727 | | - </ItemsControl.ItemTemplate> |
728 | | - <ItemsControl.ItemsPanel> |
729 | | - <ItemsPanelTemplate> |
730 | | - <StackPanel Orientation="Vertical"/> |
731 | | - </ItemsPanelTemplate> |
732 | | - </ItemsControl.ItemsPanel> |
733 | | - </ItemsControl> |
| 705 | + <Button.ContextMenu> |
| 706 | + <ContextMenu DataContext="{Binding Path=PlacementTarget.Tag, RelativeSource={RelativeSource Self}}"> |
| 707 | + <MenuItem Header="{lex:Loc Search.Navigation.Tags.ContextMenu.Rename}" Command="{Binding Source={StaticResource Proxy}, Path=Data.RenameTagCommand}" CommandParameter="{Binding .}"></MenuItem> |
| 708 | + <MenuItem Header="{lex:Loc Search.Navigation.Tags.ContextMenu.Remove}" Command="{Binding Source={StaticResource Proxy}, Path=Data.RemoveTagCommand}" CommandParameter="{Binding .}"></MenuItem> |
| 709 | + </ContextMenu> |
| 710 | + </Button.ContextMenu> |
| 711 | + <Button.Template> |
| 712 | + <ControlTemplate TargetType="{x:Type Button}"> |
| 713 | + <Grid> |
| 714 | + <Grid.Style> |
| 715 | + <Style TargetType="Grid"> |
| 716 | + <Setter Property="Background" Value="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"/> |
| 717 | + <Style.Triggers> |
| 718 | + <DataTrigger Binding="{Binding IsTicked}" Value="true"> |
| 719 | + <Setter Property="Background" Value="{StaticResource HighlightBrush}"></Setter> |
| 720 | + </DataTrigger> |
| 721 | + </Style.Triggers> |
| 722 | + </Style> |
| 723 | + </Grid.Style> |
| 724 | + <Grid.ColumnDefinitions> |
| 725 | + <ColumnDefinition Width="0"></ColumnDefinition> |
| 726 | + <ColumnDefinition Width="*"/> |
| 727 | + <ColumnDefinition Width="70"/> |
| 728 | + </Grid.ColumnDefinitions> |
| 729 | + <fa:FontAwesome Icon="Filter" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="{StaticResource DisabledForegroundBrush}"></fa:FontAwesome> |
| 730 | + <Label FontFamily="Calibri" FontWeight="Light" FontSize="16" Padding="4" Grid.Column="1" Content="{Binding Name, Converter={StaticResource UnderlineConverter}}"></Label> |
| 731 | + <Label FontFamily="Calibri" FontWeight="Light" FontSize="16" Padding="4" Grid.Column="2" Content="{Binding TagCount, Converter={StaticResource NumberFormatConverter}}" HorizontalAlignment="Right"></Label> |
| 732 | + </Grid> |
| 733 | + </ControlTemplate> |
| 734 | + </Button.Template> |
| 735 | + </Button> |
| 736 | + </Grid> |
| 737 | + </DataTemplate> |
| 738 | + </ItemsControl.ItemTemplate> |
| 739 | + <ItemsControl.ItemsPanel> |
| 740 | + <ItemsPanelTemplate> |
| 741 | + <StackPanel Orientation="Vertical"/> |
| 742 | + </ItemsPanelTemplate> |
| 743 | + </ItemsControl.ItemsPanel> |
| 744 | + </ItemsControl> |
| 745 | + </Grid> |
734 | 746 | </controls:AccordionControl> |
735 | 747 |
|
736 | 748 | <controls:AccordionControl |
|
924 | 936 | </DataTrigger> |
925 | 937 | </Style.Triggers> |
926 | 938 | </Style> |
927 | | - |
| 939 | + |
928 | 940 | </Grid.Style> |
929 | 941 | <Grid.RowDefinitions> |
930 | 942 | <RowDefinition Height="*"/> |
|
0 commit comments