22using Edge . Utilities ;
33using Microsoft . UI . Xaml . Controls ;
44using System ;
5- using System . Collections . Generic ;
65using System . Linq ;
7- using System . Text . Json ;
6+ using System . Text . Json . Nodes ;
87using Windows . Storage ;
98using Windows . Storage . Pickers ;
109using WinRT . Interop ;
@@ -13,7 +12,7 @@ namespace Edge
1312{
1413 public sealed partial class StartItem : Page
1514 {
16- public Dictionary < string , bool > ToolBar = JsonSerializer . Deserialize < Dictionary < string , bool > > ( App . settings [ "ToolBar" ] . ToJsonString ( ) ) ;
15+ public JsonObject ToolBar = App . settings [ "ToolBar" ] . AsObject ( ) ;
1716 public StartItem ( )
1817 {
1918 this . InitializeComponent ( ) ;
@@ -22,7 +21,7 @@ public StartItem()
2221 uriBox . Text = App . settings [ "SpecificUri" ] . ToString ( ) ;
2322 uriBox . IsEnabled = radios . SelectedIndex == 2 ;
2423
25- setHomeButton . IsOn = ToolBar [ "HomeButton" ] ;
24+ setHomeButton . IsOn = ToolBar [ "HomeButton" ] . GetValue < bool > ( ) ;
2625 searchEngineBox . ItemsSource = Info . SearchEngineList . Select ( x => x . Name ) ;
2726 searchEngineBox . SelectedItem = Info . SearchEngineList . Select ( x => x . Name ) . First ( name => name == App . settings [ "SearchEngine" ] . ToString ( ) ) ;
2827
@@ -39,7 +38,7 @@ private void SetStartUri(object sender, Microsoft.UI.Xaml.Input.KeyRoutedEventAr
3938 private void HomeButtonVisualChanged ( object sender , Microsoft . UI . Xaml . RoutedEventArgs e )
4039 {
4140 ToolBar [ "HomeButton" ] = setHomeButton . IsOn ;
42- App . settings [ "ToolBar" ] = JsonSerializer . SerializeToNode ( ToolBar ) ;
41+ App . settings [ "ToolBar" ] = ToolBar ;
4342 }
4443
4544 private void SearchEngineChanged ( object sender , SelectionChangedEventArgs e )
0 commit comments