Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Preview panel with plugin sample #1580

Draft
wants to merge 70 commits into
base: dev
Choose a base branch
from

Conversation

onesounds
Copy link
Contributor

@onesounds onesounds commented Nov 27, 2022

This is the code that tao was worked with Preview Panel.
(I did a backup to use this code later, I finally found a backup)

Except for the code used in plugin, it is included in image preview PR.
This means that you can create a separate custom preview like this if you need to.
You don't need to check all file changed. I added comment usable part. (3 files)

You can test with websearch plugin. (works well wikipedia)

@@ -74,10 +75,10 @@ public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
IcoPath = searchSource.IconPath,
ActionKeywordAssigned = searchSource.ActionKeyword == SearchSourceGlobalPluginWildCardSign ? string.Empty : searchSource.ActionKeyword,
Score = score,
PreviewPanel = new Lazy<UserControl>(() => new PreviewPanel(searchSource.Url.Replace("{q}", Uri.EscapeDataString(keyword)))),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Custom Panel with query

@@ -0,0 +1,32 @@
<UserControl
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preview Panel

{
public string Url { get; set; }

public PreviewPanel(string url)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample Preview Panel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants