private void LoadDB(StartControl startControl) { string tempFolder = System.IO.Path.GetDirectoryName(Environment.GetFolderPath(Environment.SpecialFolder.Desktop)) + @"\Documents\RentFlatData\"; string dbFileName = "RentFlatDB.txt"; string fullDBFilePath = tempFolder + "\\" + dbFileName; if (!Directory.Exists(tempFolder)) { Directory.CreateDirectory(tempFolder); return; } if (!File.Exists(fullDBFilePath)) { return; } using (StreamReader reader = new StreamReader(fullDBFilePath)) { string data = reader.ReadToEnd(); if (data != null) { List <Item> items = JsonConvert.DeserializeObject <List <Item> >(data); Message = items.Last <Item>().Name; } } }
public MainWindow() { InitializeComponent(); HideLeftPanel(); ApplicationStartup applicationStartup = new ApplicationStartup(); applicationStartup.Run(); startControl = new StartControl(MainNavigationHendler); leftNavigationControl = new LeftNavigationControl(MainNavigationHendler); Column0.Children.Add(leftNavigationControl); Column1.Children.Add(startControl); }