Пример #1
0
        /// <summary>
        /// Adjust the top and bottom gloss rectangles to fit the new geometry of the control.
        /// </summary>
        /// <param name="sizeInfo">The new geometry information.</param>
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            double height = sizeInfo.NewSize.Height;
            double width = sizeInfo.NewSize.Width;

            // topGloss should be half the height of the container
            topGloss.Height = height / 2;
            topGloss.Width = width;

            // bottomGloss should be 40% of the height of the container and
            // its top set at the 40% Y value of the height of the container
            Thickness margin = new Thickness();
            margin.Left = bottomGloss.Margin.Left;
            margin.Top = height * 0.35;
            margin.Right = bottomGloss.Margin.Right;
            margin.Bottom = bottomGloss.Margin.Bottom;

            bottomGloss.Height = height * 0.45;
            bottomGloss.Width = width;
            bottomGloss.Margin = margin;

            // clip off the top rounded corners
            bottomGloss.Clip = new RectangleGeometry(
                new Rect(0, 3, bottomGloss.Width, bottomGloss.Height - 3));
        }
Пример #2
0
 protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
 {
     if(sizeInfo.NewSize.Width > 0)
     {
         base.OnRenderSizeChanged(sizeInfo);
     }
 }
Пример #3
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            // If we don't do this, HwndHost doesn't seem to pick up on all size changes.
            UpdateWindowPos();

            base.OnRenderSizeChanged(sizeInfo);
        }
Пример #4
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            ResetTransformOrigin();
            UpdateTransform();
        }
Пример #5
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            if (ItemsSource == null || ItemsSource.Count == 0 || ScrollViewer == null) return;

            var screenTopRowIndex = GetScreenTopRowIndex();
            var count = GetDesiredDisplayCount();

            if (ItemsSource.Count <= (screenTopRowIndex + count) && sizeInfo.PreviousSize.Height < sizeInfo.NewSize.Height)
            {
                var gap = sizeInfo.NewSize.Height - sizeInfo.PreviousSize.Height;
                if (gap < RowHeight)
                {
                    if (sizeInfo.PreviousSize.Height < RowHeight)
                        ScrollViewer.ScrollToEnd();
                }
                else
                {
                   //以下2行位查明意图
                   //xvar offset = gap / RowHeight * ScrollViewer.ExtentHeight / ItemsSource.Count;
                   //xScrollViewer.ScrollToVerticalOffset(ScrollViewer.VerticalOffset - offset);
                    Refresh(false);
                }
            }
            else
                Refresh(false);

            base.OnRenderSizeChanged(sizeInfo);
        }
Пример #6
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            AcHeight = ActualHeight;
            AcWidth = ActualWidth;
        }
Пример #7
0
		protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
		{
			if (_standardHeight == 0)
				_standardHeight = sizeInfo.NewSize.Height;

			base.OnRenderSizeChanged(sizeInfo);
		}
Пример #8
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            Canvas.SetTop(checkBox, (sizeInfo.NewSize.Height / 2) - (checkBox.Height / 2));
            Canvas.SetLeft(checkBox, (sizeInfo.NewSize.Width / 2) - (checkBox.Width / 2));
        }
Пример #9
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            if (!this.kinectManager.KinectSensor.IsAvailable)
            {
                if (!backgroundInitialized)
                {
                    /*
                    backgroundInitialized = true;
                    BitmapSource source = ImageExtensions.ToBitmapSource(KinectShowcase.Properties.Resources.background);
                    // Calculate stride of source
                    int stride = source.PixelWidth * (source.Format.BitsPerPixel / 8);
                    // Create data array to hold source pixel data
                    byte[] data = new byte[stride * source.PixelHeight];
                    // Copy source image pixels to the data array
                    source.CopyPixels(data, stride, 0);
                    // Create WriteableBitmap to copy the pixel data to.
                    WriteableBitmap target = new WriteableBitmap(source.PixelWidth, source.PixelHeight, source.DpiX, source.DpiY, source.Format, null);
                    // Write the pixel data to the WriteableBitmap.
                    target.WritePixels(new Int32Rect(0, 0, source.PixelWidth, source.PixelHeight), data, stride, 0);
                    skeletonView.Source = target;
                    skeletonView.Update();
                     * */
                }
            }
            else
            {
                skeletonView.Update();
            }
            ViewModelLocator.Locator().ApplicationViewModel.SkeletonView.SetKinectManager(this.kinectManager);
        }
Пример #10
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            RemoveBackBufferReference();
            _contentNeedsRefresh = true;

            base.OnRenderSizeChanged(sizeInfo);
        }
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            if (this.Model == null) return;

            this.Model.BarLength = progress.ActualWidth;
            base.OnRenderSizeChanged(sizeInfo);
        }
Пример #12
0
 protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
 {
     base.OnRenderSizeChanged(sizeInfo);
     Size sz = MeasureString("X");
     this._maximumLines = (int)(this.ActualHeight / sz.Height);
     this.LineHeight = sz.Height;
 }
Пример #13
0
        protected override void OnRenderSizeChanged(System.Windows.SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            // recreate bitmap for current control size
            InitializeSpectrogramBitmap(true);
        }
Пример #14
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            //InvalidateArrange();
            //LayoutChildren();
        }
Пример #15
0
 protected override void OnRenderSizeChanged(System.Windows.SizeChangedInfo sizeInfo)
 {
     base.OnRenderSizeChanged(sizeInfo);
     if (sizeInfo.WidthChanged)
     {
         _slidingTrigger.OnWidthChanged();
     }
 }
Пример #16
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            if (this.Model == null) return;

            this.Model.LineWidth = (float)this.ActualWidth - 10f;
            this.Model.TrackWidth = (float)this.ActualWidth;
            base.OnRenderSizeChanged(sizeInfo);
        }
        protected override void OnRenderSizeChanged( SizeChangedInfo sizeInfo )
        {
            base.OnRenderSizeChanged( sizeInfo );

            m_scroll.Minimum = 0;
            m_scroll.Maximum = m_layers.ActualHeight - 70;
            Draw( ChangeType.Resize );
        }
Пример #18
0
        protected override void OnRenderSizeChanged(System.Windows.SizeChangedInfo sizeInfo)
        {
            if (_baseWindow != null)
            {
                _baseWindow.SetPositionAndSize(0, 0, (int)sizeInfo.NewSize.Width, (int)sizeInfo.NewSize.Height, true);
            }

            base.OnRenderSizeChanged(sizeInfo);
        }
        /// <summary>
        /// Called when the value of the RenderSize property has changed.
        /// </summary>
        /// <param name="sizeInfo"></param>
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            MainGridRotateTransform.CenterX = sizeInfo.NewSize.Width / 2;
            MainGridRotateTransform.CenterY = sizeInfo.NewSize.Width / 2;

            Recreate();
        }
Пример #20
0
 protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
 {
     if (!DesignerProperties.GetIsInDesignMode(this) && deviceService != null)
     {
         DoResize();
         Invalidate();
     }
     base.OnRenderSizeChanged(sizeInfo);
 }
Пример #21
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            button.Width = sizeInfo.NewSize.Width - 20.0;

            Canvas.SetTop(button, (sizeInfo.NewSize.Height / 2) - (button.Height / 2));
            Canvas.SetLeft(button, (sizeInfo.NewSize.Width / 2) - (button.Width / 2));
        }
Пример #22
0
        /// <summary>
        /// Render size has changed
        /// </summary>
        /// <param name="sizeInfo">size information</param>
        protected override void OnRenderSizeChanged(System.Windows.SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            if (_chart != null)
            {
                _chart.Width  = sizeInfo.NewSize.Width;
                _chart.Height = sizeInfo.NewSize.Height;
            }
        }
Пример #23
0
		protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
		{
			base.OnRenderSizeChanged(sizeInfo);

			if (null == _img.Parent)
			{
				ImplantImage(sizeInfo.NewSize.Height * _relativeImageWidth, sizeInfo.NewSize.Height);
				SetImageFromContent();
			}
		}
Пример #24
0
 protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
 {
     base.OnRenderSizeChanged(sizeInfo);
       int num1 = 14;
       int num2 = 0;
       if (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 1)
     num2 = (int) (SystemParameters.HorizontalScrollBarHeight * 0.5);
       this.wfHost.Width = sizeInfo.NewSize.Width - 2.0 * SystemParameters.ResizeFrameVerticalBorderWidth + SystemParameters.VerticalScrollBarWidth - (double) num1;
       this.wfHost.Height = sizeInfo.NewSize.Height - 2.0 * SystemParameters.ResizeFrameHorizontalBorderHeight - SystemParameters.HorizontalScrollBarHeight - (double) num2;
 }
Пример #25
0
 protected override void OnRenderSizeChanged(System.Windows.SizeChangedInfo sizeInfo)
 {
     if (_baseWindow != null)
     {
         _baseWindow.SetPositionAndSize(0, 0,
                                        (int)(sizeInfo.NewSize.Width * DpiX / 96),
                                        (int)(sizeInfo.NewSize.Height * DpiY / 96), true);
     }
     base.UpdateWindowPos();
     base.OnRenderSizeChanged(sizeInfo);
 }
Пример #26
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            // clear all visuals and recalculate them

            visuals.Clear();
            foreach (double time in annotations.Select(s=>s.Time))
            {
                visuals.Add(CreateAnnotationVisual(time));
            }
        }
Пример #27
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            Children
                .OfType<ICanvasChild>()
                .Do(child =>
                        {
                            child.Height = ActualHeight;
                            child.Width = ActualWidth;
                        });
        }
Пример #28
0
 protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
 {
     // This is part of endless axis resize loop workaround
     if(viewport != null) {
         viewport.UpdateIterationCount = 0;
         if (!viewport.EnforceRestrictions)
         {
             Debug.WriteLine("Plotter: enabling viewport constraints");
             viewport.EnforceRestrictions = true;
         }
     }
     base.OnRenderSizeChanged(sizeInfo);
 }
        protected override void OnRenderSizeChanged(System.Windows.SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            if (adornedElement != null)
            {
                adornedElement.Height = sizeInfo.NewSize.Height;
                adornedElement.Width  = sizeInfo.NewSize.Width;
            }

            if (adorner != null)
            {
                adorner.ResizeToFillAvailableSpace(sizeInfo.NewSize);
            }
        }
 protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
 {
     try
     {
         if (sizeInfo != null && sizeInfo.WidthChanged)
         {
             DrawBar();
         }
     }
     catch(Exception ex)
     {
         //MessageBox.Show(ex.Message);
     }
     base.OnRenderSizeChanged(sizeInfo);
 }
Пример #31
0
 /// <summary>
 ///     Initializes a new instance of the SizeChangedEventArgs class.
 /// </summary>
 /// <param name="element">
 ///     The UIElement which has its size changed by layout engine/>.
 /// </param>
 /// <param name="info">
 ///     The SizeChangeInfo that is used by <seealso cref="UIElement.OnRenderSizeChanged"/>.
 /// </param>
 internal SizeChangedEventArgs(UIElement element, SizeChangedInfo info)
 {
     if (info == null)
     {
         throw new ArgumentNullException("info");
     }
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     _element = element;
     _previousSize = info.PreviousSize;
     if(info.WidthChanged) _bits |= _widthChangedBit;
     if(info.HeightChanged) _bits |= _heightChangedBit;
 }
Пример #32
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            if (_clipBorder == null) return;

            var farPoint = new Point(
                Math.Max(0, _clipBorder.ActualWidth),
                Math.Max(0, _clipBorder.ActualHeight));

            var clipRect = new Rect(
                new Point(),
                new Point(farPoint.X, farPoint.Y));

            ContentClip = new RectangleGeometry(clipRect, UniformCornerRadius, UniformCornerRadius);
        }
Пример #33
0
 protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
 {
     base.OnRenderSizeChanged(sizeInfo);
     foreach (var form in forms)
     {
         GeneralTransform transform = form.TransformToAncestor(this);
         if (transform != null && transform.Inverse != null)
         {
             Point windowOffset = transform.Inverse.Transform(new Point(0, 0));
             Point windowLowerRight = windowOffset;
             windowLowerRight.Offset(sizeInfo.NewSize.Width, sizeInfo.NewSize.Height);
             var r = new Rect(windowOffset, windowLowerRight);
             var rg = new RectangleGeometry(r);
             form.Clip = rg;
         }
     }
 }
Пример #34
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            if (sizeInfo.PreviousSize.Width == 0
                || sizeInfo.NewSize.Width == STANDARDWINDOWSIZE
                || ((sizeInfo.NewSize.Width <= STANDARDWINDOWSIZE + ConsoleSize) && ConsoleHidden)
                )

                return;

            ConsoleText.Width += (sizeInfo.NewSize.Width - sizeInfo.PreviousSize.Width);
            ConsoleGrid.Width += (sizeInfo.NewSize.Width - sizeInfo.PreviousSize.Width);
            MainGridConsoleColumn.Width = new GridLength(MainGridConsoleColumn.Width.Value + (sizeInfo.NewSize.Width - sizeInfo.PreviousSize.Width));
            ConsoleBorder.Width += (sizeInfo.NewSize.Width - sizeInfo.PreviousSize.Width);
            ConsoleTextBox.Width += (sizeInfo.NewSize.Width - sizeInfo.PreviousSize.Width);
            CommandTextBox.Width += (sizeInfo.NewSize.Width - sizeInfo.PreviousSize.Width);

            ConsoleSize += (sizeInfo.NewSize.Width - sizeInfo.PreviousSize.Width);
        }
Пример #35
0
		protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
		{
			if (Tabs?.Count > 0)
			{
				var tabStep = ActualWidth / Tabs.Count;
				var leftMargin = 0.0;
				var trace = 0;
				foreach (var t in Tabs)
				{
					if (t.IsSelected)
						leftMargin = trace
							* tabStep;
					trace++;
				}
				PART_activeindicator.unregisterAnimation(WidthProperty);
				PART_activeindicator.Width = tabStep;
				PART_activeindicator.unregisterAnimation(MarginProperty);
				PART_activeindicator.Margin = new Thickness(leftMargin, 0, 0, 0);
			}
			base.OnRenderSizeChanged(sizeInfo);
		}
 // Token: 0x060008AE RID: 2222 RVA: 0x0001C2DC File Offset: 0x0001A4DC
 internal SizeChangedEventArgs(UIElement element, SizeChangedInfo info)
 {
     if (info == null)
     {
         throw new ArgumentNullException("info");
     }
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     this._element      = element;
     this._previousSize = info.PreviousSize;
     if (info.WidthChanged)
     {
         this._bits |= SizeChangedEventArgs._widthChangedBit;
     }
     if (info.HeightChanged)
     {
         this._bits |= SizeChangedEventArgs._heightChangedBit;
     }
 }
Пример #37
0
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            if (sizeInfo.WidthChanged) {
                double textWidth = sizeInfo.NewSize.Width - kMinimumPadding * 2;

                foreach (FrameworkElement element in ChildrenContainer.Children) {
                    if (!element.Equals(textBlock)) {
                        textWidth -= element.DesiredSize.Width;
                    }
                }

                if (textWidth > 0.0) {
                    textBlock.Width = textWidth;
                } else {
                    textBlock.Width = 0.0;
                }

            }
        }
        protected override void OnRenderSizeChanged(System.Windows.SizeChangedInfo sizeInfo)
        {
            Size size = sizeInfo.NewSize;

            if (size.Width >= 200)
            {
                this.Columns = 1;
            }
            if (size.Width >= 250)
            {
                this.Columns = 2;
            }
            if (size.Width >= 300)
            {
                this.Columns = 3;
            }
            if (size.Width >= 350)
            {
                this.Columns = 4;
            }
        }
Пример #39
0
        private void fireSizeChangedEvents()
        {
            //no reentrancy. It may happen if one of handlers calls UpdateLayout synchronously
            if (_inFireSizeChanged)
            {
                return;
            }

            EventTrace.EasyTraceEvent(EventTrace.Keyword.KeywordLayout, EventTrace.Level.Verbose, EventTrace.Event.WClientLayoutFireSizeChangedBegin);
            try
            {
                _inFireSizeChanged = true;

                //loop for SizeChanged
                while (_sizeChangedChain != null)
                {
                    SizeChangedInfo info = _sizeChangedChain;
                    _sizeChangedChain = info.Next;

                    info.Element.sizeChangedInfo = null;

                    info.Element.OnRenderSizeChanged(info);

                    //if callout dirtified the tree, return to cleaning
                    if (hasDirtiness)
                    {
                        break;
                    }
                }
            }
            finally
            {
                _inFireSizeChanged = false;
                EventTrace.EasyTraceEvent(EventTrace.Keyword.KeywordLayout, EventTrace.Level.Verbose, EventTrace.Event.WClientLayoutFireSizeChangedEnd);
            }
        }
Пример #40
0
		protected override void OnRenderSizeChanged (SizeChangedInfo sizeInfo)
		{
			throw new NotImplementedException ();
		}
Пример #41
0
 protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
 {
 }
Пример #42
0
 protected internal virtual void OnRenderSizeChanged(SizeChangedInfo info)
 {
     throw new NotImplementedException();
 }
Пример #43
0
 protected internal override void OnRenderSizeChanged(SizeChangedInfo sizeInfo);