不小心删除了Xaml文件的代码。如何再次添加代码? [英] Accidentally deleted the code behind for an Xaml file. How do I add the code behind again?

查看:91
本文介绍了不小心删除了Xaml文件的代码。如何再次添加代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有错误地排除它,而是删除了Xaml文件后面的.cs代码。现在,我不知道如何在后面添加代码。

Instead of excluding it, by mistake, I deleted the .cs code behind file for an Xaml file. Now, I don't know how to add the code behind.

此窗口为空,没有UI控件。 查看代码已禁用,并且此Xaml的任何地方都看不到事件(闪电图标)。

This Window is empty with no UI controls on it. "View Code" is disabled and I can't see the Events (lightning bolt icon) anywhere for this xaml.

请帮助。

推荐答案

据我所知,没有< a href = http://en.wikipedia.org/wiki/Revision_control rel = nofollow noreferrer>版本控制,如果项目已保存,则无法还原。您应该考虑将代码放入版本控制中。

As far as I know without Version Control there is no way to revert back if the project has been saved. You should look into putting your code on Version Control.

这时,我将考虑重新创建您的xaml文件,复制旧代码,然后在XAML中删除事件并重新创建它们之后,一旦重新创建它们,它将在后面复制代码。

At this point I would consider recreating your xaml file, copying your old code in, then deleting your events in XAML and recreating them, once you recreate them it will reproduce the code behind.

这篇关于不小心删除了Xaml文件的代码。如何再次添加代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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