File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
InternetTest/InternetTest Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ public class DownDetectorPageViewModel : ViewModelBase
6666 if ( Websites . Any ( x => x . Url == Site ) ) return ; // already exists
6767
6868 Websites . Add ( new WebsiteItemViewModel ( Site , this ) ) ;
69+ Site = string . Empty ;
6970 } ) ;
7071
7172 public ICommand TestWebsitesCommand => new RelayCommand ( o =>
@@ -130,12 +131,12 @@ public DownDetectorPageViewModel(Settings settings)
130131 {
131132 _settings = settings ;
132133 TimeInterval = _settings . DefaultTimeInterval ?? 10 ;
134+ Websites = [ .. _settings . DownDetectorWebsites ? . Select ( x => new WebsiteItemViewModel ( x , this ) ) ?? [ ] ] ;
133135 Websites . CollectionChanged += ( s , e ) =>
134136 {
135- OnPropertyChanged ( nameof ( HasWebsites ) ) ;
136137 _settings . DownDetectorWebsites = [ .. Websites . Select ( x => x . Url ) ] ;
137138 _settings . Save ( ) ;
139+ OnPropertyChanged ( nameof ( HasWebsites ) ) ;
138140 } ;
139- Websites = [ .. _settings . DownDetectorWebsites ? . Select ( x => new WebsiteItemViewModel ( x , this ) ) ?? [ ] ] ;
140141 }
141142}
Original file line number Diff line number Diff line change 7979 Margin =" 0 5"
8080 Padding =" 5"
8181 VerticalContentAlignment =" Center"
82- Text =" {Binding Site, UpdateSourceTrigger=PropertyChanged}" />
82+ Text =" {Binding Site, UpdateSourceTrigger=PropertyChanged}" >
83+ <TextBox .InputBindings>
84+ <KeyBinding Key =" Enter" Command =" {Binding AddWebsiteCommand}" />
85+ </TextBox .InputBindings>
86+ </TextBox >
8387 <StackPanel
8488 Grid.Row=" 3"
8589 VerticalAlignment =" Bottom"
You can’t perform that action at this time.
0 commit comments