8,746
社区成员
发帖
与我相关
我的任务
分享
绑定数据前
绑定数据后:
<TextBlock Text="{Binding CurrentDevice.DeviceName}" Foreground="White" FontSize="14" Margin="0,15"/>
<ItemsControl Grid.Row="1" ItemsSource="{Binding CurrentDevice.MonitorValueList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition/>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding ValueName,StringFormat=\{0\}:}" Foreground="#99FFFFFF" VerticalAlignment="Center"/>
<lvc:CartesianChart Grid.Column="1" MinHeight="30" DataTooltip="{x:Null}">
<lvc:CartesianChart.Series>
<lvc:LineSeries Fill="Transparent" Values="{Binding Values}" PointGeometrySize="0" StrokeThickness="0.5">
<lvc:LineSeries.Stroke>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="Orange" Offset="0.5"/>
<GradientStop Color="#00FFFFFF" Offset="0"/>
<GradientStop Color="#FFFFE2AE" Offset="0.1"/>
</LinearGradientBrush>
</lvc:LineSeries.Stroke>
</lvc:LineSeries>
</lvc:CartesianChart.Series>
<lvc:CartesianChart.AxisX>
<lvc:Axis ShowLabels="False"/>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis ShowLabels="False"/>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
<TextBlock Text="{Binding CurrentValue}" Grid.Column="2" Foreground="#99FFFFFF" VerticalAlignment="Center" HorizontalAlignment="Right"/>
<TextBlock Text="{Binding Unit}" Grid.Column="3" Foreground="#99FFFFFF" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3,0,0,0"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>