/// <summary> /// 创建实例集合视图 /// </summary> protected override void BuildContentsView() { base.BuildContentsView(); DispatcherOperation operation = DHelper.InvokeOnMain(() => TreeView = Contents.Where(t => t.IsFirstLevel).AsICV()); operation.Wait(); }
/// <summary> /// 实例集合需要刷新 /// <para>触发</para> /// </summary> protected void RaiseContentsNeedRefresh() { if (IsContentsNeedRefresh) { DHelper.InvokeOnMain(() => OnContentsNeedRefresh?.Invoke()); } }
/// <summary> /// 搜索 /// </summary> public void Search(string value) { if (ListView != null) { DHelper.InvokeOnMain(() => { ListView.Filter = new Predicate <object>(t => SetSearchRule((T)t, value)); ListView.Refresh(); }); } }
/// <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(); }
/// <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); }
/// <summary> /// 选择的实例有变更 /// <para>触发</para> /// </summary> /// <param name="selected_item"></param> protected virtual void RaiseSelectedItemChanged(T selected_item) { DHelper.InvokeOnMain(() => OnSelectedItemChanged?.Invoke(selected_item)); }
/// <summary> /// 清除单个实例视图 /// </summary> protected virtual void ClearEntityView() { DHelper.InvokeOnMain(() => RaiseEntityChanged()); }
/// <summary> /// 单个实例有变更 /// <para>触发</para> /// </summary> protected void RaiseEntityChanged() { DHelper.InvokeOnMain(() => OnEntityChanged?.Invoke(Entity)); }
/// <summary> /// 创建实例集合视图 /// </summary> protected virtual void BuildContentsView() { DHelper.InvokeOnMain(() => ListView = Contents.AsICV()); }
/// <summary> /// 创建实例集合视图 /// </summary> protected virtual void BuildContentsView() { DispatcherOperation operation = DHelper.InvokeOnMain(() => ListView = Contents.AsICV()); operation.Wait(); }