Exemplo n.º 1
0
        /// <summary>
        /// 创建实例集合视图
        /// </summary>
        protected override void BuildContentsView()
        {
            base.BuildContentsView();
            DispatcherOperation operation = DHelper.InvokeOnMain(() => TreeView = Contents.Where(t => t.IsFirstLevel).AsICV());

            operation.Wait();
        }
Exemplo n.º 2
0
 /// <summary>
 /// 实例集合需要刷新
 /// <para>触发</para>
 /// </summary>
 protected void RaiseContentsNeedRefresh()
 {
     if (IsContentsNeedRefresh)
     {
         DHelper.InvokeOnMain(() => OnContentsNeedRefresh?.Invoke());
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 搜索
 /// </summary>
 public void Search(string value)
 {
     if (ListView != null)
     {
         DHelper.InvokeOnMain(() =>
         {
             ListView.Filter = new Predicate <object>(t => SetSearchRule((T)t, value));
             ListView.Refresh();
         });
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// 关闭窗口
        /// </summary>
        /// <param name="dlg"></param>
        protected void TryCloseDlg(Window dlg)
        {
            if (dlg == null)
            {
                return;
            }
            DispatcherOperation operation = DHelper.InvokeOnMain(() =>
            {
                if (dlg.IsVisible)
                {
                    dlg.Close();
                }
            });

            operation.Wait();
        }
Exemplo n.º 5
0
        /// <summary>
        /// 显示进程窗口
        /// </summary>
        /// <returns></returns>
        protected Window ShowDlgProgress()
        {
            if (IsShowAsyncDlg)
            {
                return(null);
            }
            Window dlg = default;

            TokenMgt = new CancellationTokenSource();
            DispatcherOperation operation = DHelper.InvokeOnMain(() =>
            {
                Application.Current.MainWindow.IsEnabled = false;
                dlg       = DHelper.CreateInstance <Window>(ViewService.DlgProgress);
                dlg.Owner = Application.Current.MainWindow;
                dlg.Show();
            });

            operation.Wait();
            return(dlg);
        }
Exemplo n.º 6
0
 /// <summary>
 /// 选择的实例有变更
 /// <para>触发</para>
 /// </summary>
 /// <param name="selected_item"></param>
 protected virtual void RaiseSelectedItemChanged(T selected_item)
 {
     DHelper.InvokeOnMain(() => OnSelectedItemChanged?.Invoke(selected_item));
 }
Exemplo n.º 7
0
 /// <summary>
 /// 清除单个实例视图
 /// </summary>
 protected virtual void ClearEntityView()
 {
     DHelper.InvokeOnMain(() => RaiseEntityChanged());
 }
Exemplo n.º 8
0
 /// <summary>
 /// 单个实例有变更
 /// <para>触发</para>
 /// </summary>
 protected void RaiseEntityChanged()
 {
     DHelper.InvokeOnMain(() => OnEntityChanged?.Invoke(Entity));
 }
Exemplo n.º 9
0
 /// <summary>
 /// 创建实例集合视图
 /// </summary>
 protected virtual void BuildContentsView()
 {
     DHelper.InvokeOnMain(() => ListView = Contents.AsICV());
 }
Exemplo n.º 10
0
        /// <summary>
        /// 创建实例集合视图
        /// </summary>
        protected virtual void BuildContentsView()
        {
            DispatcherOperation operation = DHelper.InvokeOnMain(() => ListView = Contents.AsICV());

            operation.Wait();
        }