Skip to content

Commit

Permalink
Fixed Some Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Jun 16, 2021
1 parent 3516079 commit ea6bd72
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/HandyWinget/Bootstrapper.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Windows;
using HandyWinget.Common;
using HandyWinget.Views;
using ModernWpf.Controls;
using Prism.DryIoc;
using Prism.Ioc;
using Prism.Regions;

namespace HandyWinget
{
Expand All @@ -14,11 +14,11 @@ protected override void InitializeShell(DependencyObject shell)
base.InitializeShell(shell);
if (Helper.Settings.IsFirstRun)
{
Container.Resolve<IRegionManager>().RequestNavigate("ContentRegion", "GeneralView");
MainWindow.Instance.navView.SelectedItem = MainWindow.Instance.navView.MenuItems[0] as NavigationViewItem;
}
else
{
Container.Resolve<IRegionManager>().RequestNavigate("ContentRegion", "PackageView");
MainWindow.Instance.navView.SelectedItem = MainWindow.Instance.navView.MenuItems[1] as NavigationViewItem;
}
}
protected override DependencyObject CreateShell()
Expand Down
2 changes: 1 addition & 1 deletion src/HandyWinget/Common/HWGSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class HWGSettings : NotifiyingJsonSettings, IVersionable
public virtual bool IdentifyInstalledPackage { get; set; } = false;
public virtual bool AutoDownloadPackage { get; set; } = false;
public virtual DateTime UpdatedDate { get; set; } = DateTime.Now;
public virtual NavigationViewPaneDisplayMode PaneDisplayMode { get; set; } = NavigationViewPaneDisplayMode.Top;
public virtual NavigationViewPaneDisplayMode PaneDisplayMode { get; set; } = NavigationViewPaneDisplayMode.Auto;
public virtual InstallMode InstallMode { get; set; } = InstallMode.Internal;
public virtual ApplicationTheme Theme { get; set; } = ApplicationTheme.Light;
public virtual Brush Accent { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/HandyWinget/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ui:PathIcon Data="{DynamicResource GeneralGeometry}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem IsSelected="True" Tag="PackageView" Content="Packages">
<ui:NavigationViewItem Tag="PackageView" Content="Packages">
<ui:NavigationViewItem.Icon>
<ui:PathIcon Data="{DynamicResource PackageGeometry}"/>
</ui:NavigationViewItem.Icon>
Expand Down
5 changes: 4 additions & 1 deletion src/HandyWinget/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ public MainWindow(IRegionManager regionManager)
InitializeComponent();
_regionManager = regionManager;
Instance = this;
Loaded += MainWindow_Loaded;
}

private void MainWindow_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
LoadSettings();
}

private void LoadSettings()
{
if (Settings.IsFirstRun)
{
navView.SelectedItem = navView.MenuItems[0];
Settings.IsFirstRun = false;
}

Expand Down

0 comments on commit ea6bd72

Please sign in to comment.