I am creating a software in WPF, and, in the software, the User can load an image, and configure a map.
Basically, once the Image (of a map) is loaded the user can add
Perhaps you could save the Windows xaml on exit and reload on application start.
public MainWindow()
{
InitializeComponent();
Loaded += new RoutedEventHandler(MainWindow_Loaded);
Closing += new CancelEventHandler(MainWindow_Closing);
}
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
LoadExternalXaml();
}
void MainWindow_Closing(object sender, CancelEventArgs e)
{
SaveExternalXaml();
}
public void LoadExternalXaml()
{
if (File.Exists(@"C:\Test.xaml"))
{
using (FileStream stream = new FileStream(@"C:\Test.xaml", FileMode.Open))
{
this.Content = XamlReader.Load(stream);
}
}
}
public void SaveExternalXaml()
{
using (FileStream stream = new FileStream(@"C:\Test.xaml", FileMode.Create))
{
XamlWriter.Save(this.Content, stream);
}
}