1- using GalaSoft . MvvmLight ;
2- using GalaSoft . MvvmLight . Command ;
1+ using CommunityToolkit . Mvvm . ComponentModel ;
2+ using CommunityToolkit . Mvvm . Input ;
33using System ;
44using System . Diagnostics ;
55using System . Windows . Input ;
@@ -14,7 +14,7 @@ public enum VoiceType { Default = 0, Female1 = 1, Female2 = 2, Male1 = 3, Male2
1414}
1515namespace BouyomiPlugin
1616{
17- class ConfigViewModel : ViewModelBase
17+ class ConfigViewModel : ObservableObject
1818 {
1919 private const int VoiceTypeSapi5Offset = 10001 ;
2020 private readonly int VoiceTypeLength = Enum . GetNames ( typeof ( FNF . Utility . VoiceType ) ) . Length ;
@@ -896,7 +896,6 @@ public ConfigViewModel()
896896 // throw new NotSupportedException();
897897 //}
898898 }
899- [ GalaSoft . MvvmLight . Ioc . PreferredConstructor ]
900899 public ConfigViewModel ( Options options )
901900 {
902901 _options = options ;
@@ -905,19 +904,19 @@ public ConfigViewModel(Options options)
905904 switch ( e . PropertyName )
906905 {
907906 case nameof ( _options . IsEnabled ) :
908- RaisePropertyChanged ( nameof ( IsEnabled ) ) ;
907+ OnPropertyChanged ( nameof ( IsEnabled ) ) ;
909908 break ;
910909 case nameof ( _options . BouyomiChanPath ) :
911- RaisePropertyChanged ( nameof ( ExeLocation ) ) ;
910+ OnPropertyChanged ( nameof ( ExeLocation ) ) ;
912911 break ;
913912 case nameof ( _options . IsReadHandleName ) :
914- RaisePropertyChanged ( nameof ( IsReadHandleName ) ) ;
913+ OnPropertyChanged ( nameof ( IsReadHandleName ) ) ;
915914 break ;
916915 case nameof ( _options . IsReadComment ) :
917- RaisePropertyChanged ( nameof ( IsReadComment ) ) ;
916+ OnPropertyChanged ( nameof ( IsReadComment ) ) ;
918917 break ;
919918 case nameof ( _options . IsVoiceTypeSpecfied ) :
920- RaisePropertyChanged ( nameof ( IsVoiceTypeSpecfied ) ) ;
919+ OnPropertyChanged ( nameof ( IsVoiceTypeSpecfied ) ) ;
921920 break ;
922921 }
923922 } ;
0 commit comments