MeasurementCard.xaml
<UserControl x:Class="pscommander.MeasurementCard"
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:local="clr-namespace:pscommander" xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" mc:Ignorable="d" d:DesignHeight="500" d:DesignWidth="800" Background="Transparent"> <Grid> <Grid> <Grid.Effect> <DropShadowEffect BlurRadius="15" Direction="-90" RenderingBias="Quality" Opacity=".2" ShadowDepth="1"/> </Grid.Effect> <Grid.OpacityMask> <VisualBrush Visual="{Binding ElementName=Border1}" /> </Grid.OpacityMask> <Grid.Resources> <Style TargetType="lvc:LineSeries"> <Setter Property="StrokeThickness" Value="3"></Setter> <Setter Property="Stroke" Value="{Binding Stroke}"></Setter> <Setter Property="Fill" Value="{Binding Fill}"></Setter> <Setter Property="PointGeometrySize" Value="0"></Setter> <Setter Property="LineSmoothness" Value="0"></Setter> </Style> <Style TargetType="lvc:Axis"> <Setter Property="ShowLabels" Value="False"></Setter> <Setter Property="IsEnabled" Value="False"></Setter> </Style> </Grid.Resources> <Grid.RowDefinitions> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height=".50*"></RowDefinition> <RowDefinition Height=".5*"></RowDefinition> </Grid.RowDefinitions> <Border x:Name="Border1" Grid.Row="0" Grid.RowSpan="4" CornerRadius="5" Background="{Binding TextBackground}" /> <Border Grid.Row="0" Grid.RowSpan="3" Background="{Binding ChartBackground}" ></Border> <TextBlock Grid.Row="0" TextAlignment="Center" Padding="10, 10, 0, 5" Foreground="{Binding Title}" FontSize="18" Text="{Binding MeasurementTitle}"></TextBlock> <TextBlock Grid.Row="1" TextAlignment="Center" Foreground="{Binding Subtitle}" Padding="0,0,0,20" Text="{Binding MeasurementSubTitle}"></TextBlock> <lvc:CartesianChart Grid.Row="2" Margin="0, 0, 0, 0" Series="{Binding LastHourSeries}" Hoverable="False" DataTooltip="{x:Null}"> <lvc:CartesianChart.AxisX> <!--a small visual improvement, lets hide the first points (x = 0, x=1) to get better animations--> <lvc:Axis MinValue="2"></lvc:Axis> </lvc:CartesianChart.AxisX> </lvc:CartesianChart> <StackPanel Grid.Row="3" VerticalAlignment="Center" Margin="25, 0"> <TextBlock Opacity=".4" FontSize="13" Text="{Binding MeasurementDescription}"></TextBlock> <StackPanel Orientation="Horizontal"> <TextBlock Foreground="{Binding TextForeground}" FontSize="40" Text="{Binding LastLecture, StringFormat={}{0:N1}}" /> <TextBlock Foreground="{Binding TextForeground}" FontSize="18" VerticalAlignment="Bottom" Margin="8, 6" Text="{Binding MeasurementUnit}"></TextBlock> </StackPanel> </StackPanel> </Grid> </Grid> </UserControl> |