aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-05-31 00:42:00 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-05-31 00:42:00 +0300
commitabfcceeb4fddb69eb3737789424dcc9ecb36d09c (patch)
treef6867d51b89378ada228dbce8f4141e96e49f81f /Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs
parent3ba50278808cb6f08a8abf7ec0c0ecdae9c472c5 (diff)
downloadTango-abfcceeb4fddb69eb3737789424dcc9ecb36d09c.tar.gz
Tango-abfcceeb4fddb69eb3737789424dcc9ecb36d09c.zip
Take snapshot.
Diffstat (limited to 'Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs')
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs
index 9bd25a99a..86129b682 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs
@@ -12,6 +12,7 @@ using System.Windows.Media.Imaging;
using Tango.Core.Commands;
using Tango.Core.Threading;
using Tango.FSE.Common;
+using Tango.FSE.Common.Notifications;
using Tango.FSE.Common.RemoteDesktop;
using Tango.RemoteDesktop.Frames;
using Tango.RemoteDesktop.Network;
@@ -60,6 +61,11 @@ namespace Tango.FSE.PPCConsole.ViewModels
/// </summary>
public RelayCommand HideAndOpenShellCommand { get; set; }
+ /// <summary>
+ /// Save current desktop frame to image
+ /// </summary>
+ public RelayCommand TakeSnapshotCommand { get; set; }
+
#endregion
#region Constructors
@@ -73,6 +79,7 @@ namespace Tango.FSE.PPCConsole.ViewModels
StopCommand = new RelayCommand(StopRemoteDesktop);
OpenTaskManagerCommand = new RelayCommand(OpenTaskManager);
HideAndOpenShellCommand = new RelayCommand(HideAndOpenShell);
+ TakeSnapshotCommand = new RelayCommand(TakeSnapshot);
}
#endregion
@@ -185,6 +192,28 @@ namespace Tango.FSE.PPCConsole.ViewModels
#endregion
+ #region Snapshot
+
+ private async void TakeSnapshot()
+ {
+ var snapshot = Source.Clone();
+
+ await Task.Delay(500); //Delay for blink animation..
+
+ var result = await StorageProvider.SaveFile("Save Snapshot", "Jpeg Files|*.jpg", $"TangoApp_{DateTime.Now.ToFileName()}.jpg", ".jpg");
+
+ if (result.Confirmed)
+ {
+ snapshot.SaveJpegFile(result.SelectedItem, 100);
+ NotificationProvider.PushSnackbarItem(MessageType.Success, "Remote Desktop Snapshot Saved", true, "Remote desktop snapshot saved successfully.\nTap to view the image file.", TimeSpan.FromSeconds(8), null, () =>
+ {
+ StorageProvider.ShowInExplorer(result.SelectedItem);
+ });
+ }
+ }
+
+ #endregion
+
#region Remote Actions
private void OpenTaskManager()