mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-22 17:58:33 +08:00
Revert "Revert "block 可以拖拽到内部,还有少量问题待解决""
This reverts commit fcd7beb193.
This commit is contained in:
@@ -20,6 +20,7 @@ using ZXing;
|
||||
using AIStudio.Wpf.DiagramDesigner.Helpers;
|
||||
using AIStudio.Wpf.DiagramDesigner.ViewModels;
|
||||
using AIStudio.Wpf.DiagramDesigner.ViewModels.BaseViewModel;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
{
|
||||
@@ -34,29 +35,48 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public PageViewModel(string title, string status, DiagramType diagramType, string subType = null)
|
||||
{
|
||||
Title = title;
|
||||
Status = status;
|
||||
DiagramType = diagramType;
|
||||
SubType = subType;
|
||||
Init(true);
|
||||
|
||||
}
|
||||
public PageViewModel(string filename)
|
||||
{
|
||||
FileName = filename;
|
||||
string ext = Path.GetExtension(filename);
|
||||
var diagramDocument = OpenFile(filename, ext);
|
||||
OpenFile(diagramDocument, ext);
|
||||
DiagramDocument = OpenFile(filename, ext);
|
||||
}
|
||||
|
||||
public PageViewModel(string filename, DiagramDocument diagramDocument)
|
||||
{
|
||||
FileName = filename;
|
||||
string ext = Path.GetExtension(filename);
|
||||
OpenFile(diagramDocument, ext);
|
||||
DiagramDocument = diagramDocument;
|
||||
}
|
||||
|
||||
DiagramDocument DiagramDocument;
|
||||
public virtual void View_Loaded(object sender, EventArgs e)
|
||||
{
|
||||
//await Task.Run(() => {
|
||||
//Application.Current.Dispatcher.Invoke(() => {
|
||||
if (string.IsNullOrEmpty(FileName))
|
||||
{
|
||||
Init(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
string ext = Path.GetExtension(FileName);
|
||||
OpenFile(DiagramDocument, ext);
|
||||
}
|
||||
//});
|
||||
//});
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected virtual void InitDiagramViewModel()
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user