예제 #1
0
        private void OnIsCheckedChanged()
        {
            if (m_hasLoaded)
            {
                var eventArgs = new ToggleSplitButtonIsCheckedChangedEventArgs();
                IsCheckedChanged?.Invoke(this, eventArgs);
                var peer = FrameworkElementAutomationPeer.FromElement(this);
                if (peer != null)
                {
                    var newValue = IsChecked ? ToggleState.On : ToggleState.Off;
                    var oldValue = (newValue == ToggleState.On) ? ToggleState.Off : ToggleState.On;
                    peer.RaisePropertyChangedEvent(TogglePatternIdentifiers.ToggleStateProperty, oldValue, newValue);
                }
            }

            UpdateVisualStates();
        }
예제 #2
0
 private void MyListButton_IsCheckedChanged(Microsoft.UI.Xaml.Controls.ToggleSplitButton sender, Microsoft.UI.Xaml.Controls.ToggleSplitButtonIsCheckedChangedEventArgs args)
 {
     if (sender.IsChecked)
     {
         //add bulleted list
         myRichEditBox.Document.Selection.ParagraphFormat.ListType = _type;
     }
     else
     {
         //remove bulleted list
         myRichEditBox.Document.Selection.ParagraphFormat.ListType = MarkerType.None;
     }
 }
예제 #3
0
 private void ToggleSplitButton_IsCheckedChanged(MUXC.ToggleSplitButton sender, MUXC.ToggleSplitButtonIsCheckedChangedEventArgs args)
 {
     // Use the toggle button to turn the selected list style on or off.
     if (((MUXC.ToggleSplitButton)sender).IsChecked)
     {
         // On. Apply the list style selected in the drop down to the selected text.
         var listStyle = ((FrameworkElement)(ListStylesListView.SelectedItem))?.Tag.ToString();
         ApplyListStyle(listStyle);
     }
     else
     {
         // Off. Make the selected text not a list,
         // but don't change the list style selected in the drop down.
         ApplyListStyle("none");
     }
 }
예제 #4
0
 private void CategoryButton_IsCheckedChanged(Microsoft.UI.Xaml.Controls.ToggleSplitButton sender, Microsoft.UI.Xaml.Controls.ToggleSplitButtonIsCheckedChangedEventArgs args)
 {
     SearchBox.Text = "";
     if (sender.IsChecked)
     {
         // Filter is enabled
         FilterByCategory();
     }
     else
     {
         // Filter is disabled
         Projects = new ObservableCollection <Project>(AllProjects);
         // Must call Sort() here because FilterByCategory() won't
         // do it for us in this branch
         Sort();
     }
     Bindings.Update();
 }