private void btnUpdateSettings_Click(object sender, RoutedEventArgs e) { OptionsFormManagement.FromForm(this, options); Properties.Settings.Default.Uri = options.Uri; Properties.Settings.Default.retrySeconds = (options.msReAccess / 1000); Properties.Settings.Default.Save(); OptionsFormManagement.ToFormAllData(this, options); }
public MainWindow() { InitializeComponent(); options = new Options() { Uri = Properties.Settings.Default.Uri.ToString(), msReAccess = ((Properties.Settings.Default.retrySeconds.ToString().TryParse(120)) * 1000), Started = DateTime.Now }; OptionsFormManagement.ToFormAllData(this, options); AccessUri access = new AccessUri(); Task.Run(() => access.Get(options)); // todo: switch to backgroundworker or full MVVM System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); dispatcherTimer.Tick += (s, e) => { OptionsFormManagement.ToFormInternalUpdatedData(this, options); }; dispatcherTimer.Interval = new TimeSpan(0, 0, 10); dispatcherTimer.Start(); }