protected override async Task OnLoadedInternal()
 {
     this.SourceGetCurrentDimensionsCommand = this.CreateCommand(async() =>
     {
         if (!string.IsNullOrEmpty(this.SourceName))
         {
             StreamingSoftwareSourceDimensionsModel dimensions = await StreamingSoftwareActionModel.GetSourceDimensions(this.SelectedStreamingSoftwareType, this.SceneName, this.SourceName);
             if (dimensions != null)
             {
                 this.SourceXPosition = dimensions.X;
                 this.SourceYPosition = dimensions.Y;
                 this.SourceRotation  = dimensions.Rotation;
                 this.SourceXScale    = dimensions.XScale;
                 this.SourceYScale    = dimensions.YScale;
             }
         }
     });
     await base.OnLoadedInternal();
 }
 public StreamingSoftwareActionEditorControlViewModel(StreamingSoftwareActionModel action)
     : base(action)
 {
     this.SelectedStreamingSoftwareType = action.StreamingSoftwareType;
     this.SelectedActionType            = action.ActionType;
     if (this.ShowSceneCollectionGrid)
     {
         this.SceneCollectionName = action.ItemName;
     }
     else if (this.ShowSceneGrid)
     {
         this.SceneName = action.ItemName;
     }
     else if (this.ShowSourceGrid)
     {
         this.SceneName     = action.ParentName;
         this.SourceName    = action.ItemName;
         this.SourceVisible = action.Visible;
         if (this.ShowTextSourceGrid)
         {
             this.SourceText         = action.SourceText;
             this.SourceTextFilePath = action.SourceTextFilePath;
         }
         else if (this.ShowWebBrowserSourceGrid)
         {
             this.SourceWebPageFilePath = action.SourceURL;
         }
         else if (this.ShowSourceDimensionsGrid)
         {
             this.SourceXPosition = action.SourceDimensions.X;
             this.SourceYPosition = action.SourceDimensions.Y;
             this.SourceRotation  = action.SourceDimensions.Rotation;
             this.SourceXScale    = action.SourceDimensions.XScale;
             this.SourceYScale    = action.SourceDimensions.YScale;
         }
     }
     else if (this.ShowSourceFilterGrid)
     {
         this.SourceName    = action.ParentName;
         this.FilterName    = action.ItemName;
         this.FilterVisible = action.Visible;
     }
 }
 protected override Task <ActionModelBase> GetActionInternal()
 {
     if (this.ShowSceneCollectionGrid)
     {
         return(Task.FromResult <ActionModelBase>(StreamingSoftwareActionModel.CreateSceneCollectionAction(this.SelectedStreamingSoftwareType, this.SceneCollectionName)));
     }
     else if (this.ShowSceneGrid)
     {
         return(Task.FromResult <ActionModelBase>(StreamingSoftwareActionModel.CreateSceneAction(this.SelectedStreamingSoftwareType, this.SceneName)));
     }
     else if (this.ShowSourceGrid)
     {
         if (this.ShowTextSourceGrid)
         {
             return(Task.FromResult <ActionModelBase>(StreamingSoftwareActionModel.CreateTextSourceAction(this.SelectedStreamingSoftwareType, this.SceneName, this.SourceName, this.SourceVisible, this.SourceText, this.SourceTextFilePath)));
         }
         else if (this.ShowWebBrowserSourceGrid)
         {
             return(Task.FromResult <ActionModelBase>(StreamingSoftwareActionModel.CreateWebBrowserSourceAction(this.SelectedStreamingSoftwareType, this.SceneName, this.SourceName, this.SourceVisible, this.SourceWebPageFilePath)));
         }
         else if (this.ShowSourceDimensionsGrid)
         {
             return(Task.FromResult <ActionModelBase>(StreamingSoftwareActionModel.CreateSourceDimensionsAction(this.SelectedStreamingSoftwareType, this.SceneName, this.SourceName, this.SourceVisible,
                                                                                                                new StreamingSoftwareSourceDimensionsModel(this.SourceXPosition, this.SourceYPosition, this.SourceRotation, this.SourceXScale, this.SourceYScale))));
         }
         else
         {
             return(Task.FromResult <ActionModelBase>(StreamingSoftwareActionModel.CreateSourceVisibilityAction(this.SelectedStreamingSoftwareType, this.SceneName, this.SourceName, this.SourceVisible)));
         }
     }
     else if (this.ShowSourceFilterGrid)
     {
         return(Task.FromResult <ActionModelBase>(StreamingSoftwareActionModel.CreateSourceFilterVisibilityAction(this.SelectedStreamingSoftwareType, this.SourceName, this.FilterName, this.FilterVisible)));
     }
     return(Task.FromResult <ActionModelBase>(new StreamingSoftwareActionModel(this.SelectedStreamingSoftwareType, this.SelectedActionType)));
 }