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


C# UIElement.ClearValue方法代码示例

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


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

示例1: OnVisualRemoved

        protected override void OnVisualRemoved(UIElement elt)
        {
            Viewport2DVisual3D model = elt.GetValue(LinkedModelProperty) as Viewport2DVisual3D;
            _modelContainer.Children.Remove(model);
            LoginGrid loginGrid = (LoginGrid)model.Visual;
            loginGrid.imgMoveToLeft.MouseDown -= MoveToLeft;
            loginGrid.imgMoveToRight.MouseDown -= MoveToRight;

            model.ClearValue(LinkedElementProperty);
            elt.ClearValue(LinkedModelProperty);
            SelectedIndex = 0;
            // Update SelectedIndex if needed
            if (SelectedIndex >= 0 && SelectedIndex < VisibleChildrenCount)
            {
                ReflowItems();
            }
            else
            {
                SelectedIndex = Math.Max(0, Math.Min(SelectedIndex, VisibleChildrenCount - 1));
            }
        }
开发者ID:CraigCary,项目名称:roduino,代码行数:21,代码来源:LoginElemtFlow.cs

示例2: OnVisualRemoved

        protected override void OnVisualRemoved(UIElement elt)
        {
            Viewport2DVisual3D model = elt.GetValue(LinkedModelProperty) as Viewport2DVisual3D;
            _modelContainer.Children.Remove(model);

            model.ClearValue(LinkedElementProperty);
            elt.ClearValue(LinkedModelProperty);
            SelectedIndex = 0;
            // Update SelectedIndex if needed
            if (SelectedIndex >= 0 && SelectedIndex < VisibleChildrenCount)
            {
                ReflowItems();
            }
            else
            {
                SelectedIndex = Math.Max(0, Math.Min(SelectedIndex, VisibleChildrenCount - 1));
            }
            //load current tab
            Viewport2DVisual3D newSelectedModel = (Viewport2DVisual3D)_modelContainer.Children[SelectedIndex];
            ListBoxItem item = (ListBoxItem)newSelectedModel.GetValue(LinkedElementProperty);
            RaiseTabLoadedEvent((Tab)item.Content);
        }
开发者ID:CraigCary,项目名称:roduino,代码行数:22,代码来源:TabsElementFlow.cs

示例3: OnVisualRemoved

 private void OnVisualRemoved(UIElement elt)
 {
     var model = elt.GetValue(LinkedModelProperty) as ModelUIElement3D;
     if (model != null)
     {
         _modelContainer.Children.Remove(model);
         model.ClearValue(LinkedElementProperty);
     }
     elt.ClearValue(LinkedModelProperty);
 }
开发者ID:Ghawken,项目名称:FrontView,代码行数:10,代码来源:VirtElementFlow.cs

示例4: EndChildExit

        private void EndChildExit( UIElement child, ChildState state )
        {
            // raise the ChildExited event
              state.HasExitCompleted = true;
              AnimationPanel.RaiseChildExitedEvent( child, child );

              // remove the visual child relationship
              if( this.ExitingChildren.Contains( child ) )
              {
            this.IsRemovingInternalChild = true;
            try
            {
              if( _switchParent != null )
              {
            _switchParent.RemoveVisualChildInternal( child );
              }
              else
              {
            this.RemoveVisualChild( child );
              }
            }
            finally
            {
              this.IsRemovingInternalChild = false;
            }
            this.ExitingChildren.Remove( child );
              }

              child.ClearValue( AnimationPanel.ChildStatePropertyKey );
        }
开发者ID:eolandezhang,项目名称:Diagram,代码行数:30,代码来源:AnimationPanel.cs

示例5: HandleGeneratedContainerPreparation

    private void HandleGeneratedContainerPreparation(
      UIElement container,
      int containerIndex,
      bool isNewlyRealized,
      bool delayDataContext )
    {
#if DEBUG
      TableflowViewItemsHost.SetRealizedIndex( container, containerIndex );
#endif //DEBUG

      try
      {
        TableflowViewItemsHost.SetShouldDelayDataContext(
          container, ( !this.PreventOpacityAnimation && this.IsDeferredLoadingEnabledCache && delayDataContext ) );

        if( isNewlyRealized )
        {
          // We must prepare the container if the container preparation
          // should not be delayed or if we've been ask to prepare it (from 
          // a keyboard navigation for example)
          this.PrepareContainer( container );
        }

        // We must set those properties AFTER calling PrepareContainer since PrepareContainer
        // will set the ItemContainerStyle which could affect the Height properties. In our case,
        // we want to override those properties so that our layout is ok.
        container.SetValue( FrameworkElement.MinHeightProperty, m_containerHeight );
        container.SetValue( FrameworkElement.MaxHeightProperty, m_containerHeight );
        container.SetValue( FrameworkElement.HeightProperty, m_containerHeight );

        // In the case of HeaderFooterItems, we also want to set the Height properties of the inner 
        // container if that container is a Row or a descendant.
        HeaderFooterItem headerFooterItem = container as HeaderFooterItem;

        if( ( headerFooterItem != null )
          && ( headerFooterItem.Container != null )
          && ( this.ContainerIsRow( container ) ) )
        {
          headerFooterItem.Container.SetValue( FrameworkElement.MinHeightProperty, m_containerHeight );
          headerFooterItem.Container.SetValue( FrameworkElement.MaxHeightProperty, m_containerHeight );
          headerFooterItem.Container.SetValue( FrameworkElement.HeightProperty, m_containerHeight );
        }
      }
      finally
      {
        container.ClearValue( TableflowViewItemsHost.ShouldDelayDataContextProperty );
      }
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:48,代码来源:TableflowViewItemsHost.cs

示例6: RecycleContainer

    private void RecycleContainer( ICustomItemContainerGenerator generator, int containerIndex, UIElement container )
    {
      if( ( generator != null ) && ( containerIndex != -1 ) )
      {
        try
        {
          GeneratorPosition position = generator.GeneratorPositionFromIndex( containerIndex );
          generator.Remove( position, 1 );
        }
        catch
        {
          Debug.Fail( "Unable to remove container for containerIndex " + containerIndex );
        }
      }

#if DEBUG
      TableflowViewItemsHost.SetRealizedIndex( container, -1 );
#endif //DEBUG
      TableflowViewItemsHost.ClearIsSticky( container );
      container.ClearValue( UIElement.ClipProperty );

      this.DisableElementNavigation( container );
      this.FreeRowSelector( container );

      m_layoutedContainersToRecycle.Add( container );
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:26,代码来源:TableflowViewItemsHost.cs

示例7: SetFixedTranslateTransform

    internal static void SetFixedTranslateTransform( UIElement element, bool canScrollHorizontally )
    {
      if( element == null )
        throw new ArgumentNullException( "element" );

      ScrollViewer parentScrollViewer = TableViewScrollViewer.GetParentScrollViewer( element ) as ScrollViewer;

      if( parentScrollViewer != null )
      {
        Transform fixedTransform = TableViewScrollViewer.GetStoredFixedTransform( parentScrollViewer );

        Debug.Assert( fixedTransform != null );

        if( canScrollHorizontally )
        {
          if( element.RenderTransform == fixedTransform )
          {
            element.ClearValue( UIElement.RenderTransformProperty );
          }
        }
        else
        {
          element.RenderTransform = fixedTransform;
        }
      }
    }
开发者ID:wangws556,项目名称:duoduo-chat,代码行数:26,代码来源:TableViewScrollViewer.cs

示例8: PrepareContainer

    private void PrepareContainer( UIElement container )
    {
      container.ClearValue( UIElement.VisibilityProperty );

      var dataItemStore = Xceed.Wpf.DataGrid.CustomItemContainerGenerator.GetDataItemProperty( container );
      if( ( dataItemStore == null ) || dataItemStore.IsEmpty )
        return;

      var dataItem = dataItemStore.Data;
      if( dataItem == null )
        return;

      // Prepare the container.
      this.ParentDataGridControl.PrepareItemContainer( container, dataItem );
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:15,代码来源:TableViewItemsHost.cs

示例9: ShowAdorner

        private static void ShowAdorner(UIElement targetElement, bool show, bool retry = true)
        {
            if (targetElement == null)
            {
                return;
            }

            var adornerLayer = AdornerLayer.GetAdornerLayer(targetElement);
            if (adornerLayer == null)
            {
                if (retry)
                {
                    targetElement.Dispatcher.BeginInvoke(
                        DispatcherPriority.Loaded,
                        new Action(() => ShowAdorner(targetElement, show, false)));
                }

                return;
            }

            var adorner = targetElement.ReadLocalValue(AdornerProperty) as TemplatedAdorner;
            if (show && adorner == null)
            {
                var validationTemplate = GetTemplate(targetElement);
                if (validationTemplate != null)
                {
                    adorner = new TemplatedAdorner(targetElement, validationTemplate);
                    adornerLayer.Add(adorner);
                    targetElement.SetValue(AdornerProperty, adorner);
                }
            }
            else if (!show && adorner != null)
            {
                adorner.ClearChild();
                adornerLayer.Remove(adorner);
                targetElement.ClearValue(AdornerProperty);
            }
        }
开发者ID:bitbonk,项目名称:Toolbox,代码行数:38,代码来源:Adornment.cs

示例10: SetViewportPosition

        private static void SetViewportPosition(UIElement element, MapBase parentMap, Location location)
        {
            Point viewportPosition;

            if (parentMap != null && location != null)
            {
                var mapPosition = parentMap.MapTransform.Transform(location, parentMap.Center.Longitude); // nearest to center longitude
                viewportPosition = parentMap.ViewportTransform.Transform(mapPosition);
                element.SetValue(ViewportPositionProperty, viewportPosition);
            }
            else
            {
                viewportPosition = new Point();
                element.ClearValue(ViewportPositionProperty);
            }

            var translateTransform = element.RenderTransform as TranslateTransform;

            if (translateTransform == null)
            {
                var transformGroup = element.RenderTransform as TransformGroup;

                if (transformGroup == null)
                {
                    translateTransform = new TranslateTransform();
                    element.RenderTransform = translateTransform;
                }
                else
                {
                    if (transformGroup.Children.Count > 0)
                    {
                        translateTransform = transformGroup.Children[transformGroup.Children.Count - 1] as TranslateTransform;
                    }

                    if (translateTransform == null)
                    {
                        translateTransform = new TranslateTransform();
                        transformGroup.Children.Add(translateTransform);
                    }
                }
            }

            translateTransform.X = viewportPosition.X;
            translateTransform.Y = viewportPosition.Y;
        }
开发者ID:bhanu475,项目名称:XamlMapControl,代码行数:45,代码来源:MapPanel.cs

示例11: UnregisterToolTip

        private static void UnregisterToolTip(UIElement owner)
        {
            if (owner.GetValue(ToolTipObjectProperty) == null)
            {
                return;
            }

            if (owner is FrameworkElement)
            {
                ((FrameworkElement)owner).Unloaded -= FrameworkElementUnloaded;
            }
            owner.MouseEnter -= OnElementMouseEnter;
            owner.MouseLeave -= OnElementMouseLeave;

            var toolTip = (ToolTip)owner.GetValue(ToolTipObjectProperty);
            if (toolTip.IsOpen)
            {
                toolTip.IsOpen = false;
            }
            toolTip.SetOwner(null);
            owner.ClearValue(ToolTipObjectProperty);

            if (elementsAndToolTips.ContainsKey(owner))
            {
                elementsAndToolTips.Remove(owner);
            }
        }
开发者ID:barrett2474,项目名称:CMS2,代码行数:27,代码来源:ToolTipService.cs

示例12: UnregisterToolTip

 private static void UnregisterToolTip(UIElement owner)
 {
     owner.MouseEnter -= OnElementMouseEnter;
     owner.MouseLeave -= OnElementMouseLeave;
     if (owner.GetValue(ToolTipObjectProperty) == null) return;
     var tip = (ToolTip) owner.GetValue(ToolTipObjectProperty);
     if (tip.IsOpen)
         tip.IsOpen = false;
     owner.ClearValue(ToolTipObjectProperty);
 }
开发者ID:saggett,项目名称:ReligionsTree,代码行数:10,代码来源:ToolTipService.cs

示例13: OnVisualRemoved

        private void OnVisualRemoved(UIElement elt)
        {
            ModelUIElement3D model = elt.GetValue(LinkedModelProperty) as ModelUIElement3D;
            _modelContainer.Children.Remove(model);

            model.ClearValue(LinkedElementProperty);
            elt.ClearValue(LinkedModelProperty);

            // Update SelectedIndex if needed
            if (SelectedIndex >= 0 && SelectedIndex < VisibleChildrenCount)
            {
                ReflowItems();
            }
            else
            {
                SelectedIndex = Math.Max(0, Math.Min(SelectedIndex, VisibleChildrenCount - 1));
            }
        }
开发者ID:fivesixty,项目名称:StandaloneMB,代码行数:18,代码来源:ElementFlow.cs


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