diff --git a/AIStudio.Wpf.DiagramDesigner/Helpers/BitmapHelper.cs b/AIStudio.Wpf.DiagramDesigner/Helpers/BitmapHelper.cs index 5d361b4..92d7c75 100644 --- a/AIStudio.Wpf.DiagramDesigner/Helpers/BitmapHelper.cs +++ b/AIStudio.Wpf.DiagramDesigner/Helpers/BitmapHelper.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Drawing; using System.Drawing.Imaging; using System.IO; @@ -316,5 +317,15 @@ namespace AIStudio.Wpf.DiagramDesigner return null; } } + + public static Stream CopyStream(this Stream stream) + { + byte[] bytearray = new byte[stream.Length]; + stream.Seek(0, SeekOrigin.Begin); + stream.Read(bytearray, 0, bytearray.Length); + + var destination = new MemoryStream(bytearray); + return destination; + } } } diff --git a/AIStudio.Wpf.DiagramDesigner/Services/IUIVisualizerService.cs b/AIStudio.Wpf.DiagramDesigner/Services/IUIVisualizerService.cs index 375dc04..5025f5f 100644 --- a/AIStudio.Wpf.DiagramDesigner/Services/IUIVisualizerService.cs +++ b/AIStudio.Wpf.DiagramDesigner/Services/IUIVisualizerService.cs @@ -17,7 +17,7 @@ namespace AIStudio.Wpf.DiagramDesigner.Services /// /// Object state to associate with the dialog /// True/False if UI is displayed. - bool? ShowDialog(object dataContextForPopup); + bool? ShowDialog(object dataContextForPopup, bool buttonVisable = true); /// /// This method displays a modal dialog associated with the given key. diff --git a/AIStudio.Wpf.DiagramDesigner/Services/WPFUIVisualizerService.cs b/AIStudio.Wpf.DiagramDesigner/Services/WPFUIVisualizerService.cs index b5c9058..5f209e0 100644 --- a/AIStudio.Wpf.DiagramDesigner/Services/WPFUIVisualizerService.cs +++ b/AIStudio.Wpf.DiagramDesigner/Services/WPFUIVisualizerService.cs @@ -12,7 +12,7 @@ namespace AIStudio.Wpf.DiagramDesigner.Services /// /// Object state to associate with the dialog /// True/False if UI is displayed. - public bool? ShowDialog(object dataContextForPopup) + public bool? ShowDialog(object dataContextForPopup, bool buttonVisable = true) { Window win = new PopupWindow(); win.DataContext = dataContextForPopup;