async void OnClick3(object sender, RoutedEventArgs e) { Wrap.Children.Clear(); await LoadImages(25, RedditType, "hot"); ScrollIt.ScrollToVerticalOffset(0); ScrollLimit = .80; }
async void OnClick0(object sender = null, RoutedEventArgs e = null) { Wrap.Children.Clear(); //Garbage collection handles purging the objects from memory... I think. RedditType = Custom.Text; try // incase the subreddit being selected doesn't exist. { ScrollIt.ScrollToVerticalOffset(0); await LoadImages(25, Custom.Text); ScrollLimit = .80; } catch (Exception) // a Popup to inform the user should be displayed here. Maybe even wiggling the button with a red outline. { RedditType = "pics"; // adding this as a reset to a known good value, preventing other possible errors. } }