Page/website manipulation, Windows Phone Silverlight C#?

Asked

Viewed 52 times

1

I see several apps on Windows Phone, which manipulate a site, are usually apps of the sites themselves, such as Tecmundo.

It captures elements of the site and adds within the elements of the app, such as a Canvas. And it also allows me to change the css, or categorization tags, etc., my apps never integrate with the internet because I don’t know how to do it, and that’s the next step in becoming an advanced developer, because I’m almost memorizing the internal methods of Windows Phone rsrs

I’ve always wanted to know how this is done, I’ve looked a lot, but I haven’t found anything, except Rudy Huyn’s blog, which doesn’t help much.

Someone could give me a 'light' of how this works, even if it is on Android or Ios, because it would give me a tip that search in the C# language of Windows Phone. I know the question is a little vague, but it’s because I don’t really know what it is, so any help would be very useful.

  • I don’t have much experience with mobile development. But if I were you, I would ask Twitter by Rudy Huyn, he’s very open to answering.

  • I don’t think he’ll answer, but I’ll try, thanks for the tip

1 answer

1


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

I use Windowsphone’s 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 web page

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

Hugs

  • Thanks, gave a clear.. Do you know how to send parameters to this page? Example: A text for a field? Or edit the page code?

  • 1

    To send texts or manipulate elements does not have much mystery either, since Voce will manipulate elements via javascript. A tip would be to use jQuery Mobile to manipulate these elements.

  • I understand, after I finish the app I am working I will focus on this type and situation. Thanks for the answer.

  • Once your app is ready, pass the name so I can install it and see it working, okay? Hugs.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.