WPF XAML与代码隐藏(vb.net)不刷新控件列表 [英] WPF XAML vs Code Behind (vb.net) not refreshing control list

查看:71
本文介绍了WPF XAML与代码隐藏(vb.net)不刷新控件列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早些时候已解决此问题,但在最新更新之后,此问题仍然存在.我在XAML编辑器中创建或复制了一个控件,并且在该窗口的vb.net代码编辑器中的控件列表不会更新控件列表.这阻止了我 能够轻松为新控件添加事件代码块.到目前为止,我必须跳过许多步骤才能刷新列表,例如关闭所有文档,关闭VS,并多次重建所有内容以刷新列表.太疯狂了 应该是一个简单的事件,当在XAML编辑器中创建,修改或复制控件时,它也会得到响应.

This was addressed earlier, but after the latest updates, it persists.  I create or copy a control in the XAML editor, and the control list in the vb.net code editor for that window does not update the list of controls.  This prevents me from being able to easily add an event code block for the new control.   So far I have to jump through many hoops to get it to refresh the list, like close all documents, close VS, and rebuild everything many times to get a refresh.  This is crazy, it should be a simple event that gets responded too when a control is created, modified, or copied in the XAML editor.

Visual Studio Professional 2017(15.1版内部版本26403.7).net框架版本(4.7.02046)

Visual Studio Professional 2017 (version 15.1 build 26403.7), .net framework version (4.7.02046)

Windows 10企业版(创建者创建).

Windows 10 Enterprise (creators build).

请修复.

Jamie V Johnson

Jamie V Johnson

推荐答案

您很可能不得不在出现名称之前编译应用程序,尽管我只是尝试了这种情况并没有问题(我也使用VB).我在列表中找到了控件,但是我很好奇为什么您在代码中而不是在代码中添加了事件处理程序 在XAML中.

You most likely have to compile the app before the name  appears although I just tried your scenario and had no problem (I use VB as well).  I get the control in the list but I am curious as to why you adding the event handler in code rather than in XAML.


这篇关于WPF XAML与代码隐藏(vb.net)不刷新控件列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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