VB -> C#: Basic WPF Transformations
还没有人认领这个 Issue。
评估
调研方向
使用一个原生 VB WPF (.NET 7) 项目、一个 Hello World 文本块和 CodeConverter 扩展重现该报告。跟踪 XAML x:Class 命名空间、Application.xaml 命名以及 x:ClassModifier 可见性的转换路径;完成标准是转换后的 C# 项目无需手动编辑即可处理全部三种情况。
由索引模型根据 Issue 内容生成。
描述
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:Classattributes 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 avoid Mainfor 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 casex:ClassModifier="internal").
- 主要语言
- C#
- 星标
- 913
- 派生
- 244
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
icsharpcode/CodeConverter 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
icsharpcode/CodeConverter#1271 · 1 条评论 ·
-
C# -> VB
难度 4/5 3-5 天 新手友好度 35/100
icsharpcode/CodeConverter#1281 ·
-
难度 3/5 1-2 天 新手友好度 55/100
icsharpcode/CodeConverter#1275 ·
-
VB -> C#
难度 3/5 1-2 天 新手友好度 62/100
icsharpcode/CodeConverter#1273 ·
-
VB -> C#: "Group By Into" Linq queries supressing aggregations ("Into" part) in the converted code 未关闭Difficult area VB -> C#
难度 3/5 1-2 天 新手友好度 74/100
icsharpcode/CodeConverter#1272 ·
查看 icsharpcode/CodeConverter 的全部 Issue
相似的 Issue
-
untriaged
难度 1/5 1 小时以内 新手友好度 88/100
dotnet/dotnet-api-docs#13095 ·
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100
-
type/automation type/tech-debt
难度 2/5 1-3 小时 新手友好度 84/100
-
bug
难度 1/5 1 小时以内 新手友好度 90/100
newrelic/newrelic-dotnet-agent#3850 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
LuckyPennySoftware/AutoMapper#4660 ·