using PDF_Office.Model;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;

namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
{
    public class HomePageConverterImgViewModel : BindableBase, INavigationAware
    {
        #region 参数和属性
        public List<string> ImageTypeFamily { set; get; } = new List<string>();

        public HomePageConverterDialogViewModel homePageConverterDialogViewModel { get; set; }

        private void SetImageTypeOrigin()
        {
            this.ImageTypeFamily.Add("JPEG");
            this.ImageTypeFamily.Add("JPG");
            this.ImageTypeFamily.Add("PNG");
            this.ImageTypeFamily.Add("GIF");
            this.ImageTypeFamily.Add("TIFF");
            this.ImageTypeFamily.Add("TGA");
            this.ImageTypeFamily.Add("BMP");
            this.ImageTypeFamily.Add("JPEG-2000");
        }

        public List<string> ImageDPIFamily { set; get; } = new List<string>();
        private void SetImageDPIOrigin()
        {
            this.ImageDPIFamily.Add("50 dpi");
            this.ImageDPIFamily.Add("72 dpi");
            this.ImageDPIFamily.Add("96 dpi");
            this.ImageDPIFamily.Add("150 dpi");
            this.ImageDPIFamily.Add("300 dpi");
            this.ImageDPIFamily.Add("600 dpi");
        }
        #endregion

        public HomePageConverterImgViewModel()
        {
            SetImageTypeOrigin();
            SetImageDPIOrigin();
        }
        #region 构架行为
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            var homePageConverterVM = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as HomePageConverterDialogViewModel;
            if (homePageConverterVM != null)
            {
                homePageConverterDialogViewModel = homePageConverterVM;
            }
        }

        public bool IsNavigationTarget(NavigationContext navigationContext)
        {
            return true;
        }

        public void OnNavigatedFrom(NavigationContext navigationContext)
        {
        }
        #endregion
    }
}
