示例#1
0
 public void SetOnlineDict(IOnlineDict dict)
 {
     vmDict = new OnlineDictViewModel(vmSettings, dict);
     vmSettings.WhenAnyValue(x => x.SelectedDictReference).Where(v => v != null).Subscribe(async v =>
     {
         vmDict.Dict = v;
         await vmDict.SearchDict();
     });
     this.WhenAnyValue(x => x.CurrentWordIndex).Subscribe(async v =>
     {
         vmDict.Word = Words[CurrentWordIndex];
         await vmDict.SearchDict();
     });
 }
示例#2
0
 public SearchViewModel(SettingsViewModel vmSettings, IOnlineDict dict)
 {
     this.vmSettings = vmSettings;
     vmDict          = new OnlineDictViewModel(vmSettings, dict);
     vmSettings.WhenAnyValue(x => x.SelectedDictReference).Where(v => v != null).Subscribe(async v =>
     {
         vmDict.Dict = v;
         await vmDict.SearchDict();
     });
     vmDict.WhenAnyValue(x => x.Word).Skip(1).Subscribe(async v =>
     {
         await vmDict.SearchDict();
     });
 }