Skip to content

Commit

Permalink
Open project in VS and window folder no longer show if a project is u…
Browse files Browse the repository at this point in the history
…nloaded.
  • Loading branch information
vchelaru committed Aug 18, 2023
1 parent a794946 commit 50fae1b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
mc:Ignorable="d" >
<StackPanel Orientation="Horizontal">
<xctk:SplitButton
Visibility="{Binding VisualStudioButtonVisibility}"
Click="VisualStudioButtonClick"
ToolTip="Open Project in Visual Studio"
Height="22" Width="40">
Expand All @@ -21,6 +22,8 @@
</xctk:SplitButton>

<Button Click="FolderButtonClick"
Visibility="{Binding FolderButtonVisibility}"

ToolTip="Open Project Folder"
Height="22" Width="22" Margin="2,0,0,0">
<Image Source="/Plugins/EmbeddedPlugins/SyncedProjects/Images/OpenFolder.png"></Image>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ public override void StartUp()
this.AddMenuItemTo("View Projects", HandleSyncedProjectsClick, "Project", preferredIndex:0);

this.ReactToLoadedGlux += HandleGluxLoad;
this.ReactToUnloadedGlux += HandleGluxUnload;

AddToolbarUi();
}

private void HandleGluxUnload()
{
toolbarControlViewModel.HasProjectLoaded = false;
}

private void HandleGluxLoad()
{
var glueProject = GlueState.Self.CurrentGlueProject;
Expand All @@ -39,6 +45,7 @@ private void HandleGluxLoad()

var value = openAutomaticallyProperty?.Value as bool? == true;
toolbarControlViewModel.IsOpenVisualStudioAutomaticallyChecked = value;
toolbarControlViewModel.HasProjectLoaded = true;

if (value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;

namespace GlueFormsCore.Plugins.EmbeddedPlugins.SyncedProjects.ViewModels
{
Expand All @@ -12,5 +13,18 @@ public bool IsOpenVisualStudioAutomaticallyChecked
get => Get<bool>();
set => Set(value);
}

public bool HasProjectLoaded
{
get => Get<bool>();
set => Set(value);
}

[DependsOn(nameof(HasProjectLoaded))]
public Visibility VisualStudioButtonVisibility => HasProjectLoaded.ToVisibility();

[DependsOn(nameof(HasProjectLoaded))]
public Visibility FolderButtonVisibility => HasProjectLoaded.ToVisibility();

}
}

0 comments on commit 50fae1b

Please sign in to comment.