| ofs | hex dump | ascii |
|---|
| 0000 | 47 49 46 38 39 61 b3 00 fd 00 f7 00 00 00 00 00 2c 2a 2c 30 2d 2f 2f 2d 30 31 2f 31 2f 30 30 33 | GIF89a..........,*,0-//-01/1/003 |
| 0020 | 32 34 38 36 37 36 37 38 39 37 38 3e 3d 3e 37 3a 3a 40 3e 3f 40 40 3f 3f 3e 40 41 3e 41 3f 40 40 | 24867678978>=>7::@>?@@??>@A>A?@@ |
| 0040 | 43 43 43 48 46 47 47 48 47 48 49 47 46 46 48 49 47 49 47 48 48 4b 4b 4c 50 4e 4f 4e 50 4d 4d 4e | CCCHFGGHGHIGFFHIGIGHHKKLPNONPMMN |
| 0060 | 50 51 4f 51 4f 51 51 53 53 54 58 56 56 5a 58 57 55 56 58 58 57 59 56 59 59 5b 5b 5c 57 5a 57 61 | PQOQOQQSSTXVVZXWUVXXWYVYY[[\WZWa |
| 0080 | 5e 5e 60 64 5f 5e 5e 61 61 5f 61 5e 61 62 5e 67 68 62 63 64 62 68 66 64 65 6a 69 66 69 66 6a 6a | ^^`d_^^aa_a^ab^ghbcdbhfdejififjj |
| 00a0 | 69 6c 6d 70 6e 6f 6a 70 6e 6c 6d 71 66 6c 71 71 6f 71 6d 72 72 6f 78 78 72 74 76 78 74 77 71 78 | ilmpnojpnlmqflqqoqmrroxxrtvxtwqx |
| 00c0 | 76 73 73 79 78 75 79 75 7b 7b 79 7c 7d 7b 81 7f dd b3 2e d3 af 39 db b5 37 dd b6 3b d5 b3 3f e4 | vssyxuyu{{y|}{.......9..7..;..?. |
| 00e0 | ba 2d ea be 2c e4 b9 26 e1 bb 3d e6 bc 31 ee c0 29 f5 c5 24 f8 c7 23 fb c9 23 f1 c3 28 b1 9a 44 | .-..,..&..=..1..)..$..#..#..(..D |
| 0100 | ac 99 50 bb a3 5a 8b 88 6a 91 8c 68 87 86 79 85 87 76 bb a5 64 ba a5 69 b9 a5 6c af a2 7f b3 a2 | ..P..Z..j..h..y..v..d..i..l..... |
| 0120 | 73 b9 a6 72 b2 a3 78 cc ac 43 c7 aa 4e ca ab 4a d1 ae 40 d0 ae 4a d8 b5 44 c9 ac 55 c3 a9 5b ca | s..r..x..C..N..J..@..J..D..U..[. |
| 0140 | ad 59 c6 a9 52 c1 a8 60 75 7f 81 7a 7f 82 81 7e 82 76 84 86 7b 83 85 77 86 88 7a 86 89 77 88 88 | .Y..R..`u..z...~.v..{..w..z..w.. |
| 0160 | 7c 8a 8b 81 86 86 82 89 87 83 86 8b 88 87 8b 85 8d 8d 89 8d 8e 89 8e 87 86 90 8e 8b 91 8e 97 96 | |............................... |
| 0180 | 8f 85 8d 91 8c 8e 92 91 8f 92 86 90 91 8c 92 93 8d 94 99 8f 99 9b 92 95 95 94 99 95 94 95 9a 98 | ................................ |
| 01a0 | 96 9a 94 9a 9c 9b 9b 9d aa 9f 81 a9 9e 8a a6 9f 95 9d a0 9e ae a2 86 ad a2 8c b1 a4 82 b0 a5 8b | ................................ |
| 01c0 | ad a3 93 aa a4 9b ae a8 9f b0 a5 91 96 9d a1 9c 9d a2 a1 9f a2 97 a1 a4 9d a1 a5 9e a5 a9 a3 a2 | ................................ |
| 01e0 | a5 aa a5 a3 ae a9 a6 a4 a5 aa a9 a6 aa a4 a9 ad ac aa ad a7 ac b0 ad ad b2 b1 ae b2 ad b1 b5 af | ................................ |
| 0200 | b3 b8 b1 b0 b5 b4 b6 bc b3 b8 bc b8 b8 bd 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0220 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0240 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0260 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 0280 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
| 02a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.DI;
using Tango.SharedUI;
namespace Tango.MachineStudio.Common
{
/// <summary>
/// Represents a Machine Studio view model
/// </summary>
/// <seealso cref="Tango.SharedUI.ViewModel" />
/// <seealso cref="Tango.MachineStudio.Common.IStudioViewModel" />
public abstract class StudioViewModel : ViewModel, IStudioViewModel
{
private bool _isVisible;
/// <summary>
/// Gets or sets a value indicating whether this view model view's is visible.
/// </summary>
public bool IsVisible
{
get { return _isVisible; }
set { _isVisible = value; RaisePropertyChangedAuto(); }
}
/// <summary>
/// Initializes a new instance of the <see cref="StudioViewModel{Module}"/> class.
/// </summary>
public StudioViewModel() : base()
{
}
/// <summary>
/// Called when the user has navigated out of this view model.
/// </summary>
public virtual void OnNavigatedFrom()
{
IsVisible = false;
}
/// <summary>
/// Called when the user has navigated in to this view model.
/// </summary>
public virtual void OnNavigatedTo()
{
IsVisible = true;
}
/// <summary>
/// Called before the application is shutting down.
/// Return false to cancel the shutdown in case an important process is in progress.
/// </summary>
/// <returns></returns>
public virtual Task<bool> OnShutdownRequest()
{
return Task.FromResult(true);
}
/// <summary>
/// Called when application is shutting down.
/// </summary>
public virtual void OnShuttingDown()
{
}
/// <summary>
/// Called when the application has been started
/// </summary>
public virtual void OnApplicationStarted()
{
}
/// <summary>
/// Called when the application is ready and all modules are loaded.
/// </summary>
public abstract void OnApplicationReady();
}
/// <summary>
/// Represents a Machine Studio view model with a support for a view contract.
/// </summary>
/// <typeparam name="TView"></typeparam>
/// <seealso cref="Tango.SharedUI.ViewModel" />
public abstract class StudioViewModel<TView> : StudioViewModel where TView : IView
{
/// <summary>
/// Gets the view model's view.
/// </summary>
public TView View { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="StudioViewModel{TView}"/> class.
/// </summary>
public StudioViewModel() : base()
{
TangoIOC.Default.GetInstanceWhenAvailable<TView>((view) =>
{
View = view;
OnViewAttached(view);
});
}
/// <summary>
/// Called when the view has been attached
/// </summary>
/// <param name="view">The view.</param>
protected virtual void OnViewAttached(TView view)
{
//Do Nothing.
}
}
}
|