How do i get back a listbox item after a window closes in C# WPF RRS feed

  • Question

  • I have 1 Listbox it takes items from TextBox, when an item is added to the listbox and the application is closed, upon opening the application the item added to the listbox will still be present.

    Use case:

    • User opens application.
    • User adds item called "Item 1" to listbox using button.
    • User closes application.
    • User opens application again and sees that "Item 1" is still in the listbox, and the added item hasn't been lost by the application closing.
    • Moved by CoolDadTx Tuesday, April 21, 2020 1:48 PM WPF related
    Tuesday, April 21, 2020 6:59 AM

All replies

  • You can use any database solution. Add it to the database and then restore it from the database.

    If you are not sure which database solution you are using, you can use SQLite.

    TR| Sorunuzun yanıtı bu ise "Yanıt Olarak Öner" olarak işaretleyin, eğer faydalı bir yorum ise "Oy Ver"erek forumun işleyişine katkıda bulunabilirsiniz. EN| If this is the answer to your problem, mark "Propose as Answer" and if it is helpful, you can contribute to the workig of the forum by "Voting".

    Tuesday, April 21, 2020 1:10 PM
  • This forum is for C#-specific questions only. Your question is around managing data context in a WPF application. Please post your question on the new Microsoft Q&A forums and they can help you set up a data context.

    Michael Taylor http://www.michaeltaylorp3.net

    Tuesday, April 21, 2020 1:48 PM