小编Pav*_*ekh的帖子

当数据从 Android 传递到 PCL 时,未收到 MessagingCenter 消息

我正在尝试将数据从 MainActivity 发送回 PCL 视图。当我发送一条没有数据的消息时,它会收到它。但是当我尝试用它传回一个字符串时,代码永远不会到达。

在主要活动中:

if(data != null)
            {

                MessagingCenter.Send<object, string>(this, data, "MapIntentReceived");
                MessagingCenter.Send<object>(this, "MapIntentReceived");

            }
Run Code Online (Sandbox Code Playgroud)

在 PCL 中:

            MessagingCenter.Subscribe<object, string>(this, "MapIntentReceived",
                async (sender, roomString) =>
                {   //his code is not reached
                    await SearchForRooms(roomString);
                });

            MessagingCenter.Subscribe<object>(this, "MapIntentReceived",
                async (sender) =>
                {   //this code is reached
                    await SearchForRooms("blah");
                });
Run Code Online (Sandbox Code Playgroud)

谢谢您的帮助。

xamarin xamarin.forms

3
推荐指数
1
解决办法
1460
查看次数

如何从xamarin表单中的客户端项目(IOS/Android)将一个内容页面导航到另一个内容页面?

如何从xamarin表单中的客户端项目将一个内容页面导航到另一个内容页面?

我已经以不同的方式在每个平台上实现了推送通知.我需要导航到当前内容页面中的其他内容.

我尝试在GCMService的OnMessage方法中使用下面的代码.我的问题是第二个导航内容页面的构造函数被调用并成功调试.但我的屏幕仍然显示当前页面不显示第二个导航内容页面.

App.Current.MainPage.Navigation.PushAsync (new SecondNavigationContentPage());
Run Code Online (Sandbox Code Playgroud)

c# navigation xamarin xamarin.forms

2
推荐指数
1
解决办法
1万
查看次数

如何在ASP.NET中测试WCF服务?

我已经创建了一个简单的WCF应用程序,我在我的服务中添加了一个显示方法,但我不知道如何测试这个显示服务?我使用谷歌进行了搜索,但没有找到任何可行的解决方案.

.net c# wcf web-services

0
推荐指数
1
解决办法
1044
查看次数

标签 统计

c# ×2

xamarin ×2

xamarin.forms ×2

.net ×1

navigation ×1

wcf ×1

web-services ×1