AppStore.SettingsDialog.ContentDialog_PrimaryButtonClick C# (CSharp) Method

ContentDialog_PrimaryButtonClick() private method

Method which is executed when the user taps on the "apply" button in the SettingsDialog.
private ContentDialog_PrimaryButtonClick ( ContentDialog sender, ContentDialogButtonClickEventArgs args ) : void
sender ContentDialog Object Sender is a parameter called Sender that contains a reference to the control/object that raised the event.
args ContentDialogButtonClickEventArgs EventArgs e is a parameter called e that contains the event data, see the EventArgs MSDN page for more information.
return void
        private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {
            int fc = 4, fa = 6;
            if (Int32.TryParse(featured_categories.Text, out fc))
            {
                if (fc >= 10)
                    featured_categories.Text = 10 + "";
                if (fc <= 4)
                    featured_categories.Text = 4 + "";
            }
            else featured_categories.Text = 4 + "";
            if (Int32.TryParse(featured_apps.Text, out fa))
            {
                if (fa >= AppList.getAppList().appList.Count)
                    featured_apps.Text = AppList.getAppList().appList.Count + "";
                if (fa <= 6)
                    featured_apps.Text = 6 + "";
            }
            else featured_apps.Text = 6 + "";
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            localSettings.Values["Featured_Categories"] = featured_categories.Text;
            localSettings.Values["Featured_Apps"] = featured_apps.Text;
        }