Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

VB -> C#: Basic WPF Transformations

未关闭
#995 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
csharp
领域
desktop, tooling

调研方向

使用一个原生 VB WPF (.NET 7) 项目、一个 Hello World 文本块和 CodeConverter 扩展重现该报告。跟踪 XAML x:Class 命名空间、Application.xaml 命名以及 x:ClassModifier 可见性的转换路径;完成标准是转换后的 C# 项目无需手动编辑即可处理全部三种情况。

由索引模型根据 Issue 内容生成。

描述

help wanted VB -> C#

I just converted a WPF project from VB.NET to C#. There were a few basic transformations that had to be done manually. I want to describe them in this issue to (a) aid other people doing the same and (b) provide a TODO list in case anyone wants to add these transformations to CodeConverter.

These "issues" can be reproduced by creating a vanilla VB WPF (.NET 7) project with the Visual Studio default template, adding a "Hello World" text block to the main window and converting it to C# with the CodeConverter extension (I used 9.1.3.0).

  • You need to add the default namespace to all x:Class attributes in the root element of your XAML files. The VB compiler adds the default namespace automatically, but the C# compiler doesn't.
  • If no Sub Main() exists, you need to rename Application.xaml(.cs) to App.xaml(.cs). Apparently, C# only auto-generates a void Main for an App.xaml, not for an Application.xaml.
  • If your XAML files have non-default visibility (e.g. x:ClassModifier="Friend"), this value needs to be converted to the corresponding C# value (in this case x:ClassModifier="internal").
主要语言
C#
星标
913
派生
244
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

icsharpcode/CodeConverter 的其他 Issue

查看 icsharpcode/CodeConverter 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。