Skip to content

Commit

Permalink
升级依赖库,替换废弃库
Browse files Browse the repository at this point in the history
  • Loading branch information
YJammak committed Dec 24, 2024
1 parent df53bce commit 117e56b
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 35 deletions.
9 changes: 4 additions & 5 deletions src/WeatherCalendar/Views/CalendarWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using ReactiveUI;
using Splat;
using System;
using System;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using ReactiveMarbles.ObservableEvents;
using ReactiveUI;
using Splat;
using WeatherCalendar.Services;
using WeatherCalendar.ViewModels;

Expand Down
14 changes: 6 additions & 8 deletions src/WeatherCalendar/Views/DayView.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using ReactiveUI;
using Splat;
using System;
using System;
using System.Globalization;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading.Tasks;
using System.Windows;
using ReactiveMarbles.ObservableEvents;
using ReactiveUI;
using Splat;
using WeatherCalendar.Themes;

namespace WeatherCalendar.Views;
Expand Down Expand Up @@ -380,7 +381,7 @@ private void WhenActivated(CompositeDisposable disposable)
view => view.RemoveHolidayMenuItem)
.DisposeWith(disposable);

this.ViewModel
ViewModel!
.GetHolidayInfoInteraction
.RegisterHandler(async interaction =>
{
Expand All @@ -392,10 +393,7 @@ private void WhenActivated(CompositeDisposable disposable)

editWindow.Show();

while (editWindow.IsVisible)
{
await Task.Delay(10);
}
while (editWindow.IsVisible) await Task.Delay(10);

if (editWindow.ViewModel!.IsConfirmed)
interaction.SetOutput((editWindow.ViewModel!.HolidayName, editWindow.ViewModel!.IsRestDay));
Expand Down
6 changes: 3 additions & 3 deletions src/WeatherCalendar/Views/EditHolidayWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using ReactiveUI;
using System;
using System;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Windows;
using System.Windows.Controls.Primitives;
using ReactiveMarbles.ObservableEvents;
using ReactiveUI;
using WeatherCalendar.ViewModels;

namespace WeatherCalendar.Views;
Expand Down
8 changes: 4 additions & 4 deletions src/WeatherCalendar/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using ReactiveUI;
using Splat;
using System;
using System;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Media;
using ReactiveMarbles.ObservableEvents;
using ReactiveUI;
using Splat;
using WeatherCalendar.Services;
using WeatherCalendar.Themes;
using WeatherCalendar.Utils;
Expand Down
8 changes: 4 additions & 4 deletions src/WeatherCalendar/Views/SelectCityWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using ReactiveUI;
using System;
using System;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Windows;
using System.Windows.Controls.Primitives;
using ReactiveMarbles.ObservableEvents;
using ReactiveUI;
using WeatherCalendar.ViewModels;

namespace WeatherCalendar.Views;
Expand Down Expand Up @@ -94,7 +94,7 @@ private void WhenActivated(CompositeDisposable disposable)
mode => mode.UpdateWeatherCommand,
view => view.OkButton);

this.ViewModel
ViewModel!
.UpdateSuccessInteraction
.RegisterHandler(interaction =>
{
Expand Down
19 changes: 10 additions & 9 deletions src/WeatherCalendar/Views/SettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using ReactiveUI;
using System;
using System;
using System.Globalization;
using System.IO;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Forms;
using Microsoft.Win32;
using ReactiveMarbles.ObservableEvents;
using ReactiveUI;
using WeatherCalendar.ViewModels;

namespace WeatherCalendar.Views;
Expand Down Expand Up @@ -159,14 +159,15 @@ private void WhenActivated(CompositeDisposable disposable)
.Click
.Select(_ =>
{
var dialog = new FolderBrowserDialog();
dialog.UseDescriptionForTitle = true;
dialog.Description = @"选择天气图标路径";
var dialog = new OpenFolderDialog
{
Title = "选择天气图标路径"
};

if (dialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
if (dialog.ShowDialog() != true)
return null;

return dialog.SelectedPath;
return dialog.FolderName;
})
.Where(path => !string.IsNullOrWhiteSpace(path) && Directory.Exists(path))
.BindTo(this, window => window.ViewModel.CustomWeatherIconPath)
Expand Down
5 changes: 3 additions & 2 deletions src/WeatherCalendar/WeatherCalendar.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Authors>YJammak</Authors>
<Product>天气日历</Product>
<PackageProjectUrl>https://github.com/YJammak/Weather</PackageProjectUrl>
<UseWindowsForms>True</UseWindowsForms>
</PropertyGroup>

<ItemGroup>
Expand All @@ -30,12 +31,12 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.1.4" />
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.2.0" />
<PackageReference Include="MaterialDesignThemes" Version="5.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NPinyin.Core" Version="3.0.0" />
<PackageReference Include="ReactiveUI.Events.WPF" Version="15.1.1" />
<PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.3.1" />
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
<PackageReference Include="ReactiveUI.Validation" Version="4.1.1" />
<PackageReference Include="ReactiveUI.WPF" Version="20.1.63" />
Expand Down

0 comments on commit 117e56b

Please sign in to comment.