|
|
|
|
@ -12,6 +12,7 @@ using System.Windows.Media;
|
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
using System.Windows.Navigation;
|
|
|
|
|
using System.Windows.Shapes;
|
|
|
|
|
using static SmartAquaViewer.Model.Enums;
|
|
|
|
|
|
|
|
|
|
namespace SmartAquaViewer.View
|
|
|
|
|
{
|
|
|
|
|
@ -20,9 +21,56 @@ namespace SmartAquaViewer.View
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class MonitoringView : UserControl
|
|
|
|
|
{
|
|
|
|
|
private PanelState _state = PanelState.Normal;
|
|
|
|
|
|
|
|
|
|
public MonitoringView()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnVisibility_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Button button = sender as Button;
|
|
|
|
|
if (button == null) return;
|
|
|
|
|
|
|
|
|
|
bool isDown = button.Tag != null && button.Tag.ToString() == "down";
|
|
|
|
|
|
|
|
|
|
_state = isDown
|
|
|
|
|
? _state switch
|
|
|
|
|
{
|
|
|
|
|
PanelState.Hidden => PanelState.Normal,
|
|
|
|
|
//PanelState.Normal => PanelState.Expanded,
|
|
|
|
|
_ => PanelState.Hidden
|
|
|
|
|
}
|
|
|
|
|
: _state switch
|
|
|
|
|
{
|
|
|
|
|
PanelState.Hidden => PanelState.Normal,
|
|
|
|
|
//PanelState.Expanded => PanelState.Normal,
|
|
|
|
|
_ => PanelState.Hidden
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ApplyState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ApplyState()
|
|
|
|
|
{
|
|
|
|
|
switch (_state)
|
|
|
|
|
{
|
|
|
|
|
case PanelState.Hidden:
|
|
|
|
|
rdGraph.Height = new GridLength(0, GridUnitType.Pixel);
|
|
|
|
|
btnVisibilityDown.Visibility = Visibility.Collapsed;
|
|
|
|
|
btnVisibilityUp.Visibility = Visibility.Visible;
|
|
|
|
|
break;
|
|
|
|
|
case PanelState.Normal:
|
|
|
|
|
rdGraph.Height = new GridLength(450, GridUnitType.Pixel);
|
|
|
|
|
btnVisibilityDown.Visibility = Visibility.Visible;
|
|
|
|
|
btnVisibilityUp.Visibility = Visibility.Collapsed;
|
|
|
|
|
break;
|
|
|
|
|
//case PanelState.Expanded:
|
|
|
|
|
// this.Visibility = Visibility.Visible;
|
|
|
|
|
// this.Height = 400; // Expanded height
|
|
|
|
|
// break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|