WPF › Extended Scroll Viewer › OverlaySetupConverter
OverlaySetupConverter
class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Controls.Scrollers
Turns ExtendedScrollViewer.ShouldOverlayContent into the number of grid cells the
content spans: two when the scroll bars float over the content, one when they sit beside it.
public class OverlaySetupConverter : IValueConverter
Inherits from / implements: IValueConverter
Remarks
The viewer's default template binds the content's ColumnSpan
and RowSpan through it. It is public so that a template
of your own can do the same.
Examples
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter"
Grid.ColumnSpan="{Binding ShouldOverlayContent, RelativeSource={RelativeSource TemplatedParent},
Converter={StaticResource OverlaySetupConverter}}"
Grid.RowSpan="{Binding ShouldOverlayContent, RelativeSource={RelativeSource TemplatedParent},
Converter={StaticResource OverlaySetupConverter}}" />Members at a glance
| Methods | |
|---|---|
Convert | Returns the span for the content: 2 to overlay the scroll bars, 1 to keep them apart. |
ConvertBack | Not supported: a span cannot be turned back into the overlay setting. |
Methods
Convert
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Returns the span for the content: 2 to overlay the scroll bars, 1 to keep them apart.
Parameters
value- A
bool:truewhen the scroll bars float over the content.nullis read asfalse. targetType- Not used.
parameter- Not used.
culture- Not used.
Returns
The integer 2 when value is true; otherwise
1.
Exceptions
System.InvalidCastExceptionvalueis neithernullnor abool.
ConvertBack
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Not supported: a span cannot be turned back into the overlay setting.
Parameters
value- Not used.
targetType- Not used.
parameter- Not used.
culture- Not used.
Returns
Always null.