コード例 #1
0
        private static void VerticalScrollOffsetPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            RibbonGallery g     = (RibbonGallery)o;
            double        value = (double)e.NewValue;

            g.OnVerticalScrollOffsetPropertychanged(value);
        }
コード例 #2
0
        int GetGalleryColumns(DependencyObject control, int level, int maxLevels)
        {
            RibbonGalleryColumns columns = RibbonGallery.GetReductionColumns(control);

            if (columns != null && columns.Count > 0)
            {
                level = Math.Max(0, Math.Min(level, columns.Count - 1));
                return(columns[level]);
            }

            if (level == maxLevels)
            {
                return(0);
            }

            if (maxLevels > 4)
            {
                level = Math.Max(level, 8);
                return(3 + (4 - level / 2));
            }
            else
            {
                return(3 + (2 - level) * 2);
            }
        }
コード例 #3
0
        private static void scrollDownCommand(object sender, ExecutedRoutedEventArgs e)
        {
            RibbonGallery gallery = (RibbonGallery)sender;

            //RoutedEventArgs args = new RoutedEventArgs(LaunchDialogEvent);
            //gallery.RaiseEvent(args);
            gallery.ScrollDown();
        }
コード例 #4
0
ファイル: RibbonGallery.cs プロジェクト: gmcclelland90/FAP
        static void ReductionColumnsPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            RibbonGallery g = o as RibbonGallery;

            if (g != null)
            {
                RibbonGalleryColumns columns = e.NewValue as RibbonGalleryColumns;
                if (columns != null && columns.Count > 0)
                {
                    g.Columns = columns[0];
                }
            }
        }
コード例 #5
0
ファイル: RibbonGallery.cs プロジェクト: gmcclelland90/FAP
        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
        {
            base.PrepareContainerForItemOverride(element, item);
            RibbonThumbnail tn = element as RibbonThumbnail;

            if (tn != null)
            {
                tn.Width  = ThumbnailSize.Width;
                tn.Height = CalculateInRibbonThumbnailHeight();
                Stretch stretch = RibbonGallery.GetStretch(this);
                RibbonGallery.SetStretch(tn, stretch);
            }
        }
コード例 #6
0
        protected override void OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e)
        {
            base.OnMouseLeftButtonUp(e);

            // also close the poupup when the item is already selected:
            if (this.IsFocused)
            {
                RibbonGallery g = Gallery;
                if (g != null)
                {
                    g.IsDropDownOpen = false;
                }
            }
        }
コード例 #7
0
        //Gets the maximum possible ReductionLevel that would change any of the controls.
        private int GetMaxLevel()
        {
            int max = 1;

            foreach (UIElement e in Controls)
            {
                if (e is IRibbonControl)
                {
                    RibbonSizeCollection reduction = RibbonBar.GetReduction(e);
                    int m = reduction != null ? reduction.Count : 3;
                    max = Math.Max(max, m);
                }
                if (e is IRibbonGallery)
                {
                    RibbonGalleryColumns columns = RibbonGallery.GetReductionColumns(e);
                    int m = columns != null ? columns.Count : 3;
                    max = Math.Max(max, m);
                }
            }
            return(max);
        }
コード例 #8
0
ファイル: RibbonGallery.cs プロジェクト: gmcclelland90/FAP
        public static void HotThumbnailPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            RibbonGallery g = (RibbonGallery)o;

            g.OnHotThumbnailChanged(e);
        }
コード例 #9
0
ファイル: RibbonGallery.cs プロジェクト: gmcclelland90/FAP
        public static void DropDownOpenPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            RibbonGallery g = (RibbonGallery)o;

            g.DropDownOpenChanged(e);
        }
コード例 #10
0
ファイル: RibbonGallery.cs プロジェクト: gmcclelland90/FAP
        public static void ColumnsPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            RibbonGallery g = (RibbonGallery)o;

            g.OnColumnsChanged(e);
        }