(this, Receive);
@@ -118,7 +115,6 @@ private async Task InstallPackage()
if (installedPackages.Any(item => item.Name == Package!.Name))
{
_toastService.Error(Lang.LibraryInstall_Add_AlreadyInstalled);
- return;
}
}
@@ -126,7 +122,7 @@ public void Receive(object recipient, SearchDetailMessage message)
{
Package = message.Package;
- SearchDetailPage.ProjectDescriptionWebView!.Loaded += async (sender, e) =>
+ SearchDetailPage.ProjectDescriptionWebView!.Loaded += async (_, _) =>
{
ProjectDescriptionVisibility = false;
var packageVersions = await _environmentService.GetVersions(Package!.Name);
@@ -145,8 +141,8 @@ public void Receive(object recipient, SearchDetailMessage message)
TargetVersion = AvailableVersions.First();
break;
}
- var webView2Environment = await CoreWebView2Environment.CreateAsync(null, AppInfo.CachesDir);
- await SearchDetailPage.ProjectDescriptionWebView!.EnsureCoreWebView2Async().ConfigureAwait(true);
+ await CoreWebView2Environment.CreateAsync(null, AppInfo.CachesDir);
+ await SearchDetailPage.ProjectDescriptionWebView.EnsureCoreWebView2Async().ConfigureAwait(true);
try
{
var projectDescriptionUrl = message.Package.Url;
@@ -155,8 +151,8 @@ public void Receive(object recipient, SearchDetailMessage message)
htmlDocument.LoadHtml(html);
string projectDescriptionHtml = string.Format(_htmlModel, _themeType, ThemeTypeInHex, htmlDocument.DocumentNode.SelectSingleNode("//*[@id=\"description\"]/div").InnerHtml);
- SearchDetailPage.ProjectDescriptionWebView!.CoreWebView2.Profile.PreferredColorScheme = CoreWebView2PreferredColorScheme.Dark;
- SearchDetailPage.ProjectDescriptionWebView!.NavigateToString(projectDescriptionHtml);
+ SearchDetailPage.ProjectDescriptionWebView.CoreWebView2.Profile.PreferredColorScheme = CoreWebView2PreferredColorScheme.Dark;
+ SearchDetailPage.ProjectDescriptionWebView.NavigateToString(projectDescriptionHtml);
}
catch (Exception ex)
{
@@ -164,8 +160,8 @@ public void Receive(object recipient, SearchDetailMessage message)
_toastService.Error(Lang.SearchDetail_ProjectDescription_LoadFailed);
string projectDescriptionHtml = string.Format(_htmlModel, _themeType, ThemeTypeInHex, $"{Lang.SearchDetail_ProjectDescription_LoadFailed}
");
- SearchDetailPage.ProjectDescriptionWebView!.CoreWebView2.Profile.PreferredColorScheme = CoreWebView2PreferredColorScheme.Dark;
- SearchDetailPage.ProjectDescriptionWebView!.NavigateToString(projectDescriptionHtml);
+ SearchDetailPage.ProjectDescriptionWebView.CoreWebView2.Profile.PreferredColorScheme = CoreWebView2PreferredColorScheme.Dark;
+ SearchDetailPage.ProjectDescriptionWebView.NavigateToString(projectDescriptionHtml);
}
finally
{
diff --git a/src/PipManager/ViewModels/Pages/Search/SearchViewModel.cs b/src/PipManager/ViewModels/Pages/Search/SearchViewModel.cs
index d49ada0..d16c340 100644
--- a/src/PipManager/ViewModels/Pages/Search/SearchViewModel.cs
+++ b/src/PipManager/ViewModels/Pages/Search/SearchViewModel.cs
@@ -27,16 +27,16 @@ public partial class SearchViewModel(IPackageSearchService packageSearchService,
private string _totalResultNumber = "";
[ObservableProperty]
- private bool _onQuerying = false;
+ private bool _onQuerying;
[ObservableProperty]
- private bool _successQueried = false;
+ private bool _successQueried;
[ObservableProperty]
private bool _reachesFirstPage = true;
[ObservableProperty]
- private bool _reachesLastPage = false;
+ private bool _reachesLastPage;
[ObservableProperty]
private int _currentPage = 1;
@@ -65,7 +65,6 @@ private void InitializeViewModel()
[RelayCommand]
private void ToDetailPage(object parameter)
{
- if (QueryList is null) return;
navigationService.Navigate(typeof(SearchDetailPage));
var current = QueryList.Where(searchListItem => searchListItem.Name == parameter as string).ToList()[0];
WeakReferenceMessenger.Default.Send(new SearchDetailMessage(current));
@@ -157,7 +156,7 @@ public async Task Search(string? parameter)
MaxPage = 1;
CurrentPage = 1;
QueryPackageName = parameter;
- var result = await packageSearchService.Query(parameter, 1);
+ var result = await packageSearchService.Query(parameter);
Process(result);
OnQuerying = false;
}
diff --git a/src/PipManager/ViewModels/Pages/Tools/ToolsViewModel.cs b/src/PipManager/ViewModels/Pages/Tools/ToolsViewModel.cs
index 5daf698..1b8d115 100644
--- a/src/PipManager/ViewModels/Pages/Tools/ToolsViewModel.cs
+++ b/src/PipManager/ViewModels/Pages/Tools/ToolsViewModel.cs
@@ -6,6 +6,9 @@ namespace PipManager.ViewModels.Pages.Tools;
public partial class ToolsViewModel : ObservableObject, INavigationAware
{
private bool _isInitialized;
+
+ [ObservableProperty]
+ private string? _testProperty;
public void OnNavigatedTo()
{
diff --git a/src/PipManager/ViewModels/Windows/MainWindowViewModel.cs b/src/PipManager/ViewModels/Windows/MainWindowViewModel.cs
index 2216cb2..3ccc622 100644
--- a/src/PipManager/ViewModels/Windows/MainWindowViewModel.cs
+++ b/src/PipManager/ViewModels/Windows/MainWindowViewModel.cs
@@ -5,16 +5,14 @@ namespace PipManager.ViewModels.Windows;
public partial class MainWindowViewModel : ObservableObject
{
- private readonly IConfigurationService _configurationService;
[ObservableProperty] private bool _experimentMode;
public MainWindowViewModel(IConfigurationService configurationService)
{
- _configurationService = configurationService;
- if (_configurationService.AppConfig.CurrentEnvironment != null)
+ if (configurationService.AppConfig.CurrentEnvironment != null)
{
- Log.Information($"[MainWindow] Environment loaded ({_configurationService.AppConfig.CurrentEnvironment.PipVersion} for {_configurationService.AppConfig.CurrentEnvironment.PythonVersion})");
- ApplicationTitle = $"Pip Manager | {_configurationService.AppConfig.CurrentEnvironment.PipVersion} for {_configurationService.AppConfig.CurrentEnvironment.PythonVersion}";
+ Log.Information($"[MainWindow] Environment loaded ({configurationService.AppConfig.CurrentEnvironment.PipVersion} for {configurationService.AppConfig.CurrentEnvironment.PythonVersion})");
+ ApplicationTitle = $"Pip Manager | {configurationService.AppConfig.CurrentEnvironment.PipVersion} for {configurationService.AppConfig.CurrentEnvironment.PythonVersion}";
}
else
{
diff --git a/src/PipManager/Views/Pages/Action/ActionExceptionPage.xaml b/src/PipManager/Views/Pages/Action/ActionExceptionPage.xaml
index b1a4a7f..380a2b1 100644
--- a/src/PipManager/Views/Pages/Action/ActionExceptionPage.xaml
+++ b/src/PipManager/Views/Pages/Action/ActionExceptionPage.xaml
@@ -1,25 +1,25 @@
+ x:Class="PipManager.Views.Pages.Action.ActionExceptionPage"
+ x:Name="ActionException"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:action="clr-namespace:PipManager.Views.Pages.Action"
+ xmlns:action1="clr-namespace:PipManager.Models.Action"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:lang="clr-namespace:PipManager.Languages"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
@@ -29,39 +29,39 @@
-
+
+ Text="{Binding OperationDescription}"
+ VerticalAlignment="Center" />
+ VerticalAlignment="Center">
-
+
+ TextWrapping="WrapWithOverflow"
+ VerticalAlignment="Center" />
-
+
+ Margin="5,0,0,0"
+ Text="{Binding OperationTimestamp}"
+ VerticalAlignment="Center" />
@@ -76,47 +76,44 @@
+ Grid.Row="1"
+ Orientation="Horizontal"
+ VerticalAlignment="Bottom">
+ Icon="{ui:SymbolIcon Search24}"
+ Margin="3,0,0,0" />
+ Content="{I18N {x:Static lang:LangKeys.ActionException_CopyToClipboard}}"
+ Margin="3,0,0,0" />
diff --git a/src/PipManager/Views/Pages/Action/ActionPage.xaml.cs b/src/PipManager/Views/Pages/Action/ActionPage.xaml.cs
index 22174d5..6d1158a 100644
--- a/src/PipManager/Views/Pages/Action/ActionPage.xaml.cs
+++ b/src/PipManager/Views/Pages/Action/ActionPage.xaml.cs
@@ -14,9 +14,4 @@ public ActionPage(ActionViewModel viewModel)
InitializeComponent();
}
-
- private void TextBox_Scroll(object sender, System.Windows.Controls.Primitives.ScrollEventArgs e)
- {
-
- }
}
\ No newline at end of file
diff --git a/src/PipManager/Views/Pages/Library/LibraryInstallPage.xaml b/src/PipManager/Views/Pages/Library/LibraryInstallPage.xaml
index e622873..e327794 100644
--- a/src/PipManager/Views/Pages/Library/LibraryInstallPage.xaml
+++ b/src/PipManager/Views/Pages/Library/LibraryInstallPage.xaml
@@ -1,38 +1,37 @@
+ x:Class="PipManager.Views.Pages.Library.LibraryInstallPage"
+ x:Name="LibraryInstall"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:lang="clr-namespace:PipManager.Languages"
+ xmlns:library="clr-namespace:PipManager.Views.Pages.Library"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:pages="clr-namespace:PipManager.Models.Pages"
+ xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
-
+
-
+
+ IsEnabled="{Binding ElementName=AddDefaultTaskList, Path=Items.Count, Converter={StaticResource IntegerToBool}}"
+ Margin="5,0,0,0" />
-
+
@@ -70,33 +69,33 @@
+ Text="{Binding PackageName}"
+ VerticalAlignment="Center" />
+ IsChecked="{Binding VersionSpecified, Mode=TwoWay}"
+ x:Name="VersionSpecifiedCheckbox" />
-
+
-
+
+ Text="{Binding ViewModel.Requirements, Mode=TwoWay}"
+ x:Name="AddRequirementsTextBox" />
+ IsEnabled="{Binding ElementName=AddRequirementsTextBox, Path=Text, Converter={StaticResource StringIsNotNullOrEmpty}}"
+ Margin="0,10,0,0" />
-
+
-
+
@@ -202,33 +201,33 @@
+ Text="{Binding PackageName}"
+ VerticalAlignment="Center" />
+ IsChecked="{Binding VersionSpecified, Mode=TwoWay}"
+ x:Name="DownloadDistributionsVersionSpecifiedCheckbox" />
-
+
+ Text="{I18N {x:Static lang:LangKeys.LibraryInstall_Requirements_DownloadFolder}}"
+ VerticalAlignment="Center" />
+ Margin="10,0,0,0"
+ Text="{Binding ViewModel.DownloadDistributionsFolderPath, Mode=TwoWay}"
+ x:Name="DownloadDistributionsFolderBrowseTextBox" />
+ IsEnabled="{Binding ElementName=DownloadDistributionsTaskList, Path=Items.Count, Converter={StaticResource IntegerToBool}}"
+ Margin="5,0,0,0" />
+ IsEnabled="{Binding ViewModel.DownloadDistributionsEnabled}"
+ Margin="5,0,0,0" />