| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- using GalaSoft.MvvmLight;
- using GalaSoft.MvvmLight.Command;
- using Muchinfo.MTPClient.Data;
- using Muchinfo.MTPClient.Infrastructure.Helpers;
- using Muchinfo.MTPClient.Infrastructure.Utilities;
- using Muchinfo.MTPClient.IService;
- using Muchinfo.MTPClient.Resources;
- using System;
- using Muchinfo.PC.Common.Extensions;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Threading.Tasks;
- //----------------------------------------------------------------
- //Module Name: $safeprojectname$
- //Purpose:
- //CopyRight: Muchinfo
- //History:
- //----------------------------------------------------------------
- //DateTime 2016/4/16 13:44:50
- //Author
- //Description Create
- //----------------------------------------------------------------
- using System.Windows;
- namespace Muchinfo.MTPClient.Infrastructure.Windows
- {
- public abstract class QueryPanelPageModelBase<T> : ViewModelBase, IOrderRefresh
- {
- public QueryPanelPageModelBase()
- {
-
- }
- #region QueryPanel基类数据
- #region IsBusy
- private bool _isBusy;
- /// <summary>
- /// 是否在忙
- /// </summary>
- public bool IsBusy
- {
- get { return _isBusy; }
- set
- {
- Set(() => IsBusy, ref _isBusy, value);
- }
- }
- #endregion
- /// <summary>
- /// 刷新
- /// </summary>
- public virtual RelayCommand RefreshCommand
- {
- get
- {
- return new RelayCommand(() =>
- {
- RefreshContent();
- });
- }
- }
- /// <summary>
- /// 单据注册消息
- /// </summary>
- public abstract void RegisterMessage();
- /// <summary>
- /// 销毁消息
- /// </summary>
- public virtual void UnRegisterMessage()
- {
- // MessengerHelper.DefaultUnregister(this);
- }
- /// <summary>
- /// 刷新数据
- /// </summary>
- public abstract void RefreshContent();
- public virtual void QueryErrorCallback(ErrorEntity errorEntity)
- {
- IsBusy = false;
- Application.Current.Dispatcher.BeginInvoke(new Action(() =>
- {
- ErrorManager.ShowReturnError(errorEntity, Client_Resource.APP_Tips, false);
- }));
- }
- /// <summary>
- /// 刷新数据
- /// </summary>
- public void Refresh()
- {
- RefreshContent();
- }
- /// <summary>
- /// Cleanups this instance.
- /// </summary>
- public override void Cleanup()
- {
- ////取消注册消息
- base.Cleanup();
- MessengerHelper.QuoteUnregister(this);
- }
- #endregion
- }
- }
|