| 1 | <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | xmlns:local="clr-namespace:UI.Controls.Charts" |
| 4 | xmlns:base="clr-namespace:UI.Controls.Base" xmlns:converter="clr-namespace:UI.Controls.Converters"> |
| 5 | <converter:HextoColorConverter x:Key="HextoColorConverter"/> |
| 6 | |
| 7 | <Style TargetType="{x:Type local:ChartsItemTypeList}"> |
| 8 | <Setter Property="SnapsToDevicePixels" |
| 9 | Value="true" /> |
| 10 | <Setter Property="FocusVisualStyle" Value="{x:Null}"/> |
| 11 | <Setter Property="Background" Value="Transparent"/> |
| 12 | <Setter Property="Margin" Value="0,5"/> |
| 13 | |
| 14 | <Setter Property="Template"> |
| 15 | <Setter.Value> |
| 16 | <ControlTemplate TargetType="{x:Type local:ChartsItemTypeList}"> |
| 17 | |
| 18 | <Grid Background="{TemplateBinding Background}"> |
| 19 | <Grid x:Name="Normal"> |
| 20 | <Grid.ColumnDefinitions> |
| 21 | <ColumnDefinition Width="auto"/> |
| 22 | <ColumnDefinition Width="*"/> |
| 23 | </Grid.ColumnDefinitions> |
| 24 | <Border Margin="0,0,10,0" x:Name="IconBorder" BorderBrush="Transparent" BorderThickness="2" Background="{DynamicResource ListItemIconBgBrush}" CornerRadius="6" Width="50" Height="50" HorizontalAlignment="Left"> |
| 25 | <Image x:Name="IconObj" Width="{TemplateBinding IconSize}" Height="{TemplateBinding IconSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
| 26 | </Border> |
| 27 | |
| 28 | <StackPanel Grid.Column="1" x:Name="ValueContainer" VerticalAlignment="Center" > |
| 29 | <Grid> |
| 30 | <Grid.ColumnDefinitions> |
| 31 | <ColumnDefinition Width="auto"/> |
| 32 | <ColumnDefinition Width="auto"/> |
| 33 | </Grid.ColumnDefinitions> |
| 34 | <TextBlock x:Name="NameTextObj" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ChartsItemTypeList}}, Path=Data.Name}" Foreground="{DynamicResource DefaultTextBrush}" HorizontalAlignment="Left" VerticalAlignment="Center" /> |
| 35 | |
| 36 | <ListView x:Name="BadgeListView" Visibility="Collapsed" Grid.Column="1" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ChartsItemTypeList}}, Path=Data.BadgeList}" Margin="0,0,0,0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" > |
| 37 | |
| 38 | <ListBox.Resources> |
| 39 | <Style TargetType="{x:Type ListView}"> |
| 40 | <Setter Property="OverridesDefaultStyle" Value="True"/> |
| 41 | |
| 42 | <Setter Property="Template"> |
| 43 | <Setter.Value> |
| 44 | <ControlTemplate TargetType="{x:Type ListView}"> |
| 45 | <Border> |
| 46 | <ItemsPresenter /> |
| 47 | </Border> |
| 48 | </ControlTemplate> |
| 49 | </Setter.Value> |
| 50 | </Setter> |
| 51 | </Style> |
| 52 | <Style TargetType="{x:Type ListViewItem}"> |
| 53 | <Setter Property="OverridesDefaultStyle" Value="True"/> |
| 54 | <Setter Property="Foreground" Value="White"/> |
| 55 | |
| 56 | <Setter Property="Template"> |
| 57 | <Setter.Value> |
| 58 | <ControlTemplate TargetType="{x:Type ListViewItem}"> |
| 59 | <Border BorderBrush="Transparent" BorderThickness="2" x:Name="Border" Background="{Binding Color,Converter={StaticResource HextoColorConverter}}" Margin="5,0,0,0" Padding="6,4" CornerRadius="6"> |
| 60 | <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/> |
| 61 | </Border> |
| 62 | <ControlTemplate.Triggers> |
| 63 | </ControlTemplate.Triggers> |
| 64 | </ControlTemplate> |
| 65 | </Setter.Value> |
| 66 | </Setter> |
| 67 | |
| 68 | </Style> |
| 69 | </ListBox.Resources> |
| 70 | <ListBox.ItemsPanel> |
| 71 | <ItemsPanelTemplate> |
| 72 | <WrapPanel/> |
| 73 | </ItemsPanelTemplate> |
| 74 | </ListBox.ItemsPanel> |
| 75 | <ListView.ItemTemplate> |
| 76 | <DataTemplate> |
| 77 | |
| 78 | <WrapPanel Orientation="Horizontal"> |
| 79 | <Border > |
| 80 | <TextBlock Text="{Binding Name}" FontSize="10"/> |
| 81 | </Border> |
| 82 | |
| 83 | </WrapPanel> |
| 84 | |
| 85 | </DataTemplate> |
| 86 | </ListView.ItemTemplate> |
| 87 | </ListView> |
| 88 | |
| 89 | |
| 90 | </Grid> |
| 91 | <StackPanel Orientation="Horizontal" > |
| 92 | <Rectangle |
| 93 | x:Name="ValueBlockObj" |
| 94 | RadiusX="4" |
| 95 | RadiusY="4" |
| 96 | Fill="{DynamicResource ChartTypeListProgressBarBrush}" |
| 97 | Height="8" |
| 98 | VerticalAlignment="Center" |
| 99 | HorizontalAlignment="Left" |
| 100 | /> |
| 101 | |
| 102 | <TextBlock x:Name="ValueTextObj" VerticalAlignment="Center" Foreground="{DynamicResource SubTextBrush}" FontSize="12" Margin="5,0,0,0"/> |
| 103 | </StackPanel> |
| 104 | </StackPanel> |
| 105 | |
| 106 | </Grid> |
| 107 | |
| 108 | <Grid x:Name="Loading" Visibility="Collapsed"> |
| 109 | <Grid.ColumnDefinitions> |
| 110 | <ColumnDefinition Width="auto"/> |
| 111 | <ColumnDefinition Width="*"/> |
| 112 | </Grid.ColumnDefinitions> |
| 113 | <base:Placeholder Margin="0,0,10,0" CornerRadius="6" Width="50" Height="50" HorizontalAlignment="Left"/> |
| 114 | <StackPanel Grid.Column="1" VerticalAlignment="Center" > |
| 115 | <base:Placeholder Width="100" Height="12" HorizontalAlignment="Left" Margin="0,0,0,6"/> |
| 116 | <Rectangle |
| 117 | RadiusX="0" |
| 118 | RadiusY="0" |
| 119 | Fill="{DynamicResource PlaceholderRectBgBrush}" |
| 120 | Height="8" |
| 121 | VerticalAlignment="Center" |
| 122 | HorizontalAlignment="Stretch" |
| 123 | /> |
| 124 | </StackPanel> |
| 125 | </Grid> |
| 126 | |
| 127 | <VisualStateManager.VisualStateGroups> |
| 128 | <VisualStateGroup x:Name="CommonStates"> |
| 129 | <VisualStateGroup.Transitions> |
| 130 | <VisualTransition GeneratedDuration="0:0:.3" /> |
| 131 | <VisualTransition GeneratedDuration="0" |
| 132 | To="Pressed" /> |
| 133 | </VisualStateGroup.Transitions> |
| 134 | <VisualState x:Name="NormalState" /> |
| 135 | <VisualState x:Name="MouseOver"> |
| 136 | <Storyboard > |
| 137 | <ColorAnimation Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" |
| 138 | Storyboard.TargetName="NameTextObj" To="{DynamicResource ThemeColor}" > |
| 139 | <ColorAnimation.EasingFunction> |
| 140 | <CubicEase EasingMode="EaseInOut"/> |
| 141 | </ColorAnimation.EasingFunction> |
| 142 | </ColorAnimation> |
| 143 | <ColorAnimation Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" |
| 144 | Storyboard.TargetName="ValueTextObj" To="{DynamicResource ThemeColor}" > |
| 145 | <ColorAnimation.EasingFunction> |
| 146 | <CubicEase EasingMode="EaseInOut"/> |
| 147 | </ColorAnimation.EasingFunction> |
| 148 | </ColorAnimation> |
| 149 | <ColorAnimation Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)" |
| 150 | Storyboard.TargetName="ValueBlockObj" To="{DynamicResource ThemeColor}" > |
| 151 | <ColorAnimation.EasingFunction> |
| 152 | <CubicEase EasingMode="EaseIn"/> |
| 153 | </ColorAnimation.EasingFunction> |
| 154 | </ColorAnimation> |
| 155 | <ColorAnimation Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" |
| 156 | Storyboard.TargetName="IconBorder" To="{DynamicResource ThemeColor}" > |
| 157 | <ColorAnimation.EasingFunction> |
| 158 | <CubicEase EasingMode="EaseIn"/> |
| 159 | </ColorAnimation.EasingFunction> |
| 160 | </ColorAnimation> |
| 161 | <ColorAnimation Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" |
| 162 | Storyboard.TargetName="IconBorder" To="{DynamicResource HoverBackgroundColor}" > |
| 163 | <ColorAnimation.EasingFunction> |
| 164 | <CubicEase EasingMode="EaseIn"/> |
| 165 | </ColorAnimation.EasingFunction> |
| 166 | </ColorAnimation> |
| 167 | </Storyboard> |
| 168 | </VisualState> |
| 169 | <VisualState x:Name="Pressed"> |
| 170 | |
| 171 | </VisualState> |
| 172 | </VisualStateGroup> |
| 173 | </VisualStateManager.VisualStateGroups> |
| 174 | </Grid> |
| 175 | |
| 176 | |
| 177 | |
| 178 | <ControlTemplate.Triggers> |
| 179 | <Trigger Property="IsLoading" Value="True"> |
| 180 | <Setter TargetName="Loading" Property="Visibility" Value="Visible"/> |
| 181 | <Setter TargetName="Normal" Property="Visibility" Value="Hidden"/> |
| 182 | </Trigger> |
| 183 | <Trigger Property="IsShowBadge" Value="True"> |
| 184 | <Setter TargetName="BadgeListView" Property="Visibility" Value="Visible"/> |
| 185 | </Trigger> |
| 186 | </ControlTemplate.Triggers> |
| 187 | </ControlTemplate> |
| 188 | </Setter.Value> |
| 189 | </Setter> |
| 190 | </Style> |
| 191 | </ResourceDictionary> |