
///////////////////////////////////////////////////////////////////////////////  
//文件名称: WinInsuerAssetSelecter.xaml
//文件描述: WinInsuerAssetSelecter.xaml
//创 建 者: xls
//创建日期: 2018/9/18 9:11:18
//版 本 号：1.0.0.0
////////////////////////////////////////////////////////////////////////////////

using System;
using System.Windows;
using System.Windows.Controls;
using FWindSoft.Wpf;

namespace Com.FirmLib.UI.Insuer
{
    /// <summary>
    /// WinInsuerAssetSelecter.xaml 的交互逻辑
    /// </summary>
    public partial class WinInsuerAssetSelector : BaseWindow
    {
        private VmInsuerAssetSelector m_Vm;
        public WinInsuerAssetSelector() : this(new VmInsuerAssetSelector())
        {
           
        }
        public WinInsuerAssetSelector(VmInsuerAssetSelector vm)
        {
            InitializeComponent();
            this.m_Vm = vm;
            this.m_Vm.SetRefView(this);
            this.DataContext = this.m_Vm;
        }
        protected override void LoadData(LoadParameter parameter)
        {
            //初始化数据
             TryCatchWrapper.Handled(() => this.m_Vm.Init(parameter));
        }
        #region 界面关联事件
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (this.HasError())
                {
                    //MessageShow.Infomation("请修改错误输入项");
                    return;
                }
            }
            catch (Exception ex)
            {
                //MessageShow.Show(ex);
            }
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
        #endregion

        private void NavigationPager_OnPageIndexChanged(object sender, FWindSoft.Wpf.Controls.PageChangedEventArgs e)
        {

        }

        private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            System.Windows.Controls.TabControl control = e.OriginalSource as TabControl;
            if (control == null)
                return;
            this.m_Vm.TabChangedCommand(control.SelectedIndex);
        }
    }
}
