简体   繁体   中英

Saving Data On C# Wpf

How can I save my added buttons when closing the program ? Each time I hit an add button I'm creating a new title which type is button.And each title have it's own specific words.So I must save the words in buttons at the same time.

在此处输入图片说明

  • Find out what data needs to be stored. > Define a Model
  • Define how the Data will be stored > eg XML-Serialisation, JSON or whatever
  • Define where Data will be stored, eg Database, File
  • Define when the Configuration is read and saved
    • eg: read on startup, save on shutdown
  • Handle your Configuration Data to generate your buttons

Its all up to you. :)

An easy solution might be using XmlSerializer , which is documented here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM