Thorin
Thorin

Reputation: 1

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.

enter image description here

Upvotes: 0

Views: 1831

Answers (1)

LuckyLikey
LuckyLikey

Reputation: 3850

  • Find out what data needs to be stored. > Define a Model
  • Define how the Data will be stored > e.g. XML-Serialisation, JSON or whatever
  • Define where Data will be stored, e.g. 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.

Upvotes: 1

Related Questions