public MainWindow() { InitializeComponent(); if (!string.IsNullOrEmpty(Settings1.Default.LastConeMap)) { DataModel = DataModel.Load(Settings1.Default.LastConeMap); ViewModel = new ViewModel(DataModel, canvas1); canvas1.Background = ViewModel.ImageBrush; } }
private void Open_Click(object sender, RoutedEventArgs e) { OpenFileDialog d = new OpenFileDialog { Filter = "JSON Files|*.json|All Files|*.*", DefaultExt = "json" }; if (d.ShowDialog() ?? false) { ConeMapFileName = d.FileName; DataModel = DataModel.Load(d.FileName); canvas1.Background = ViewModel.ImageBrush; Settings1.Default.LastConeMap = ConeMapFileName; Settings1.Default.Save(); } }