visual-studio WPF 应用程序:Visual Studio 与 Expression Blend
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3368640/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
WPF Applications: Visual Studio vs. Expression Blend
提问by Icemanind
I am a bit confused on how Visual Studio 2010 and Expression Blend 4 operate together. If I want to create a WPF application, should I start it in Expression Blend 4? If so, then how does Visual Studio 2010 natively open Expression Blend projects, or does it?
我对 Visual Studio 2010 和 Expression Blend 4 如何一起运行感到有些困惑。如果我想创建一个 WPF 应用程序,我应该在 Expression Blend 4 中启动它吗?如果是这样,那么 Visual Studio 2010 是如何在本机打开 Expression Blend 项目的?
Or should I start my application in Visual Studio 2010? If so, how do I open my solution in Expression Blend.
还是应该在 Visual Studio 2010 中启动我的应用程序?如果是这样,我如何在 Expression Blend 中打开我的解决方案。
Also, how do I modify an existing WPF form, if I need changes. If I already have events handled and code behind, how do I bring it over to expression blend, make my changes, then bring it back to visual studio without disrupting the events and code that I have created in Visual Studio 2010?
另外,如果需要更改,如何修改现有的 WPF 表单。如果我已经处理了事件并隐藏了代码,我如何将它带到表达式混合,进行更改,然后将其带回 Visual Studio,而不会中断我在 Visual Studio 2010 中创建的事件和代码?
Also can someone recommend a good book that covers how to create WPF and/or Silverlight applications using Expression blend 4 and Visual Studio 2010 together.
也有人可以推荐一本好书,介绍如何使用 Expression blend 4 和 Visual Studio 2010 创建 WPF 和/或 Silverlight 应用程序。
回答by Sorskoot
Solutions are the same for Visual Studio and Expression Blend. You can open your solution through the file menu in expression blend, or by right clicking on a xaml file in Visual Studio and select "Open In Expression Blend".
Visual Studio 和 Expression Blend 的解决方案相同。您可以通过 expression blend 中的文件菜单打开您的解决方案,或者通过右键单击 Visual Studio 中的 xaml 文件并选择“在 Expression Blend 中打开”。
Personally, when I need to make only a small change, like changing the text on a button, I don't go into Blend. But when I want to see what's going on, with margins and layout and stuff I always use Blend. Most often I have Visual Studio and Blend open side by side and I keep switching back and forth.
就我个人而言,当我只需要进行很小的更改时,例如更改按钮上的文本,我不会进入 Blend。但是当我想看看发生了什么时,我总是使用 Blend。大多数情况下,我同时打开 Visual Studio 和 Blend,并且不断来回切换。
Because Expression Blend uses the same solution you don't have to worry about event handlers and such. When they are in place, they stay in place. Unless you delete the control the event is attached to of course.
因为 Expression Blend 使用相同的解决方案,所以您不必担心事件处理程序等。当它们就位时,它们会留在原地。除非您删除该事件所附加的控件。
Creating a solution can be done in both tools, but I start most projects in Visual Studio. There are however a few Project templates that can't be found in visual studio. For example the Databound Application project type. This will give you a start on an MVVM project, with folders in place for the Model, View and ViewModel.
可以在这两种工具中创建解决方案,但我在 Visual Studio 中启动大多数项目。但是,有一些项目模板在 Visual Studio 中找不到。例如数据绑定应用程序项目类型。这将使您开始一个 MVVM 项目,其中包含模型、视图和视图模型的文件夹。
回答by Chris
You can have it open in both Visual Studio and Blend at the same time. You're prompted in Visual Studio if you make a change in Blend and vice versa.
您可以同时在 Visual Studio 和 Blend 中打开它。如果您在 Blend 中进行更改,则会在 Visual Studio 中提示您,反之亦然。
Personally I create the new application in Visual Studio first then open it in Blend.
我个人首先在 Visual Studio 中创建新应用程序,然后在 Blend 中打开它。
回答by Christopher Quesada
I usualy start my project in Blend. Remember Blend is specially designed to make great UI, easy databindig, make easy templates and custom controls.
我通常在 Blend 中开始我的项目。记住 Blend 专门设计用于制作出色的 UI、轻松的数据绑定、制作简单的模板和自定义控件。
You can edit the code behind of your app directly in Blend but sometimes it doesn't show the intellisense; thats when you need open VS, to do that right click on your project inside blend and click on edit with Visual Studio. It'll launch VS and you can start coding.
您可以直接在 Blend 中编辑应用程序背后的代码,但有时它不会显示智能感知;那就是当您需要打开 VS 时,在您的项目中右键单击 blend 并单击使用 Visual Studio 进行编辑。它将启动 VS,您可以开始编码。
You dont need to close VS or Blend, they booth can be open, if you make some change in VS it will notify Blend, will appear a dialogbox telling you: reload the app, click Yes the changes will be sincronized in Blend and VS, the same happens when you make changes in Blend and go to an already open instance of VS.
您不需要关闭 VS 或 Blend,它们的展位可以打开,如果您在 VS 中进行一些更改,它会通知 Blend,会出现一个对话框告诉您:重新加载应用程序,单击是,更改将在 Blend 和 VS 中同步,当您在 Blend 中进行更改并转到已打开的 VS 实例时,也会发生同样的情况。
Too remember to install de VS tools, it will allow you to open Silverlight projects inside VS, if they arent already installed an error message will appear.
记得安装 de VS 工具,它会允许你在 VS 中打开 Silverlight 项目,如果它们尚未安装,则会出现错误消息。
Hope my answer help you
希望我的回答对你有帮助

