This repository has been archived by the owner on Apr 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #608 from UWPCommunity/rewrite/main
Alpha Release
- Loading branch information
Showing
19 changed files
with
173 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/Libs/Quarrel.Markdown/Rendering/Elements/BlockQuoteElement.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/Libs/Quarrel.Markdown/Rendering/Elements/InlineCodeElement.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,46 @@ | ||
// Quarrel © 2022 | ||
|
||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Toolkit.Uwp.UI; | ||
using Quarrel.ViewModels.Panels; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace Quarrel.Controls.Panels.Messages | ||
{ | ||
public sealed partial class MessagePanel : UserControl | ||
{ | ||
private const double ScrollPadding = 100; | ||
|
||
public MessagePanel() | ||
{ | ||
this.InitializeComponent(); | ||
DataContext = App.Current.Services.GetRequiredService<MessagesViewModel>(); | ||
} | ||
|
||
public MessagesViewModel ViewModel => (MessagesViewModel)DataContext; | ||
|
||
private void ListView_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
ListView messageList = (ListView)sender; | ||
var scrollViewer = messageList.FindDescendant<ScrollViewer>(); | ||
scrollViewer.ViewChanged += OnViewChanged; | ||
} | ||
|
||
private void OnViewChanged(object sender, ScrollViewerViewChangedEventArgs e) | ||
{ | ||
var viewer = (ScrollViewer)sender; | ||
if (viewer.VerticalOffset <= ScrollPadding) | ||
{ | ||
if (!ViewModel.IsLoading) | ||
{ | ||
ViewModel.LoadOlderMessages(); | ||
} | ||
} | ||
else if (viewer.VerticalOffset >= viewer.ScrollableHeight - ScrollPadding) | ||
{ | ||
// TODO: Scrolled to bottom | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.