Commit 2792e8e9 by liulongfei

项目库打开等修复

parent e7566570
......@@ -4,6 +4,7 @@ using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using VIZ.Package.Domain;
using VIZ.Package.Service;
......@@ -39,6 +40,7 @@ namespace VIZ.Package.Module
if (ApplicationDomainEx.FieldEditWindow == null)
{
ApplicationDomainEx.FieldEditWindow = new FieldEditWindow();
ApplicationDomainEx.FieldEditWindow.Owner = ApplicationDomainEx.MainWindow;
}
return ApplicationDomainEx.FieldEditWindow as FieldEditWindow;
......
......@@ -37,5 +37,7 @@
</dxg:TreeListView>
</dxg:GridControl.View>
</dxg:GridControl>
<dx:WaitIndicator DeferedVisibility="{Binding IsLoading}" Content="Loading..." />
</Grid>
</UserControl>
......@@ -38,6 +38,7 @@ namespace VIZ.Package.Module
private void InitMessage()
{
ApplicationDomainEx.MessageManager.Register<PageInitedMessage>(this, this.OnPageInitedMessage);
ApplicationDomainEx.MessageManager.Register<ProjectCloseMessage>(this, this.OnProjectCloseMessage);
}
// =============================================================
......@@ -138,5 +139,15 @@ namespace VIZ.Package.Module
});
});
}
/// <summary>
/// 项目关闭时触发
/// </summary>
/// <param name="msg"></param>
private void OnProjectCloseMessage(ProjectCloseMessage msg)
{
this.ControlObject = null;
this.SelectedControlField = null;
}
}
}
\ No newline at end of file
......@@ -149,6 +149,8 @@ namespace VIZ.Package.Module
{
this.SaveProject();
}
ApplicationDomainEx.ProjectDbContext.Dispose();
}
OpenFileDialog ofd = new OpenFileDialog();
......@@ -224,6 +226,8 @@ namespace VIZ.Package.Module
{
this.SaveProject();
}
ApplicationDomainEx.ProjectDbContext.Dispose();
}
this.ProjectName = null;
......
......@@ -330,24 +330,7 @@ namespace VIZ.Package.Module
/// <param name="msg">消息</param>
private void OnProjectSaveMessage(ProjectSaveMessage msg)
{
this.IsLoading = true;
Task.Run(() =>
{
try
{
this.pageService.SavePageGroups(this.PageGroupModels);
}
catch (Exception ex)
{
log.Error(ex);
}
WPFHelper.BeginInvoke(() =>
{
this.IsLoading = false;
});
});
this.pageService.SavePageGroups(this.PageGroupModels);
}
// ======================================================================================
......@@ -373,6 +356,8 @@ namespace VIZ.Package.Module
return;
PageModel page = new PageModel();
page.PageID = Guid.NewGuid();
page.PageGroupID = this.SelectedPageGroupModel.GroupID;
page.Scene = template.Scene;
page.ScenePath = template.ScenePath;
page.ThumbnailUri = template.ThumbnailUri;
......
......@@ -284,24 +284,7 @@ namespace VIZ.Package.Module
/// <param name="msg">消息</param>
private void OnProjectSaveMessage(ProjectSaveMessage msg)
{
this.IsLoading = true;
Task.Run(() =>
{
try
{
this.pageService.SavePageTemplates(this.SceneTemplateModels);
}
catch (Exception ex)
{
log.Error(ex);
}
WPFHelper.BeginInvoke(() =>
{
this.IsLoading = false;
});
});
this.pageService.SavePageTemplates(this.SceneTemplateModels);
}
// ======================================================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment