如何在Monogame中从.cs文件导航到.xaml?

时间:2016-05-31 14:50:33

标签: c# wpf xaml win-universal-app monogame

尝试在Windows Universal应用程序中导航时遇到问题。 想要使用鼠标单击从.cs文件导航到.xaml,应用程序将停止。 通过使用触摸应用程序工作,但使用单击不起作用。

我的代码如下(SexAppRetos.cs):

// Mitos
                if ( mitsTrues.Contains( mouseX, mouseY ) ) {
                    var ccc = new Frame();
                    ccc.Navigate( typeof( Credits ) );

                    Window.Current.Content = ccc;
                    Window.Current.Activate();
                }

                // Ayuda cerca de ti
                if ( help.Contains( mouseX, mouseY ) ) {
                    var rootFrame = new Frame();
                    rootFrame.Navigate( typeof( Help ) );

                    Window.Current.Content = rootFrame;
                    Window.Current.Activate();
                }

                // Faqs
                if ( faqs.Contains( mouseX, mouseY ) ) {
                    var rootFrame = new Frame();
                    rootFrame.Navigate( typeof( FaqPage ) );

                    Window.Current.Content = rootFrame;
                    Window.Current.Activate();
                }

1 个答案:

答案 0 :(得分:1)

解决方案是更改鼠标单击按下以释放。

game.mouseState.LeftButton == ButtonState.Pressed

game.mouseState.LeftButton == ButtonState.Released