private void renderHtml() { if (epubBook == null) { return; } var url = BookEnvironment.AddSourceTempPath(epubBook.Content.Html.ElementAt(index).Key); this.ContentWebView.Source = url; /* * var webviewSource = new HtmlWebViewSource(); * var html = epubBook.Content.Html.ElementAt(index).Value.Content; * string css = ""; * foreach(var localCss in epubBook.Content.Css) * { * css += localCss.Value.Content; * } * html.Replace("<head>", $"<head><style>{css}</style>"); * webviewSource.Html = html; * webviewSource.BaseUrl = baseUrl; * this.ContentWebView.Source = webviewSource;*/ }
public ItemDetailViewModel(Item item = null) { Title = item?.Text; Item = item; var book = contentService.ExtractEpubFromId(item.AssetId); Source = BookEnvironment.AddSourceTempPath(book.Content.Html.First().Key); }