Exemple #1
0
 void InitializeContextMenu()
 {
     _autoFitContentMenuPopup = new Windows.UI.Xaml.Controls.Primitives.Popup();
     AutoFillType[] items = new AutoFillType[4];
     items[1]        = AutoFillType.FillSeries;
     items[2]        = AutoFillType.FillFormattingOnly;
     items[3]        = AutoFillType.FillWithoutFormatting;
     _autoFitListBox = new DragFillContextMenu(items, AutoFillType.CopyCells);
     _autoFitListBox.SelectedAutoFitTypeChanged += new EventHandler(_autoFitListBox_SelectedAutoFitTypeChanged);
 }
Exemple #2
0
        /// <summary>
        /// Creates a new instance of the <see cref="T:DragFillContextMenu" /> class.
        /// </summary>
        /// <param name="items">The automatic fill items.</param>
        /// <param name="defaultType">The default checked automatic fill item.</param>
        public DragFillContextMenu(AutoFillType[] items, AutoFillType defaultType)
        {
            base.DefaultStyleKey = typeof(DragFillContextMenu);
            _rootGrid            = new StackPanel();
            base.Content         = _rootGrid;
            DragFillContextMenu menu = this;

            menu.Loaded += DragFillContextMenu_Loaded; _selectedType = defaultType;
            Items        = items;
            DragFillContextMenu menu2 = this;

            menu2.PointerPressed += OnDragFillContextMenuPointerPressed;
        }