void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Window = ((CarouselWPFTestApp.MainWindow)(target));
                return;

            case 2:
                this.lblSelectedItem = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.customPath = ((System.Windows.Shapes.Path)(target));
                return;

            case 4:
                this.CarouselControl = ((Carousel.CarouselControl)(target));

            #line 37 "..\..\MainWindow.xaml"
                this.CarouselControl.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.SelectionChanged);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.customPath = ((System.Windows.Shapes.Path)(target));
                return;

            case 2:
                this.CarouselControl = ((Carousel.CarouselControl)(target));

            #line 28 "..\..\..\Kitchen\KitchenWindow.xaml"
                this.CarouselControl.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.SelectionChanged);

            #line default
            #line hidden
                return;

            case 3:
                this.cmbTable = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 4:
                this.cmbProduct = ((System.Windows.Controls.ComboBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
        private static void OnNumberOfItemsOnPathChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            d.CoerceValue(MinNumberOfItemsOnPathProperty);  //invokes the CoerceValueCallback delegate ("CoerceMinNumberOfItemsOnPath")
            d.CoerceValue(MaxNumberOfItemsOnPathProperty);  //invokes the CoerceValueCallback delegate ("CoerceMaxNumberOfItemsOnPath")
            CarouselControl depObj = (CarouselControl)d;

            depObj.pathListBox.LayoutPaths[0].Capacity = (double)depObj.NumberOfItemsOnPath;
        }
        /// <summary>
        /// Coerce MaxNumberOfItemsOnPath value if not within limits
        /// </summary>
        private static object CoerceMaxNumberOfItemsOnPath(DependencyObject d, object value)
        {
            CarouselControl depObj = (CarouselControl)d;
            int             max    = (int)value;

            if (max < depObj.MinNumberOfItemsOnPath)
            {
                max = depObj.MinNumberOfItemsOnPath;
            }
            return(max);
        }
        /// <summary>
        /// Coerce NumberOfItemsOnPath value if not within limits
        /// </summary>
        private static object CoerceNumberOfItemsOnPath(DependencyObject d, object value)
        {
            CarouselControl depObj  = (CarouselControl)d;
            int             current = (int)value;

            if (current < depObj.MinNumberOfItemsOnPath)
            {
                current = depObj.MinNumberOfItemsOnPath;
            }
            if (current > depObj.MaxNumberOfItemsOnPath)
            {
                current = depObj.MaxNumberOfItemsOnPath;
            }
            return(current);
        }