Comments (2)
MarkdownScrollViewer inherits from FlowDocumentScrollViewer which dosn't expose ScrollViewer.
So a trick to get the ScrollViewer is needed.
// MarkdownScrollViewer MdScrlViewer;
public ScrollViewer ScrollViewer
{
get
{
DependencyObject obj = MdScrlViewer;
do
{
if (VisualTreeHelper.GetChildrenCount(obj) > 0)
obj = VisualTreeHelper.GetChild(obj as Visual, 0);
else
return null;
}
while (!(obj is ScrollViewer));
return obj as ScrollViewer;
}
}
If you want a full sample project, see this.
- MainWindow.xaml
- MainWindow.xaml.cs
from mdxaml.
Thank you very much @whistyun, the example project helped me a lot.
The "trick" will be very useful, because when you reload a new page the scroll remains at the same position.
It is to be added in your wiki, it is a useful solution for users.
Maybe, It can be added to MarkdownScrollViewer element, it's "natural" to ask scroll top and bottom.
Have a good day
from mdxaml.
Related Issues (20)
- Is there a way to turn off specific list markers (question) HOT 3
- Table of contents or links to anchors HOT 2
- How to Copy code from code block in md ? HOT 1
- Image Scaling and Gif support HOT 1
- Spoilers support (details) HOT 7
- Different code styles HOT 4
- scroll-wheel-hijack HOT 1
- Open Hyper Link crashes when no web browser is installed HOT 1
- Extension point for code highligting
- Aligning headers?
- [Question] Is there a easy way to activate smooth scrolling ?
- Escape character \ not working correctly
- Navigating to another markdown file, and anchors HOT 2
- [Question] Is there any way to adjust the width of columns in a table?
- Memory Leak in MarkdownScrollViewer HOT 1
- MdXaml 1.24.0 depends on AvalonEdit (>= 6.3.0) but AvalonEdit 6.3.0 was not found. An approximate best match of AvalonEdit 6.3.0.90 was resolved.
- image question.
- Many styles are not fully rendered
- Is there a way to highlight the text?
- Link do customId
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mdxaml.