Click or drag to resize
AB4D logo

ExtensionsGetName(Material) Method

Gets name of the Material that was previously set by SetName extension method.

Namespace: Ab3d
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.2.9104.2045
Syntax
C#
public static string GetName(
	this Material material
)

Parameters

material  Material
Material

Return Value

String
name that was previously set by SetName extension method

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Material. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks

Though many objects in WPF does not have Name property (with public Name getters and setters), it is still possible to set value for the Name property with using a SetValue method on DependencyObjects:

C#
dependencyObjects.SetValue(FrameworkElement.NameProperty, name);

The value of the Name can than be read with:

C#
return dependencyObjects.GetValue(FrameworkElement.NameProperty) as string;

The SetName and GetName extension methods simplify setting the values on commonly used 3D objects.

See Also