Persisting foldername property value in models

1 Answer 41 Views
FileDialogs
Jonathan
Top achievements
Rank 1
Iron
Jonathan asked on 30 Apr 2022, 09:55 PM

I have a property called FolderName which is bound in storage view.xaml. I set this value with folder dialog. However if I call that value from within storage view or another view.cs its always defaulted. How do I persist the values across the running app. In code base I had to hardcover value.

https://github.com/CrownParkComputing/MegaDownloaderFinal

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 03 May 2022, 07:24 AM

Hi Jonathan,

I can see in your click function:

 private void SelectFolderClick(object sender, RoutedEventArgs e)
        {
            RadOpenFolderDialog openFolderDialog = new RadOpenFolderDialog();
you can making new instance of the dialog every time. Instead, why not using the dialog as a private fields in this view - first, you will preserve runtime set properties of the dialog and second, load time for every new showing of dialog will be faster than creating a new dialog and showing it. 

Let me know if the suggested approach is an option or if not, please add more details regarding the scenario.

Regards,
Petar Mladenov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
FileDialogs
Asked by
Jonathan
Top achievements
Rank 1
Iron
Answers by
Petar Mladenov
Telerik team
Share this question
or