コード例 #1
0
        public MessagePageRenderer(Context context) : base(context)
        {
            webView       = new MessageWebView(Context);
            webViewClient = new WebViewClient(this);

            var fl = new FrameLayout(Context);

            fl.LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);

            fl.AddView(webView);

            webView.SetWebViewClient(webViewClient);
            AddView(fl);

            nativeView = fl;
        }
コード例 #2
0
ファイル: MailWindow.xaml.cs プロジェクト: ysmyslov/MicroMail
        private void RenderEmail()
        {
            if (string.IsNullOrEmpty(Email.Charset) || string.IsNullOrEmpty(Email.Body))
            {
                return;
            }

            var bytes = Encoding.GetEncoding(Email.Charset,
                                             new EncoderExceptionFallback(),
                                             new DecoderExceptionFallback())
                        .GetBytes(Email.Body);

            _contentStream = new MemoryStream(bytes);

            //In case we're updated from non-UI thread.
            Dispatcher.Invoke(() => MessageWebView.NavigateToStream(_contentStream));
            _isRendered = true;
        }