mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:06:31 +00:00
better view for class distribution
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<UserControl x:Class="Azaion.Dataset.Controls.ClassDistribution"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:controls="clr-namespace:Azaion.Dataset.Controls"
|
||||
xmlns:dto="clr-namespace:Azaion.Common.DTO;assembly=Azaion.Common"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="400"
|
||||
FontFamily="Segoe UI">
|
||||
<UserControl.Resources>
|
||||
<controls:ProportionToWidthConverter x:Key="ProportionToWidthConverter"/>
|
||||
</UserControl.Resources>
|
||||
<ListView ItemsSource="{Binding Items, RelativeSource={RelativeSource AncestorType=controls:ClassDistribution}}"
|
||||
BorderThickness="0" Background="#FF333333" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="Margin" Value="0,1"/>
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type dto:ClusterDistribution}">
|
||||
<Grid Height="18" x:Name="ItemGrid"> <!-- Give the Grid a name -->
|
||||
<Border HorizontalAlignment="Left" VerticalAlignment="Stretch">
|
||||
<Border.Width>
|
||||
<MultiBinding Converter="{StaticResource ProportionToWidthConverter}">
|
||||
<Binding Path="BarWidth"/>
|
||||
<Binding Path="ActualWidth" ElementName="ItemGrid"/>
|
||||
</MultiBinding>
|
||||
</Border.Width>
|
||||
<Border.Background>
|
||||
<SolidColorBrush Color="{Binding Color}" Opacity="0.5"/>
|
||||
</Border.Background>
|
||||
</Border>
|
||||
<TextBlock Text="{Binding Label}" VerticalAlignment="Center" Margin="5,0,0,0" Foreground="White" FontSize="12"/>
|
||||
<TextBlock Text="{Binding ClassCount}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0" Foreground="White" FontSize="12"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</UserControl>
|
||||
Reference in New Issue
Block a user