You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System.Windows.Controls;
- using System.Windows.Controls.Primitives;
-
-
- namespace BPASmartClient.MilkWithTea.Control;
-
- /// <summary>
- /// 带上下文菜单的切换按钮
- /// </summary>
- public class ContextMenuToggleButton : ToggleButton
- {
- public ContextMenu Menu { get; set; }
-
- protected override void OnClick()
- {
- base.OnClick();
- if (Menu != null)
- {
- if (IsChecked == true)
- {
- Menu.PlacementTarget = this;
- Menu.IsOpen = true;
- }
- else
- {
- Menu.IsOpen = false;
- }
- }
- }
- }
|