예제 #1
0
 private void TabMouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left && ShowCloseButton != CloseState.None && !HideCloseButtonIndex.Any(k => k == SelectedIndex))//是鼠标右击,并且是显示关闭按钮
     {
         //计算关闭区域
         Rectangle tabRect = this.GetTabRect(this.SelectedIndex);
         //如果鼠标在区域内就关闭选项卡
         if (e.X >= (tabRect.Right - CLOSE_IMAGE_WIDTH - 1) && e.X < tabRect.Right && e.Y >= tabRect.Y && e.Y <= tabRect.Y + CLOSE_IMAGE_WIDTH)
         {
             CloseButtonClickEvent?.Invoke(this, e);
             //Console.WriteLine($"点击关闭按钮事件,当前坐标为{e.X},{e.Y},点击关闭的选项卡Index为【{this.SelectedIndex}】");
         }
     }
 }
예제 #2
0
 private void OnCloseButtonClickHandler()
 {
     CloseButtonClickEvent?.Invoke();
 }
예제 #3
0
 private void BtnClose_Click(object sender, RoutedEventArgs e)
 {
     CloseButtonClickEvent.BeginInvoke(BtnClose, null, null, null);
 }
예제 #4
0
 private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
 {
     CloseButtonClickEvent?.Invoke(sender, args);
 }