How to save software pop-up user parameter "Settings"?

I created a custom AlarmSettingsPane in the settings, which allows the user to specify the time, as well as select a sound file for the alarm. Thus, I implemented the file collector in the charm settings. When I click the file selection button, it brings me to a new full-screen mode where I can select files, but when I select a file and open it, I am directed to the main screen but the settings pop-up window closes. How can I save the state of the AlarmSettingsPane popup and prevent it from closing programmatically? Like the settings, the popup should contain the same alarm message as it was before I selected the file.

SettingsPane.Show () opens the settings spell, but does not proceed to configure the alarm created inside the standard settings pop-up window.

Please let me know if you go at all. Thanks

here is my code for the file select button by clicking the button

private async void PickAFileButton_Click(object sender, RoutedEventArgs e) { FileOpenPicker openPicker = new FileOpenPicker(); openPicker.ViewMode = PickerViewMode.List; openPicker.SuggestedStartLocation = PickerLocationId.MusicLibrary; openPicker.FileTypeFilter.Add(".mp3"); openPicker.FileTypeFilter.Add(".wma"); StorageFile file = await openPicker.PickSingleFileAsync(); if (file != null) { // Application now has read/write access to the picked file CustomSound.Text = file.Name; } else { CustomSound.Text = "Operation cancelled."; } } 
+4
source share
3 answers

What I did was grab a copy of UserControl.Parent before calling Picker and save it locally in the function, this prevents the user interfaces from being marked for the collection, and after the collector returns, select the parent IsOpen back to the truth.

eg:

 private function () { Popup popup = this.Parent as Popup; Picker Code popup.IsOpen = true; } 

This may not be the best book, but it works well.

+3
source

See if the Popup / Popup IsLightDismissEnabled property is set to false.

+2
source

You can try to simulate the PLM (life cycle management) code so that whenever you upload your AlarmSettingsPane, you save the contents of the page and whenever it loads, you restore the state of the control. You can find sample code in the layout in the VS Split or Grid template.

Yours faithfully,

0
source

Source: https://habr.com/ru/post/1447930/


All Articles