BeFriend.Views.CallandSmsSettings.UserNameSaveIcon_OnTapped C# (CSharp) Метод

UserNameSaveIcon_OnTapped() приватный Метод

private UserNameSaveIcon_OnTapped ( object sender, TappedRoutedEventArgs e ) : void
sender object
e Windows.UI.Xaml.Input.TappedRoutedEventArgs
Результат void
        private void UserNameSaveIcon_OnTapped(object sender, TappedRoutedEventArgs e)
        {
            var localData = ApplicationData.Current.LocalSettings;
            var roamData = ApplicationData.Current.RoamingSettings;
            if (!localData.Values.ContainsKey("UserName") && !roamData.Values.ContainsKey("UserName"))
            {
                localData.Values.Add("UserName", UserNameTextBox.Text);
                roamData.Values.Add("UserName", UserNameTextBox.Text);
            }
            else
            {
                localData.Values.Remove("UserName");
                roamData.Values.Remove("UserName");
                localData.Values.Add("UserName", UserNameTextBox.Text);
                roamData.Values.Add("UserName", UserNameTextBox.Text);
            }

            UserNameEditIcon.Visibility = Visibility.Visible;
            UserNameSaveIcon.Visibility = Visibility.Collapsed;
            UserNameTextBox.Visibility = Visibility.Collapsed;
            UserNameTextBlock.Visibility = Visibility.Visible;
            UserNameTextBlock.Text = UserNameTextBox.Text;

            var cspvm = new CallandSettingsPageViewModel();
            cspvm.UserNameSaver(UserNameTextBlock.Text);
        }