using System.Windows;
using System.Windows.Controls;
namespace HC_APTBS.Views.UserControls
{
///
/// UserControl hosting a single real-time flowmeter chart.
/// DataContext is expected to be a .
/// Set to true to reduce chart height to 90 px
/// (used in the 2×2 bench chart grid).
///
public partial class FlowmeterChartView : UserControl
{
/// When true the chart height shrinks from 120 to 90 px.
public static readonly DependencyProperty IsCompactProperty =
DependencyProperty.Register(nameof(IsCompact), typeof(bool), typeof(FlowmeterChartView),
new FrameworkPropertyMetadata(false,
(d, e) => ((FlowmeterChartView)d).ChartHeight = (bool)e.NewValue ? 90.0 : 120.0));
public bool IsCompact
{
get => (bool)GetValue(IsCompactProperty);
set => SetValue(IsCompactProperty, value);
}
/// Derived chart height (120 or 90); bound in XAML.
public static readonly DependencyProperty ChartHeightProperty =
DependencyProperty.Register(nameof(ChartHeight), typeof(double), typeof(FlowmeterChartView),
new FrameworkPropertyMetadata(120.0));
public double ChartHeight
{
get => (double)GetValue(ChartHeightProperty);
set => SetValue(ChartHeightProperty, value);
}
public FlowmeterChartView()
{
InitializeComponent();
}
}
}