private async void OnAppendReadingToolLink()
        {
            IClipboardService cService = new ClipboardService();
            var htmlBody = await cService.GetText();

            StringBuilder builder = new StringBuilder(htmlBody);

            builder.Append("<br/>");
            builder.Append("<br/>");
            builder.Append("<a href='https://github.com/musmanrafiq/DailyMatureDev'>Reading Tool : https://github.com/musmanrafiq/DailyMatureDev</a>");

            await cService.CopyText(builder.ToString());
        }
        private async void OnCopyToClipboard()
        {
            using var dbContext = new DailyDevDbContext();
            var links = dbContext.TempLinks.ToList();

            if (links.Any())
            {
                var htmlHelper = new HtmlHelper();
                htmlHelper.PrepareHtml("h2", "Information");

                foreach (var item in links)
                {
                    htmlHelper.PrepareHtml("div", $"- <a href='{item.Url}'>{item.Title}</a> by {item.Author}");
                }
                var htmlBody = htmlHelper.GetHtml();
                IClipboardService cService = new ClipboardService();
                await cService.CopyText(htmlBody);
            }
        }
Esempio n. 3
0
 private void MenuFlyoutItem_Click_1(object sender, RoutedEventArgs e)
 {
     // Copy tags
     ClipboardService.CopyText($"{((sender as FrameworkElement).DataContext as ExTag).GetQueryName()}");
 }