105 lines
4.2 KiB
C#
105 lines
4.2 KiB
C#
using OliviaAddInPro.Model;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Collections.ObjectModel;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
using System.Windows.Media.Imaging;
|
||
|
||
namespace OliviaAddInPro
|
||
{
|
||
class PaneLimpiezaViewModel : PanelViewModelBase
|
||
{
|
||
private PaneLimpiezaSub1ViewModel _subPanel1ViewModel;
|
||
private PaneLimpiezaSub2ViewModel _subPanel2ViewModel;
|
||
private PaneLimpiezaSub3ViewModel _subPanel3ViewModel;
|
||
private PaneLimpiezaSub4ViewModel _subPanel4ViewModel;
|
||
private PaneEjecutarViewModel _subPanelEjec;
|
||
private PanelViewModelBase _subPanelEjecBase;
|
||
Limpieza limp;
|
||
|
||
public PaneLimpiezaViewModel()
|
||
{
|
||
limp = OliviaGlob.Limp;
|
||
_subPanel1ViewModel = new PaneLimpiezaSub1ViewModel();
|
||
_subPanel2ViewModel = new PaneLimpiezaSub2ViewModel();
|
||
_subPanel3ViewModel = new PaneLimpiezaSub3ViewModel();
|
||
_subPanel4ViewModel = new PaneLimpiezaSub4ViewModel();
|
||
_subPanelEjec = new PaneEjecutarViewModel();
|
||
|
||
OptionsMenu = new ObservableCollection<OptionsMenuItem>
|
||
{
|
||
new OptionsMenuItem(new BitmapImage(new Uri("pack://application:,,,/OliviaAddInPro;component/Resources/Dog32.png")), Resource1.String_tto, _subPanel1ViewModel),
|
||
new OptionsMenuItem(new BitmapImage(new Uri("pack://application:,,,/OliviaAddInPro;component/Resources/Dino32.png")), Resource1.String_zonif, _subPanel2ViewModel),
|
||
new OptionsMenuItem(new BitmapImage(new Uri("pack://application:,,,/OliviaAddInPro;component/Resources/Cat32.png")), Resource1.String_ctrol, _subPanel3ViewModel),
|
||
new OptionsMenuItem(new BitmapImage(new Uri("pack://application:,,,/OliviaAddInPro;component/Resources/Panda32.png")), Resource1.String_tiempos, _subPanel4ViewModel)
|
||
};
|
||
SelectedOption = OptionsMenu[0];
|
||
SubPanelEjec = _subPanelEjecBase=_subPanelEjec;
|
||
}
|
||
public override string DisplayName
|
||
{
|
||
get { return Resource1.String_header_limpieza; }
|
||
}
|
||
private ObservableCollection<OptionsMenuItem> _optionsMenu = new ObservableCollection<OptionsMenuItem>();
|
||
public ObservableCollection<OptionsMenuItem> OptionsMenu
|
||
{
|
||
get { return _optionsMenu; }
|
||
set { SetProperty(ref _optionsMenu, value, () => OptionsMenu); }
|
||
}
|
||
|
||
private PanelViewModelBase _currentSubPanelPage;
|
||
public PanelViewModelBase CurrentSubPanelPage
|
||
{
|
||
get { return _currentSubPanelPage; }
|
||
set { SetProperty(ref _currentSubPanelPage, value, () => CurrentSubPanelPage); }
|
||
}
|
||
|
||
public PanelViewModelBase SubPanelEjec
|
||
{
|
||
get { return _subPanelEjecBase; }
|
||
set { SetProperty(ref _subPanelEjecBase, value, () => SubPanelEjec); }
|
||
}
|
||
|
||
private OptionsMenuItem _selectionOption;
|
||
public OptionsMenuItem SelectedOption
|
||
{
|
||
get { return _selectionOption; }
|
||
set {
|
||
SetProperty(ref _selectionOption, value, () => SelectedOption);
|
||
CurrentSubPanelPage = value.SubPanelViewModel;
|
||
}
|
||
}
|
||
|
||
public bool Lee(out string err_str)
|
||
{
|
||
err_str = "";
|
||
try
|
||
{
|
||
///Lee el primer panel
|
||
/*limp.CapaElems = _subPanel1ViewModel.CapaElems;
|
||
limp.Ttto = _subPanel1ViewModel.SelTto;
|
||
if (limp.Ttto == (int)LimpiezaDef.TiposTto.TtoNoDef)
|
||
{
|
||
err_str = "No se ha seleccionado ning<6E>n Tipo de Tratamiento";
|
||
return false;
|
||
}
|
||
//lee el <20>mbito seleccionado
|
||
if (!_subPanel1ViewModel.lee_ambitos())
|
||
{
|
||
err_str = "No se ha seleccionado ning<6E>n <20>mbito de trabajo";
|
||
return false;
|
||
}
|
||
limp.AmbitosSel = _subPanel1ViewModel.AmbitosSel;
|
||
*/
|
||
return true;
|
||
}
|
||
catch
|
||
{
|
||
return false;
|
||
}
|
||
}
|
||
}
|
||
}
|