Open.Core.UI.Controls.HtmlBlock.Load C# (CSharp) Method

Load() public method

Loads the HTML contained in the file at the given location.
public Load ( Uri source ) : void
source System.Uri The source file containing the HTML.
return void
        public void Load(Uri source)
        {
            // Setup initial conditions.
            if (source == null) return;

            // Load the HTML content.
            var webClient = new WebClient();
            webClient.DownloadStringCompleted += (s, e) =>
                        {
                            if (e.Error != null)
                            {
                                Debug.WriteLine(string.Format("HtmlBlock Load Error: Failed to load HTML contained in an XML document at '{0}'.", source));
                                Debug.WriteLine(e.Error.Message);
                                return;
                            }
                            InnerHtml = e.Result;
                        };
            webClient.DownloadStringAsync(source);
        }
        #endregion