[UWP]单选按钮 - 如何识别所选/突出显示的按钮。 [英] [UWP] Radio button - how to identify the selected/highlighted button.

查看:181
本文介绍了[UWP]单选按钮 - 如何识别所选/突出显示的按钮。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,¥


首先我在我的应用程序上使用MVVM结构,我有一个'ShellView',其中有带有样式界限的radiobuttons,每个单选按钮点击方法导航到其他屏幕,我有一个问题,突出显示或选择了radiobutton,例如:当
i点击'radiobutton1'然后导航到该屏幕,'radiobutton1'突出显示(这是正确的),然后当我点击'radiobutton2'但没有成功导航到'radiobutton2'屏幕,'radiobutton2'突出显示(这是
错误)。



如何使突出显示的单选按钮依赖于每个屏幕的NavigateTo?我的意思是当成功'导航到''radiobutton1'屏幕时,'radiobutton1'会突出显示,如果不是,则前一个突出显示的按钮仍然会突出显示。



这里是图片:imgur.com/a/hcsFx



$
谢谢,

NicoTing

解决方案

嗨NicoTing,


如图所示,我可以看到有一个突出显示的项目,但我做了不知道你做了什么事。如果你想导航到其他页面,你可以使用

Frame.Navigate
方法。

 myFrame.Navigate(typeof(BlankPage1)); 

但是我无法得到关键点,当你点击你的第二个单选按钮时,你还处理了按钮点击事件了吗?


你能不能给我更多关于你的问题的信息例如,一些代码。


祝你好运,

Breeze Liu




Good Day,

first im using MVVM Structure on my app , I have a 'ShellView' where there is radiobuttons with Style bounded , and each radiobuttons click method is navigating to other screen , I have a problem for which radiobutton is highlighted or selected , example: when i click the 'radiobutton1' then navigate to that screen , the 'radiobutton1' is highlighted (which is correct) , then when i click the 'radiobutton2' but didnt succeed to navigate to the screen of 'radiobutton2' , the 'radiobutton2' is highlighted (which is wrong).

How can I make the highlighted radiobutton depends on my NavigateTo of each screen ?, I mean when successfully 'navigatedto' 'radiobutton1' screen , 'radiobutton1' is highlighted , if not the previous highlighted button is still highlighted.

here is the image : imgur.com/a/hcsFx


Thanks,
NicoTing

解决方案

Hi NicoTing,

As your picture show, I can get that there is a highlighted item, But I did not know what event had you done with it. if you want to navigate to other page, you can use the Frame.Navigate method.

myFrame.Navigate(typeof(BlankPage1));

however I can not get the key point here, when you click your second radiobutton, have you handled the button click event yet?

Could you give me more information about your problem, for example, some code.

Best regards,
Breeze Liu



这篇关于[UWP]单选按钮 - 如何识别所选/突出显示的按钮。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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