相互排斥的可检查菜单项?(Mutually exclusive checkable menu items?)
给出以下代码:
<MenuItem x:Name="MenuItem_Root" Header="Root"> <MenuItem x:Name="MenuItem_Item1" IsCheckable="True" Header="item1" /> <MenuItem x:Name="MenuItem_Item2" IsCheckable="True" Header="item2"/> <MenuItem x:Name="MenuItem_Item3" IsCheckable="True" Header="item3"/> </MenuItem>
在XAML中,是否有创建互相排斥的可检查菜单项的方法? 用户在哪里检查项目2,项目1和3自动取消选中。
我可以通过监视菜单上的单击事件,确定检查哪个项目,并取消选中其他菜单项来完成代码。 我认为有一个更简单的方法。
有任何想法吗?
Given the following code:
<MenuItem x:Name="MenuItem_Root" Header="Root"> <MenuItem x:Name="MenuItem_Item1" IsCheckable="True" Header="item1" /> <MenuItem x:Name="MenuItem_Item2" IsCheckable="True" Header="item2"/> <MenuItem x:Name="MenuItem_Item3" IsCheckable="True" Header="item3"/> </MenuItem>
In XAML, is there a way to create checkable menuitem's that are mutually exclusive? Where is the user checks item2, item's 1 and 3 are automatically unchecked.
I can accomplish this in the code behind by monitoring the click events on the menu, determining which item was checked, and unchecking the other menuitems. I'm thinking there is an easier way.
Any ideas?
原文:https://stackoverflow.com/questions/3652688
更新时间:2023-11-28 11:11
最满意答案
您可以使用Node Stream Buffers创建一个ReadableStream,如下所示:
// Initialize stream var myReadableStreamBuffer = new streamBuffers.ReadableStreamBuffer({ frequency: 10, // in milliseconds. chunkSize: 2048 // in bytes. }); // With a buffer myReadableStreamBuffer.put(aBuffer); // Or with a string myReadableStreamBuffer.put("A String", "utf8");
频率不能为0,所以这会引起一定的延迟。
You can create a ReadableStream using Node Stream Buffers like so:
// Initialize stream var myReadableStreamBuffer = new streamBuffers.ReadableStreamBuffer({ frequency: 10, // in milliseconds. chunkSize: 2048 // in bytes. }); // With a buffer myReadableStreamBuffer.put(aBuffer); // Or with a string myReadableStreamBuffer.put("A String", "utf8");
The frequency cannot be 0 so this will introduce a certain delay.
相关问答
更多-
TCP/IP模型是一个________。[2023-05-19]
a -
您可以使用Node Stream Buffers创建一个ReadableStream,如下所示: // Initialize stream var myReadableStreamBuffer = new streamBuffers.ReadableStreamBuffer({ frequency: 10, // in milliseconds. chunkSize: 2048 // in bytes. }); // With a buffer myReadableStream ...
-
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
使用流化器,您可以使用新的流api将字符串和缓冲区转换为可读流。 With streamifier you can convert strings and buffers to readable streams with the new stream api.
-
您可以使用match而不是split来获取两个字符组的数组。 然后你可以反转数组并加入它。 buf.toString('hex').match(/.{2}/g).reverse().join("") You can use match instead of split to get an array of the two character groups. Then you can reverse the array and join it. buf.toString('hex').match(/.{2} ...
-
NodeJs缓冲区CRLF(NodeJs Buffer CRLF)[2023-02-27]
最后我找到了解决方案:蓝牙代理必须运行才能使用蓝牙 - 串口,并且编码必须是ASCII。 Finally I found the solution: The Bluetooth agent must run to work with bluetooth-serial-port, and also the encoding have to be ASCII. -
fs旨在对文件系统执行操作。 fs.createReadStream()期望一个路径作为它的第一个参数,它可以是文件名,文件的url或文件缓冲区( 这里很好地解释)。 您正在传递一个对象{path:b} 。 如果您尝试使用createReadStream()正确的语法,则错误会变得更加清晰: var fs = require('fs'); var b = Buffer([80,80,80,80]); var readStream = fs.createReadStream(b); console.log( ...
-
我刚刚意识到我做错了什么。 我的选项语法不正确: let csvStream = csv.fromPath("C:\\x\\test.txt",objectMode=true) 应该是如下所示: let csvStream = csv.fromPath("C:\\x\\test.txt", { objectMode:true } ) I just realized what I was doing wrong. My syntax for options was incorrect: let csvSt ...
-
你可以像这样创建一个类型化的数组: [obj1.in1,obj1.in2,obj1.out,obj2.in1,...] 有一个对象: var arr=Int8Array.from(myObject.in.concat(myObject.out)); 使用对象数组: var ObjArr=[obj1,obj2]; var arr=new Int8Array(ObjArr.length*3); for(var i=0;i
nodejs日志缓冲区(nodejs log buffer)[2021-06-03]
如果你像在帖子中那样构造缓冲区是不可能的。 缓冲区只不过是一个字节数组。 它不存储任何类型信息。 缓冲区不是您的正确选择。 如果你想这样,你必须自己实现它。 这称为对象/数据序列化,其中存储了类型和值(尝试检查msgpack或bson或json )。 缓冲区只是一个字节流。 注意:我不是那个对您的问题进行投票的人。 我相信没有问题是微不足道的,不值得回答 It is not possible if you construct the buffer like you did in your post. Buf ...相关文章
更多- EXTJS关于Panel动态ITEMS的问题
- Memcached stats items 显示各个 slab 中 item 的数目和存储时长
- Solr参数(QueryElevation Shard Spatial Spelling)
- 微信平台(二)--自定义菜单
- ActionBar 溢出菜单和兼容问题解决
- android 中使用TabHost控件实现微信界面的底部菜单效果
- 微信公众平台自定义菜单接口开发(1)
- 微信公众平台开发(58)自定义菜单
- 微信公众平台开发(58)自定义菜单
- Force.com微信开发系列(五)自定义菜单进阶及语音识别
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。