[Root] / Xceed.Wpf.DataGrid Assembly / Xceed.Wpf.DataGrid.Views.Surfaces Namespace / MultiSurfaceViewBase Class / SetCoercedSurfaceConfiguration Method
The dependency object to which the attached property is written.

A reference to the the SurfaceConfiguration that is applied to a card (i.e., row).

Example


In This Topic
    SetCoercedSurfaceConfiguration Method
    In This Topic
    Sets the surface configuration that is applied to a card (i.e., row).
    Syntax
    'Declaration
     
    Public Shared Sub SetCoercedSurfaceConfiguration( _
       ByVal obj As DependencyObject, _
       ByVal value As SurfaceConfiguration _
    ) 
    'Usage
     
    Dim obj As DependencyObject
    Dim value As SurfaceConfiguration
     
    MultiSurfaceViewBase.SetCoercedSurfaceConfiguration(obj, value)
    public static void SetCoercedSurfaceConfiguration( 
       DependencyObject obj,
       SurfaceConfiguration value
    )

    Parameters

    obj
    The dependency object to which the attached property is written.
    value

    A reference to the the SurfaceConfiguration that is applied to a card (i.e., row).

    Remarks
    Setting the CoercedSurfaceConfiguration property to a null reference (Nothing in Visual Basic), will result in an empty surface being displayed.
    Example
    All examples in this topic assume that the grid is bound to the Products table of the Northwind database, unless stated otherwise.
    The following example demonstrates how to apply a different surface configuration on the back surface of the center card using the CoercedSurfaceConfiguration attached property.The following example demonstrates how to apply a different surface configuration on the back surface of the center card using the CoercedSurfaceConfiguration attached property.The following XAML demonstrates how to define the initial surface configurations that are applied to various surfaces.
    Private m_fullSurfaceConfiguration As New ImageAndDataSurfaceConfiguration()
    Private Sub ApplyCoercedSurfaceConfiguration( ByVal sender As Object, ByVal e As RoutedEventArgs )
      If Not Me.ProductsGrid.CurrentItem Is Nothing Then
        Dim card As Xceed.Wpf.DataGrid.DataRow = CType( Me.ProductsGrid.GetContainerFromItem( _
                                             Me.ProductsGrid.CurrentItem ), Xceed.Wpf.DataGrid.DataRow )
        If Not card Is Nothing Then
           card.SetValue( MultiSurfaceViewBase.CoercedSurfaceConfigurationProperty, m_fullSurfaceConfiguration )
        End If
      End If
    End Sub
    Private ImageAndDataSurfaceConfiguration m_fullSurfaceConfiguration = New ImageAndDataSurfaceConfiguration();
    Private void ApplyCoercedSurfaceConfiguration( Object sender, RoutedEventArgs e )
    {
      If( this.ProductsGrid.CurrentItem != null )
      {
       Xceed.Wpf.DataGrid.DataRow card = this.ProductsGrid.GetContainerFromItem(
                                            this.ProductsGrid.CurrentItem ) As Xceed.Wpf.DataGrid.DataRow;
       If( card != null )
       {
         card.SetValue( MultiSurfaceViewBase.CoercedSurfaceConfigurationProperty, m_fullSurfaceConfiguration );
       }
      }
    }
    <Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">     
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto"/>
         <RowDefinition/>
      </Grid.RowDefinitions>
      <Grid.Resources>
        
         <xcdg:DataGridCollectionViewSource x:Key="cvs_products"
                                        Source="{Binding Source={x:Static Application.Current}, Path=ProductsTable}"/>
      </Grid.Resources>
      <Button Content="Coerce Surface Configuration"
              Click="ApplyCoercedSurfaceConfiguration"
              Grid.Row="0"/>
      <xcdg:DataGridControl x:Name="ProductsGrid"
                            ItemsSource="{Binding Source={StaticResource cvs_products}}"
                            Grid.Row="1">
         <xcdg:DataGridControl.Columns>
            <xcdg:Column FieldName="ProductName"
                         IsMainColumn="True"/>
         </xcdg:DataGridControl.Columns>
        <xcdg:DataGridControl.View>
           <xcdg:CardflowView3D CardHeightToViewportRatio="0.5">
              <xcdg:CardflowView3D.Theme>
                 <xcdg:ElementalBlackTheme>
                    <xcdg:ElementalBlackTheme.SurfaceConfigurations>
                       <xcdg:ImageSurfaceConfiguration xcdg:CardflowView3D.Surfaces="Left, Right"/>
    
                       <xcdg:ImageAndTitleSurfaceConfiguration xcdg:CardflowView3D.Surfaces="Center"/>
    
                       <xcdg:CompleteSurfaceConfiguration xcdg:CardflowView3D.Surfaces="Back"
                                                          AutoFillDefaultRegion="False">
                          <xcdg:CompleteSurfaceConfiguration.DataRegionConfiguration>
                             <xcdg:RegionConfiguration FieldNames="ProductID, UnitPrice, UnitsInStock"/>
                          </xcdg:CompleteSurfaceConfiguration.DataRegionConfiguration>                      
                       </xcdg:CompleteSurfaceConfiguration>
                    </xcdg:ElementalBlackTheme.SurfaceConfigurations>
                 </xcdg:ElementalBlackTheme>
              </xcdg:CardflowView3D.Theme>
           </xcdg:CardflowView3D>           
        </xcdg:DataGridControl.View>
      </xcdg:DataGridControl>
    </Grid>
    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Framework: net20, net35, net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also