- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
自 6 月以来,我一直在团队中开发 Windows Phone 应用程序。直到今天,所有同步都运行良好。我同步了项目,vs 开始给我错误
我没有做任何更改,昨天它运行良好。 XAML 上的类名称与代码隐藏中的名称匹配。
我已经尝试退出所有 vs 实例,但问题仍然存在。
最佳答案
对我来说,问题如下:
项目结构
Project\Views\Page1.xaml
Project\Views\Page1.xaml.cs
上述页面构造函数Page1.xaml.cs
中的错误:
public sealed partial class Page1 : Page
{
public Page1()
{
this.InitializeComponent();
}
}
Xaml 文件
<Page
x:Class="App1.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
应该是 x:Class="App1.Views.Page1"
所以只是在类名中打错了。
关于c# 不包含 "InitializeComponent"的定义并且名称 "controlName"在当前上下文中不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32806815/
好吧,我怀疑这可能是 Visual Studio 的问题,但肯定有一些原因。我从默认项目列表创建了一个 ListBox(右键单击项目或项目中的文件夹 -> 添加 -> 新项目 -> Xaml List
我已经尝试开始使用.Net Maui,并且已经按照中所述的步骤设置了开发环境:。我还运行了‘Maui-Check’CLI工具,一切都已检查完毕,但当我使用Visual Studio2019 v16.1
如果我在 Visual Studio 2010 SP1 中创建一个新项目并选择“WPF 应用程序”并尝试构建生成的应用程序,则会收到错误 The name 'InitializeComponent'
InitializeComponent(); 此代码行出现在我所有 Xaml 页面的构造函数中的代码后面。 它引发以下错误: InitializeComponent does not exist. 虽
我承认我是xaml 世界的新手但是看到使用内置 Visual Studio 模板的警告表明可能还有另一个问题除了我的大脑。 如果我创建一个空的 VSIX Project (必须是 VSIX 项目)在
我想了解如何使用 C# 构建文件,因此我创建了一个 Windows 窗体应用程序并创建了此代码/窗体。但它似乎没有用。 . using System; using System.Windows.For
该应用程序是在运行 windows 10 的机器上开发的,系统语言设置为我们的本地语言丹麦语。现在我们正处于需要在其他国家的办公室使用该软件的阶段。但是, View 在这些机器上启动时崩溃,而且我发现
我正在尝试在 WPF 中创建自定义用户控件。我希望以后在另一个窗口中使用该控件时能够手动设置大小。 作为一个简短的测试,我刚刚制作了一个包含网格内 Canvas 的控件,它完全填满了控件。初始化时,它
如果我创建一个 winForms“myForm”,则会生成以下样板代码: public partial class myForm: Form { public myForm() {
我的 WPF 用户控件的公共(public)接口(interface)包含自动生成的 InitializeComponent 方法(包含在部分类中)。这对我来说是一个惊喜,因为我期望这样一个内部的东西
首先,我使用的是 Visual Studio 2010,Measurement Studio 2010 plugin 、C# 和 .NET 4.0。 我的应用程序从 USB 设备接收数据,并使用 Wa
我正在尝试关注 this little tutorial ,但我不断收到此异常。 相关的 XAML 如下所示:
在对组件模型的影响方面是否存在任何实际差异: class MyComponent : Component { public MyComponent() { Initialize
我有一个简单的WPF页面,上面有几个radiobuttons,每个RadioButton均以检查事件处理程序注册,以便在更改选择时发生某些事情。默认情况下,我希望选择这些 RadioButtons 之
我在 StackOverflow 上检查了所有类似的问题,但没有一个答案能解决我的问题。我只是得到标题中的错误。 这是我的 MainVindow.xaml:
好的。这个有点傻。 我正在为 Access 数据库编写前端代码(我知道,重新发明轮子)。这个前端很简单。个人可以添加新条目或搜索现有条目。这两个都工作正常。该程序是 self 更新的,但非常简单。它比
我有部分公开课 namespace BugNetWPF { public partial class ReportScreen_IdRangeReport : Page {
使用 Suversion 和 WinDiff 分支/合并类项目和网络项目没有问题。 我永远无法合并的唯一一种项目是 winform 项目。 InitializeComponent 方法总是在仅进行少量
我正在尝试调用 InitializeComponent 方法,但出现以下错误: Type 'WindowsFormsApplication1.Form1' already defines a memb
当您在设计时修改 ListView 的列标题时,设计器会生成代码以在运行时序列化列标题: private void InitializeComponent() { this.listView1
我是一名优秀的程序员,十分优秀!