You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During an attempt to lock 2 AvaloniaEdit vertical/horizontal offsets I encountered some issues. It seems that ScrollToHorizontalOffset and ScrollToVerticalOffset was never implemented (or commented out) at some point. Avalonia 11.2 ScrollViewer does not have this API currently.
The underlying ScrollViewer is internal, so I'm not sure what the best approach is.
/// <summary>/// Scrolls to the specified position in the document./// </summary>publicvoidScrollToHorizontalOffset(doubleoffset){
ApplyTemplate();// ensure scrollViewer is created//if (scrollViewer != null)// scrollViewer.ScrollToHorizontalOffset(offset);}/// <summary>/// Scrolls to the specified position in the document./// </summary>publicvoidScrollToVerticalOffset(doubleoffset){
ApplyTemplate();// ensure scrollViewer is created//if (scrollViewer != null)// scrollViewer.ScrollToVerticalOffset(offset);}
Edit: I tested a simple solution which works fine.
/// <summary>/// Scrolls to the specified position in the document./// </summary>publicvoidScrollToHorizontalOffset(doubleoffset){
ApplyTemplate();// ensure scrollViewer is createdif(ScrollViewer!=null)
ScrollViewer.SetValue(ScrollViewer.OffsetProperty,new Vector(offset, ScrollViewer.Offset.Y));}/// <summary>/// Scrolls to the specified position in the document./// </summary>publicvoidScrollToVerticalOffset(doubleoffset){
ApplyTemplate();// ensure scrollViewer is createdif(ScrollViewer!=null)
ScrollViewer.SetValue(ScrollViewer.OffsetProperty,new Vector(ScrollViewer.Offset.X, offset));}
The text was updated successfully, but these errors were encountered:
Version: 11.1.0
During an attempt to lock 2 AvaloniaEdit vertical/horizontal offsets I encountered some issues. It seems that ScrollToHorizontalOffset and ScrollToVerticalOffset was never implemented (or commented out) at some point. Avalonia 11.2 ScrollViewer does not have this API currently.
The underlying ScrollViewer is internal, so I'm not sure what the best approach is.
Edit: I tested a simple solution which works fine.
The text was updated successfully, but these errors were encountered: