Windows Phone 8.1共享状态和转到链接 [英] Windows Phone 8.1 Share status and goto links

查看:85
本文介绍了Windows Phone 8.1共享状态和转到链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#和XAML开发简单的Windows Phone 8.1应用程序。

我有命令栏,其中有一个共享按钮和联系支持,请关注我。

I am developing simple windows phone 8.1 app using C# and XAML.
I have command bar in which i have one share button and contact support, follow me.

<Page.BottomAppBar>
        
        <CommandBar x:Name="appBar" removed="White" Foreground="Black">
            <CommandBar.PrimaryCommands>
                <AppBarButton Icon="PostUpdate" IsCompact="False" Label="Share" Click="AppBarButton_Click_3"/>               
            </CommandBar.PrimaryCommands>
            <CommandBar.SecondaryCommands>
                <AppBarButton Label="contact support" />
                <AppBarButton Label="follow me" />                
            </CommandBar.SecondaryCommands>
        </CommandBar>
        
    </Page.BottomAppBar>




protected override void OnNavigatedTo(NavigationEventArgs e)
{
    DataTransferManager _dataTransferManager = DataTransferManager.GetForCurrentView();
    _dataTransferManager = DataTransferManager.GetForCurrentView();
    _dataTransferManager.DataRequested += OnDataRequested;
}
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
    // Unregister the current page as a share source.
    DataTransferManager _dataTransferManager = DataTransferManager.GetForCurrentView();
    _dataTransferManager.DataRequested -= OnDataRequested;
}
private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs e)
{
    e.Request.Data.Properties.Title = "Hi!";
    e.Request.Data.SetUri(new Uri("http://www.google.com"));
}
private async void AppBarButton_Click_3(object sender, RoutedEventArgs e)
{
    DataTransferManager.ShowShareUI();
}



我想做的事情:

1.)我输入的Url分享状态没有显示。

2.)当点击联系支持时,它只转到电子邮件列表共享选项,当用户选择他的任何电子邮件时,它会打开撰写电子邮件并填写我的电子邮件ID发送到,subject =你好,以及一些手机细节,如设备品牌,模态,操作员,固件版本,硬件版本等。

3.)当用户点击跟随我时,用户被重定向到我的Internet Explorer中的Twitter帐户页面。


Following thing i want to do:
1.) Url which i entered to share in status is not showing.
2.) when click on contact support it goes to only emails list share options and when user select any of his email then it opens compose email and fill my email id at "Send to", subject="Hello", and some phone details like Device brand, modal, operator, firmware version, hardware version etc.
3.) When user click on follow me then user is redirected to my twitter account page in Internet explorer.

推荐答案

第3个问题的答案:

Answer for 3rd question:
<appbarbutton label="follow me" click="AppBarButton_Click_2" />




private async void AppBarButton_Click_2(object sender, RoutedEventArgs e)
        {
            // The URI to launch
            string uriToLaunch = @"https://twitter.com/youraccounturl";
            // Create a Uri object from a URI string 
            var uri = new Uri(uriToLaunch);
            await Windows.System.Launcher.LaunchUriAsync(uri);
        }


请查看官方文档:https://msdn.microsoft.com/es-es/library/windows/apps/xaml/hh973056.aspx [ ^ ]



在那里你可以看到如何分享链接。
Please check official docs: https://msdn.microsoft.com/es-es/library/windows/apps/xaml/hh973056.aspx[^]

There you can see how to share a link.


这篇关于Windows Phone 8.1共享状态和转到链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆