Class FileNameConverter
Shows a path as just its file name, leaving the bound value itself untouched.
Implements
Inherited Members
Namespace: MOSAIC.Converters
Assembly: MOSAIC.dll
Syntax
public sealed class FileNameConverter : IValueConverter
Remarks
For lists whose items must stay full paths because something acts on them — the BodyRig card's calibration profiles are selected as paths and handed straight to load and store — while a full Windows path in a ~440px card pushes the only distinguishing part, the file name, out of view.
Fields
Instance
Shared instance for direct XAML reference.
Declaration
public static readonly FileNameConverter Instance
Field Value
| Type | Description |
|---|---|
| FileNameConverter |
Methods
Convert(object?, Type, object?, CultureInfo)
Converts a value.
Declaration
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The value to convert. |
| Type | targetType | The type of the target. |
| object | parameter | A user-defined parameter. |
| CultureInfo | culture | The culture to use. |
Returns
| Type | Description |
|---|---|
| object | The converted value. |
Remarks
This method should not throw exceptions. If the value is not convertible, return a Avalonia.Data.BindingNotification in an error state. Any exceptions thrown will be treated as an application exception.
ConvertBack(object?, Type, object?, CultureInfo)
Not supported: a file name cannot be resolved back to a path.
Declaration
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | |
| Type | targetType | |
| object | parameter | |
| CultureInfo | culture |
Returns
| Type | Description |
|---|---|
| object |