Exemplo n.º 1
0
    protected internal override void PrepareDefaultStyleKey( Xceed.Wpf.DataGrid.Views.ViewBase view )
    {
      object currentThemeKey = view.GetDefaultStyleKey( typeof( DataCell ) );

      if( currentThemeKey.Equals( this.DefaultStyleKey ) == false )
      {
        this.DefaultStyleKey = currentThemeKey;
      }
    }
 protected internal override void PrepareDefaultStyleKey( Xceed.Wpf.DataGrid.Views.ViewBase view )
 {
   this.DefaultStyleKey = view.GetDefaultStyleKey( typeof( DetailIndicator ) );
 }
 protected internal virtual void PrepareDefaultStyleKey( Xceed.Wpf.DataGrid.Views.ViewBase view )
 {
   this.DefaultStyleKey = view.GetDefaultStyleKey( typeof( HierarchicalGroupByControl ) );
 }
 protected internal virtual void PrepareDefaultStyleKey( Xceed.Wpf.DataGrid.Views.ViewBase view )
 {
   this.DefaultStyleKey = view.GetDefaultStyleKey( typeof( GroupNavigationControl ) );
 }
Exemplo n.º 5
0
    private void OnViewChanged( Xceed.Wpf.DataGrid.Views.ViewBase oldView, Xceed.Wpf.DataGrid.Views.ViewBase newView )
    {
      if( oldView != null )
      {
        oldView.ThemeChanged -= new DependencyPropertyChangedEventHandler( this.View_ThemeChanged );
        oldView.FixedHeaders.CollectionChanged -= new NotifyCollectionChangedEventHandler( this.View_FixedHeadersCollectionChanged );
        oldView.FixedFooters.CollectionChanged -= new NotifyCollectionChangedEventHandler( this.View_FixedFootersCollectionChanged );
      }

      if( newView == null )
      {
        newView = this.GetDefaultView();
      }
      else
      {
        newView.ThemeChanged += new DependencyPropertyChangedEventHandler( this.View_ThemeChanged );
        newView.FixedHeaders.CollectionChanged += new NotifyCollectionChangedEventHandler( this.View_FixedHeadersCollectionChanged );
        newView.FixedFooters.CollectionChanged += new NotifyCollectionChangedEventHandler( this.View_FixedFootersCollectionChanged );
      }

      // Cache if the view requires to preserve container size
      this.ViewPreservesContainerSize = ( newView != null )
        ? newView.PreserveContainerSize
        : true;

      if( ( newView == null ) || ( newView is UIViewBase ) )
      {
        this.m_cachedView = ( UIViewBase )newView;
      }

      object newDefaultStyleKey = newView.GetDefaultStyleKey( typeof( DataGridControl ) );
      if( !object.Equals( newDefaultStyleKey, this.DefaultStyleKey ) )
      {
        this.ClearValue( FrameworkElement.DefaultStyleKeyProperty );

        if( !object.Equals( newDefaultStyleKey, this.DefaultStyleKey ) )
        {
          this.DefaultStyleKey = newDefaultStyleKey;
        }
      }

      this.InvalidateViewStyle();

      // We cannot be sure that the grid elements default style key are different with
      // this new View/Theme (for instance, if the new View/Theme are of the same type 
      // as the old ones). So, we have to force the new templates. This is mainly to 
      // setup the new ViewBindings.
      this.ReapplyTemplate();


      if( this.ViewChanged != null )
        this.ViewChanged( this, EventArgs.Empty );

      // Reset the size states since we do not want to apply old size states to a new view/new container style.
      this.DataGridContext.ClearSizeStates();

      // Reset the flag
      this.ForceGeneratorReset = false;

      // Make sure the current item is into view.
      this.DelayBringIntoViewAndFocusCurrent( DispatcherPriority.Render );
    }
 internal virtual void PrepareDefaultStyleKey( Xceed.Wpf.DataGrid.Views.ViewBase view )
 {
   this.DefaultStyleKey = view.GetDefaultStyleKey( typeof( RowSelectorPane ) );
 }
 internal virtual void PrepareDefaultStyleKey( Xceed.Wpf.DataGrid.Views.ViewBase view )
 {
   this.DefaultStyleKey = view.GetDefaultStyleKey( typeof( HierarchicalGroupLevelIndicatorPane ) );
 }
    protected internal override void PrepareDefaultStyleKey( Xceed.Wpf.DataGrid.Views.ViewBase view )
    {
      var newThemeKey = view.GetDefaultStyleKey( typeof( DataCell ) );
      if( object.Equals( this.DefaultStyleKey, newThemeKey ) )
        return;

      this.DefaultStyleKey = newThemeKey;
    }
 protected internal virtual void PrepareDefaultStyleKey( Xceed.Wpf.DataGrid.Views.ViewBase view )
 {
   this.DefaultStyleKey = view.GetDefaultStyleKey( typeof( GroupLevelIndicator ) );
 }
Exemplo n.º 10
0
 protected internal virtual void PrepareDefaultStyleKey( Xceed.Wpf.DataGrid.Views.ViewBase view )
 {
   this.DefaultStyleKey = view.GetDefaultStyleKey( typeof( ScrollTip ) );
 }