using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace FLY.Thick.Blowing.UI.UiModule
{
    /// <summary>
    /// Window_graphtrend.xaml 的交互逻辑
    /// </summary>
    public partial class TrendGraph2Config : FLY.ControlLibrary.WindowBigClose
    {
        TrendGraphItemParam graphparam;
        TrendGraph2Vm trendGraphVm;
        public TrendGraph2Config()
        {
            InitializeComponent();
        }

        public void Init(TrendGraphItemParam graphparam, TrendGraph2Vm trendGraphVm)
        {
            this.graphparam = graphparam;
            this.trendGraphVm = trendGraphVm;
            this.DataContext = graphparam;
            this.grid_trend.DataContext = trendGraphVm;

        }
        private void btnPreClick(object sender, RoutedEventArgs e)
        {
            trendGraphVm.PreView();

        }

        private void btnNextClick(object sender, RoutedEventArgs e)
        {
            trendGraphVm.NextView();
        }


        private void btnOkClick(object sender, RoutedEventArgs e)
        {
            TrendGraphParams.Current.Save();
        }

        private void btnNewestClick(object sender, RoutedEventArgs e)
        {
            trendGraphVm.ToNewest();
        }

        private void btnSeachClick(object sender, RoutedEventArgs e)
        {
            trendGraphVm.Search(trendGraphVm.SearchTime);
        }

        private void btnNextSelectedClick(object sender, RoutedEventArgs e)
        {
            trendGraphVm.NextSelected();
        }

        private void btnPreSelectedClick(object sender, RoutedEventArgs e)
        {
            trendGraphVm.PreSelected();
        }
    }
}