@@ -13,60 +13,60 @@ namespace Edge
1313{
1414 public sealed partial class StartItem : Page
1515 {
16- public Dictionary < string , bool > ToolBar = JsonSerializer . Deserialize < Dictionary < string , bool > > ( App . settings [ "ToolBar" ] . ToString ( ) ) ;
16+ public Dictionary < string , bool > ToolBar = JsonSerializer . Deserialize < Dictionary < string , bool > > ( App . settings [ "ToolBar" ] . ToJsonString ( ) ) ;
1717 public StartItem ( )
1818 {
1919 this . InitializeComponent ( ) ;
20- radios . SelectedIndex = App . settings [ "StartBehavior" ] . GetInt32 ( ) ;
20+ radios . SelectedIndex = App . settings [ "StartBehavior" ] . GetValue < int > ( ) ;
2121
22- uriBox . Text = App . settings [ "SpecificUri" ] . GetString ( ) ;
22+ uriBox . Text = App . settings [ "SpecificUri" ] . ToString ( ) ;
2323 uriBox . IsEnabled = radios . SelectedIndex == 2 ;
2424
2525 setHomeButton . IsOn = ToolBar [ "HomeButton" ] ;
2626 searchEngineBox . ItemsSource = Info . SearchEngineList . Select ( x => x . Name ) ;
2727 searchEngineBox . SelectedItem = Info . SearchEngineList . Select ( x => x . Name ) . First ( name => name == App . settings [ "SearchEngine" ] . ToString ( ) ) ;
2828
29- showSuggestUri . IsOn = App . settings [ "ShowSuggestUri" ] . GetBoolean ( ) ;
29+ showSuggestUri . IsOn = App . settings [ "ShowSuggestUri" ] . GetValue < bool > ( ) ;
3030
31- showBackground . IsOn = backgroundCard . IsEnabled = App . settings [ "ShowBackground" ] . GetBoolean ( ) ;
31+ showBackground . IsOn = backgroundCard . IsEnabled = App . settings [ "ShowBackground" ] . GetValue < bool > ( ) ;
3232 }
3333
3434 private void SetStartUri ( object sender , Microsoft . UI . Xaml . Input . KeyRoutedEventArgs e )
3535 {
36- App . settings [ "SpecificUri" ] = App . ToJsonElement ( uriBox . Text ) ;
36+ App . settings [ "SpecificUri" ] = uriBox . Text ;
3737 }
3838
3939 private void HomeButtonVisualChanged ( object sender , Microsoft . UI . Xaml . RoutedEventArgs e )
4040 {
4141 ToolBar [ "HomeButton" ] = setHomeButton . IsOn ;
42- App . settings [ "ToolBar" ] = App . ToJsonElement ( ToolBar ) ;
42+ App . settings [ "ToolBar" ] = JsonSerializer . SerializeToNode ( ToolBar ) ;
4343 }
4444
4545 private void SearchEngineChanged ( object sender , SelectionChangedEventArgs e )
4646 {
47- App . settings [ "SearchEngine" ] = App . ToJsonElement ( Info . SearchEngineList . Where ( x => x . Name == ( string ) searchEngineBox . SelectedItem ) . First ( ) . Name ) ;
47+ App . settings [ "SearchEngine" ] = Info . SearchEngineList . Where ( x => x . Name == ( string ) searchEngineBox . SelectedItem ) . First ( ) . Name ;
4848 }
4949
5050 private void BehaviorChanged ( object sender , SelectionChangedEventArgs e )
5151 {
5252 uriBox . IsEnabled = radios . SelectedIndex == 2 ;
53- App . settings [ "StartBehavior" ] = App . ToJsonElement ( radios . SelectedIndex ) ;
53+ App . settings [ "StartBehavior" ] = radios . SelectedIndex ;
5454 if ( radios . SelectedIndex != 2 )
5555 {
5656 uriBox . Text = string . Empty ;
57- App . settings [ "SpecificUri" ] = App . ToJsonElement ( uriBox . Text ) ;
57+ App . settings [ "SpecificUri" ] = uriBox . Text ;
5858 }
5959 }
6060
6161 private void SuggestUriVisualChanged ( object sender , Microsoft . UI . Xaml . RoutedEventArgs e )
6262 {
63- App . settings [ "ShowSuggestUri" ] = App . ToJsonElement ( showSuggestUri . IsOn ) ;
63+ App . settings [ "ShowSuggestUri" ] = showSuggestUri . IsOn ;
6464 }
6565
6666 private void ShowBackgroundChanged ( object sender , Microsoft . UI . Xaml . RoutedEventArgs e )
6767 {
6868 backgroundCard . IsEnabled = showBackground . IsOn ;
69- App . settings [ "ShowBackground" ] = App . ToJsonElement ( showBackground . IsOn ) ;
69+ App . settings [ "ShowBackground" ] = showBackground . IsOn ;
7070 }
7171
7272 private async void SetBackgroundImage ( object sender , Microsoft . UI . Xaml . RoutedEventArgs e )
@@ -85,7 +85,7 @@ private async void SetBackgroundImage(object sender, Microsoft.UI.Xaml.RoutedEve
8585 InitializeWithWindow . Initialize ( picker , this . GetWindowHandle ( ) ) ;
8686
8787 StorageFile storageFile = await picker . PickSingleFileAsync ( ) ;
88- App . settings [ "BackgroundImage" ] = App . ToJsonElement ( storageFile . Path ) ;
88+ App . settings [ "BackgroundImage" ] = storageFile . Path ;
8989 }
9090 }
9191}
0 commit comments