Handling pages / sites, Windows Phone Silverlight C #?

1

I see several apps on Windows Phone, which manipulate a website, are usually apps from the sites themselves, such as TecMundo.

It captures site elements and adds within the elements of the app, such as Canvas . And it also allows to change css, or categorization tags etc, my apps never integrate with the internet because I do not know how to do it, and this is the next step to become an advanced developer, since I'm almost decorating the internal methods of Windows Phone rsrs

I've always wanted to know about how it's done, I've looked a lot, but I have not found anything except Rudy Huyn's blog, which does not help much.

Could someone give me a 'light' on how this works, even if it's on Android or Ios, as it would give me a hint of what to look for in the C # language of Windows Phone. I know the question is a bit vague, but it's because I really do not know what it's about, so any help would be very useful.

    
asked by anonymous 24.08.2015 / 17:17

1 answer

1

I have an application that performs some simple operations inside the App page. It may not be exactly what websites do, but it serves as a starting point.

I use the WindowsPhone WebBrowser control to load a page. Then I invoke scripts within the page through the InvokeScript method.

Example:

// No Construtor
webBrowser.Navigated += OnBrowserNavigated;

private void OnBrowserNavigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
{
    if (PreferenciasUsuario.CorFonte == "White")
    {
        // SetFontColor é o nome de uma função javascript dentro da página web
        webBrowser.InvokeScript("SetFontColor", "#FFFFFF");
    }
    else
    {
        webBrowser.InvokeScript("SetFontColor", "#000000");
    }
}

Javascript function inside the webpage

<script type="text/javascript">
    function SetFontColor(hexColor) {
        document.body.style.color = hexColor;
    }
</script>

Hugs

    
25.09.2015 / 19:25