Skip to content

Commit

Permalink
Fixed: Individual Dialogs' Button Visibility doesn't affect Others
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Jul 30, 2022
1 parent f7d9575 commit de7ebed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
18 changes: 1 addition & 17 deletions source/Reloaded.Mod.Launcher/Pages/Dialogs/FirstLaunch.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
public partial class FirstLaunch : ReloadedWindow
{
public new FirstLaunchViewModel ViewModel { get; set; }

public Visibility OriginalCloseVisibility;
public Visibility OriginalMinimizeVisibility;
public Visibility OriginalMaximizeVisibility;


public FirstLaunch()
{
InitializeComponent();
Expand All @@ -19,23 +15,11 @@ public FirstLaunch()
ViewModel = Lib.IoC.Get<FirstLaunchViewModel>();

// Disable Original Button Visibility
OriginalCloseVisibility = base.ViewModel.CloseButtonVisibility;
OriginalMinimizeVisibility = base.ViewModel.MinimizeButtonVisibility;
OriginalMaximizeVisibility = base.ViewModel.MaximizeButtonVisibility;
base.ViewModel.CloseButtonVisibility = Visibility.Collapsed;
base.ViewModel.MaximizeButtonVisibility = Visibility.Collapsed;
base.ViewModel.MinimizeButtonVisibility = Visibility.Collapsed;

// Init Events
this.Closing += OnWindowClosing;
ViewModel.Initialize(() => ActionWrappers.ExecuteWithApplicationDispatcher(this.Close));
}

private void OnWindowClosing(object sender, CancelEventArgs e)
{
// Re-Set Button Visibility
base.ViewModel.CloseButtonVisibility = OriginalCloseVisibility;
base.ViewModel.MinimizeButtonVisibility = OriginalMinimizeVisibility;
base.ViewModel.MaximizeButtonVisibility = OriginalMaximizeVisibility;
}
}
2 changes: 1 addition & 1 deletion source/Reloaded.Mod.Launcher/Reloaded.Mod.Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Reloaded.Memory" Version="7.0.0" />
<PackageReference Include="Reloaded.WPF.Theme.Default" Version="3.1.1" />
<PackageReference Include="Reloaded.WPF.Theme.Default" Version="3.1.2" />
<PackageReference Include="Sewer56.UI.Controller.Core" Version="1.0.1" />
<PackageReference Include="Sewer56.UI.Controller.ReloadedInput.Configurator" Version="1.2.0" />
<PackageReference Include="Sewer56.UI.Controller.WPF" Version="1.0.1" />
Expand Down

0 comments on commit de7ebed

Please sign in to comment.