Inheritance: INotifyPropertyChanged
Exemple #1
0
        public void ShowAutoCorrectionPopup(bool isEdit, HandwritingSettingsModel.CorrectionStructure correctionStructure)
        {
            var mypane = new EditAutoCorrectorWordFlyout { Width = MainPage.SettingsWidth, Height = MainPage.Current.WindowBounds.Height };

            Current.SettingsPopup.Child = mypane;

            Current.SettingsPopup.SetValue(Canvas.LeftProperty,
                                    SettingsPane.Edge == SettingsEdgeLocation.Right
                                        ? (MainPage.Current.WindowBounds.Width - MainPage.SettingsWidth)
                                        : 0);
            Current.SettingsPopup.SetValue(Canvas.TopProperty, 0);

            if (isEdit)
            {
                if (correctionStructure == null)
                    return;
                mypane.EditWordCorrectionTitle.Text = "Edit word pair";
                mypane.AutocorrectDeleteButton.Visibility = Visibility.Visible;

                mypane.AutoCorrectionAlwaysReplace.IsOn = correctionStructure.IsAlwaysReplace;
                mypane.AutoCorrectionDisabled.IsOn = correctionStructure.IsDisabled;
                mypane.AutoCorrectionIgnoreCase.IsOn = correctionStructure.IsIgnoreCase;
                mypane.AutoCorrectionFirstWord.Text = correctionStructure.FirstWord;
                mypane.AutoCorrectionSecondWord.Text = correctionStructure.SecondWord;
            }
            else
            {
                mypane.EditWordCorrectionTitle.Text = "New word pair";
                mypane.AutocorrectDeleteButton.Visibility = Visibility.Collapsed;

                mypane.AutoCorrectionAlwaysReplace.IsOn = true;
                mypane.AutoCorrectionDisabled.IsOn = false;
                mypane.AutoCorrectionIgnoreCase.IsOn = true;
                mypane.AutoCorrectionFirstWord.Text = string.Empty;
                mypane.AutoCorrectionSecondWord.Text = string.Empty;
            }
            SelectedCorrectionStructure = correctionStructure;
            Current.SettingsPopup.IsOpen = true;

        }
 public HandwritingSettingsViewModel()
 {
     SettingsModel = new HandwritingSettingsModel();
 }