Example #1
0
 public MainWindowVM()
 {
     _infos                   = new List <EntryInfo>();
     EntryControlVM           = new EntryControlVM(_infos);
     ViewControlVM            = new ViewControlVM(_infos);
     EntryControlVM.Registed += (_, __) => ViewControlVM.Search();
 }
Example #2
0
        public void OpenFile()
        {
            var path = AskOpenFilePath();

            if (path.IsNullOrEmpty())
            {
                return;
            }
            _infos.Clear();
            try
            {
                _infos.AddRange(JsonConvert.DeserializeObject <List <EntryInfo> >(File.ReadAllText(path)));
            }
            catch (Exception e)
            {
                NotifyInfo(e.Message);
            }
            ViewControlVM.Search();
        }
Example #3
0
 public void CreateNewData()
 {
     _infos.Clear();
     ViewControlVM.Search();
 }