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.Navigation;
using System.Windows.Shapes;


namespace OliviaAddInPro
{
    /// <summary>
    /// Interaction logic for PaneEjecutarView.xaml
    /// </summary>
    public partial class PaneEjecutarView : UserControl
    {
        public PaneEjecutarView()
        {
            InitializeComponent();
        }

        private void button_secto_Click(object sender, RoutedEventArgs e)
        {
            if (DataContext is PaneLimpiezaViewModel modlimp)
            {
                modlimp.Ejecuta(OliviaAddInPro.Services.ModosEjec.Sectoriza);
            }
            else if(DataContext is PaneRecogidaViewModel modrec)
            {
                modrec.Ejecuta(OliviaAddInPro.Services.ModosEjec.Planifica);
            }
        }

        private void button_planif_Click(object sender, RoutedEventArgs e)
        {
            if (DataContext is PaneLimpiezaViewModel modlimp)
            {
                modlimp.Ejecuta(OliviaAddInPro.Services.ModosEjec.Planifica);
            }
            else if (DataContext is PaneRecogidaViewModel modrec)
            {
                modrec.Ejecuta(OliviaAddInPro.Services.ModosEjec.Planifica);
            }

        }
    }
}
