Пример #1
0
        public IconsSettingsRepository(string fileUri)
        {
            _fileUri = fileUri;

            if (File.Exists(_fileUri))
            {
                string json = File.ReadAllText(_fileUri);
                try
                {
                    _settings = json.ParseJsonTo <IconsSettings>();
                }
                catch (JsonSerializationException e)
                {
                    _settings = new IconsSettings();
                }
            }
            else
            {
                _settings = new IconsSettings();
            }

            _settings.PropertyChanged += OnSettingsChanged;
        }
Пример #2
0
 public IconsContextMenu(Settings.IconsSettings iconsSettings)
 {
     DataContext = iconsSettings;
     InitializeComponent();
 }