Exemplo n.º 1
0
    /// <summary>
    /// Handles the LoadCompleted event of the AllSocial1 control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="NavigationEventArgs"/> instance containing the event data.</param>
    private async void AllSocial1_LoadCompleted(object sender, NavigationEventArgs e)
    {
        string cssToApply = "";

        cssToApply += "#header {position: fixed; z-index: 12; top: 0px;} #root {padding-top: 44px;} .item.more {position:fixed; bottom: 0px; text-align: center !important;}";
        var   h         = ApplicationView.GetForCurrentView().VisibleBounds.Height - 44;
        float density   = DisplayInformation.GetForCurrentView().LogicalDpi;
        int   barHeight = System.Convert.ToInt32((h / density));

        cssToApply += ".flyout {max-height:" + barHeight + "px; overflow-y:scroll;}";
        cssToApply += @"#m_newsfeed_stream article[data-ft*=""\\""ei\\"":\\""""] {display:none !important;}";
        await AllSocial1.InvokeScriptAsync("eval",
        {
            "javascript:function addStyleString(str) { var node = document.createElement('style'); node.innerHTML = " + "str; document.body.appendChild(node); } addStyleString('" + cssToApply + "');"
        });

        iconRotation.Stop();
    }
Exemplo n.º 2
0
    /// <summary>
    /// Handles the Click event of the TOP control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
    private async void TOP_Click(object sender, RoutedEventArgs e)
    {
        var ScrollToTopString = "var int = setInterval(function(){window.scrollBy(0, -36); if( window.pageYOffset === 0 ) clearInterval(int); }, 0.1);";

        switch (Vars.WhatSocialNetwork)
        {
        case 0:
        {
            await AllSocial0.InvokeScriptAsync("eval", new string[] { ScrollToTopString });

            break;
        }

        case 1:
        {
            await AllSocial1.InvokeScriptAsync("eval", new string[] { ScrollToTopString });

            break;
        }

        case 2:
        {
            await AllSocial2.InvokeScriptAsync("eval", new string[] { ScrollToTopString });

            break;
        }

        case 3:
        {
            await AllSocial3.InvokeScriptAsync("eval", new string[] { ScrollToTopString });

            break;
        }

        case 4:
        {
            await AllSocial4.InvokeScriptAsync("eval", new string[] { ScrollToTopString });

            break;
        }
        }
    }