|
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Controls.Primitives;
- using System.Windows.Input;
-
- namespace BPA.UIControl
- {
- /// <summary>
- /// 滑动视图子项
- /// </summary>
- public class FlipViewItem : ListBoxItem
- {
- static FlipViewItem()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(FlipViewItem), new FrameworkPropertyMetadata(typeof(FlipViewItem)));
- }
-
- /// <inheritdoc/>
- public override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
- }
-
- /// <inheritdoc/>
- protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
- {
- // 取消鼠标左键点击选择,改成右击
- base.OnMouseRightButtonDown(e);
- }
-
- #region properties
-
- /// <summary>
- /// 索引
- /// </summary>
- public static readonly DependencyProperty IndexProperty =
- DependencyProperty.Register("Index", typeof(int), typeof(FlipViewItem), new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
-
- /// <summary>
- /// 索引
- /// </summary>
- public int Index
- {
- get { return (int)GetValue(IndexProperty); }
- set { SetValue(IndexProperty, value); }
- }
-
-
- #endregion
- }
- }
|