当前位置: 首页>>代码示例>>C#>>正文


C# DependencyObject.CoerceValue方法代码示例

本文整理汇总了C#中DependencyObject.CoerceValue方法的典型用法代码示例。如果您正苦于以下问题:C# DependencyObject.CoerceValue方法的具体用法?C# DependencyObject.CoerceValue怎么用?C# DependencyObject.CoerceValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DependencyObject的用法示例。


在下文中一共展示了DependencyObject.CoerceValue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnMinPageWidthChanged

 /// <summary>
 /// Respond to MinPageWidth change.
 /// </summary>
 private static void OnMinPageWidthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     d.CoerceValue(MaxPageWidthProperty);
     d.CoerceValue(PageWidthProperty);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:FlowDocument.cs

示例2: OnMaxPageHeightChanged

 /// <summary>
 /// Respond to MaxPageHeight change.
 /// </summary>
 private static void OnMaxPageHeightChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     d.CoerceValue(PageHeightProperty);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:FlowDocument.cs

示例3: OnIsEnabledChanged

        private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            d.CoerceValue(CanUserAddRowsProperty);
            d.CoerceValue(CanUserDeleteRowsProperty);

            // Many commands use IsEnabled to determine if they are enabled or not
            CommandManager.InvalidateRequerySuggested();

            ((DataGrid)d).UpdateVisualState();
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:10,代码来源:DataGrid.cs

示例4: OnRowStyleSelectorChanged

 private static void OnRowStyleSelectorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     d.CoerceValue(ItemContainerStyleSelectorProperty);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:DataGrid.cs

示例5: OnIsReadOnlyChanged

        private static void OnIsReadOnlyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if ((bool)e.NewValue)
            {
                // When going from R/W to R/O, cancel any current edits
                ((DataGrid)d).CancelAnyEdit();
            }

            // re-evalutate the BeginEdit command's CanExecute.
            CommandManager.InvalidateRequerySuggested();

            d.CoerceValue(CanUserAddRowsProperty);
            d.CoerceValue(CanUserDeleteRowsProperty);

            // Affects the IsReadOnly property on cells
            OnNotifyColumnAndCellPropertyChanged(d, e);
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:17,代码来源:DataGrid.cs

示例6: OnViewboxChanged

 /// <summary>
 /// Handles the event that occurs when the value of the <see cref="Viewbox"/> dependency property has changed.
 /// </summary>
 /// <param name="d">The dependency object on which the dependency property has changed.</param>
 /// <param name="e">The event args containing the old and new values of the dependency property.</param>
 private static void OnViewboxChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     d.CoerceValue(ScaleProperty);
     d.CoerceValue(OffsetProperty);
 }
开发者ID:minhthanhnguyen,项目名称:WpfToolkit,代码行数:10,代码来源:ZoomableCanvas.cs

示例7: OnStretchDirectionChanged

 /// <summary>
 /// Handles the event that occurs when the value of the <see cref="StretchDirection"/> dependency property has changed.
 /// </summary>
 /// <param name="d">The dependency object on which the dependency property has changed.</param>
 /// <param name="e">The event args containing the old and new values of the dependency property.</param>
 private static void OnStretchDirectionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     d.CoerceValue(ScaleProperty);
     d.CoerceValue(OffsetProperty);
 }
开发者ID:minhthanhnguyen,项目名称:WpfToolkit,代码行数:10,代码来源:ZoomableCanvas.cs

示例8: OnScaleChanged

        /// <summary>
        /// Handles the event that occurs when the value of the <see cref="Scale"/> dependency property has changed.
        /// </summary>
        /// <param name="d">The dependency object on which the dependency property has changed.</param>
        /// <param name="e">The event args containing the old and new values of the dependency property.</param>
        private static void OnScaleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            d.CoerceValue(ActualViewboxProperty);
            d.CoerceValue(OffsetProperty);

            var canvas = d as ZoomableCanvas;
            if (canvas != null)
            {
                canvas.ScaleOverride((double)e.NewValue);
            }
        }
开发者ID:minhthanhnguyen,项目名称:WpfToolkit,代码行数:16,代码来源:ZoomableCanvas.cs

示例9: OnApplyTransformChanged

 /// <summary>
 /// Handles the event that occurs when the value of the <see cref="ApplyTransform"/> dependency property has changed.
 /// </summary>
 /// <param name="d">The dependency object on which the dependency property has changed.</param>
 /// <param name="e">The event args containing the old and new values of the dependency property.</param>
 private static void OnApplyTransformChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     d.CoerceValue(RenderTransformProperty);
 }
开发者ID:minhthanhnguyen,项目名称:WpfToolkit,代码行数:9,代码来源:ZoomableCanvas.cs


注:本文中的DependencyObject.CoerceValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。