-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Georgy Levchenko
committed
Mar 30, 2021
1 parent
f9dd31e
commit 35df592
Showing
7 changed files
with
171 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/DataAccess/SmartThermo.DataAccess.Sqlite/Models/SelectMode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace SmartThermo.DataAccess.Sqlite.Models | ||
{ | ||
public class SelectMode | ||
{ | ||
public int Id { get; set; } | ||
|
||
public bool Stage { get; set; } | ||
|
||
public int SettingId { get; set; } | ||
|
||
public Setting Setting { get; set; } | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/DataAccess/SmartThermo.DataAccess.Sqlite/Models/Setting.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SmartThermo.DataAccess.Sqlite.Models | ||
{ | ||
public class Setting | ||
{ | ||
public int Id { get; set; } | ||
|
||
public List<SelectMode> SelectModes { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/Modules/SmartThermo.Modules.DataViewer/Views/Charts/CustomersTooltip.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<UserControl | ||
x:Class="SmartThermo.Modules.DataViewer.Views.Charts.CustomersTooltip" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:charts="clr-namespace:SmartThermo.Modules.DataViewer.Views.Charts" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:wpf="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" | ||
Padding="8" | ||
d:DataContext="{d:DesignInstance charts:CustomersTooltip}" | ||
d:DesignHeight="450" | ||
d:DesignWidth="800" | ||
Background="#E4555555" | ||
BorderBrush="#555555" | ||
BorderThickness="2" | ||
mc:Ignorable="d"> | ||
|
||
<StackPanel> | ||
<TextBlock | ||
HorizontalAlignment="Center" | ||
Style="{DynamicResource BodyTextBlockStyle}" | ||
Text="{Binding Data.Points[0].ChartPoint.Instance.DateTime, StringFormat=HH:mm:ss}" /> | ||
|
||
<Separator Margin="0,8" /> | ||
<ItemsControl | ||
HorizontalAlignment="Center" | ||
Grid.IsSharedSizeScope="True" | ||
ItemsSource="{Binding Data.Points}"> | ||
|
||
<ItemsControl.ItemTemplate> | ||
<DataTemplate DataType="{x:Type wpf:DataPointViewModel}"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="Auto" SharedSizeGroup="Title" /> | ||
<ColumnDefinition Width="Auto" SharedSizeGroup="Value" /> | ||
<ColumnDefinition Width="Auto" SharedSizeGroup="Percent" /> | ||
</Grid.ColumnDefinitions> | ||
<Ellipse | ||
Grid.Column="0" | ||
Width="10" | ||
Height="10" | ||
Fill="{Binding Series.Stroke}" | ||
Stroke="{Binding Series.Stroke}" /> | ||
<TextBlock | ||
Grid.Column="1" | ||
Margin="4,0,0,0" | ||
VerticalAlignment="Center" | ||
Foreground="White" | ||
Style="{DynamicResource CaptionTextBlockStyle}" | ||
Text="{Binding Series.Title}" /> | ||
<TextBlock | ||
Grid.Column="2" | ||
Margin="8,0,0,0" | ||
VerticalAlignment="Center" | ||
Foreground="White" | ||
Style="{DynamicResource CaptionTextBlockStyle}" | ||
Text="{Binding ChartPoint.Instance.Value, StringFormat={}{0}°C}" /> | ||
</Grid> | ||
</DataTemplate> | ||
</ItemsControl.ItemTemplate> | ||
</ItemsControl> | ||
</StackPanel> | ||
</UserControl> |
40 changes: 40 additions & 0 deletions
40
src/Modules/SmartThermo.Modules.DataViewer/Views/Charts/CustomersTooltip.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using LiveCharts; | ||
using LiveCharts.Wpf; | ||
using System.ComponentModel; | ||
|
||
namespace SmartThermo.Modules.DataViewer.Views.Charts | ||
{ | ||
/// <summary> | ||
/// Interaction logic for CustomersTooltip.xaml | ||
/// </summary> | ||
public partial class CustomersTooltip : IChartTooltip | ||
{ | ||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
private TooltipData _data; | ||
|
||
public CustomersTooltip() | ||
{ | ||
InitializeComponent(); | ||
DataContext = this; | ||
} | ||
|
||
public TooltipData Data | ||
{ | ||
get { return _data; } | ||
set | ||
{ | ||
_data = value; | ||
OnPropertyChanged("Data"); | ||
} | ||
} | ||
|
||
public TooltipSelectionMode? SelectionMode { get; set; } | ||
|
||
protected virtual void OnPropertyChanged(string propertyName = null) | ||
{ | ||
if (PropertyChanged != null) | ||
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters