推荐的 WPF 项目结构?

发布于 2024-09-13 21:07:19 字数 437 浏览 11 评论 0原文

我非常注重良好的 Visual Studio 解决方案和项目结构。

我即将开始一项 WPF 概念验证工作。

谁能推荐一些他们使用过并且发现效果很好的 WPF 项目结构?

这里 http://drwpf.com/blog/2007/10/01/58/< /a>

他们有一个我喜欢的建议:

    Root
    - Pages
    - Controls
    - Resources
    App.xaml

其中页面、控件和资源是文件夹。

有没有人发现某些结构运作良好/运作不佳?

另外,如果你们同意的话,我不想进入“模型视图演示者”讨论。

I'm a stickler for good Visual Studio Solution and Project structures.

I'm about to start a WPF proof of concept piece of work.

Can anyone recommend some WPF Project structures they have used and found worked well?

Here http://drwpf.com/blog/2007/10/01/58/

They have one recommendation which I like:

    Root
    - Pages
    - Controls
    - Resources
    App.xaml

Where Pages, Controls and Resources are folders.

Has anyone found certain structures work well / don't work well?

Also I'd rather not get into a 'Model View Presenter' discussion if that's ok with you guys.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

守不住的情 2024-09-20 21:07:19

我同意阿里姆巴达的观点。我们还为视图和视图模型创建了不同的项目。在大型项目中,它使维护变得更容易。我们拥有的目录 -

 - ViewsRoot
    + Base
    + Controls 
    + Documentation 
    + Forms(Windows)
    + Reports
    + Resources 
    + Themes 
    + Utilities 
    App.xaml

 - ViewModelsRoot
    + Collection
    + Commands
    + Converters
    + Resources 
    + TemplateSelectors
    + ViewModels
    + Views (Interfaces for views) 
    Constants.cs 
    Utility.cs

我也相信提前规划结构,这使得所有开发人员很容易习惯它并遵循相同的结构。稍后执行此操作会增加混乱,并且在您必须创建单独的项目时会很痛苦。这就是我的观点,并且我愿意了解其他更好的方法。

I agree with alimbada. We have also created different projects for View and View models. It makes things easier to maintain in case of huge projects. Directories we had were -

 - ViewsRoot
    + Base
    + Controls 
    + Documentation 
    + Forms(Windows)
    + Reports
    + Resources 
    + Themes 
    + Utilities 
    App.xaml

 - ViewModelsRoot
    + Collection
    + Commands
    + Converters
    + Resources 
    + TemplateSelectors
    + ViewModels
    + Views (Interfaces for views) 
    Constants.cs 
    Utility.cs

I also believe in planning the structure in advance, this makes easy for all developers to get used to it and follow the same. Doing this later adds confusion and is painful in case you have to create seprate projects. Thats my view and am open to know of other better approches for this.

能怎样 2024-09-20 21:07:19

我倾向于有以下目录:转换器、模型、资源、ViewModels 和视图。

我还看到了一个解决方案,其中 View 和 ViewModel 已拆分为单独的项目(请参阅 BubbleBurst

I tend to have the following directories: Converters, Models, Resources, ViewModels and Views.

I've also seen a solution where the View and ViewModels have been split out into separate projects (see BubbleBurst on CodePlex)

隱形的亼 2024-09-20 21:07:19

我完全支持这篇文章中表达的担忧。如果没有事先深思熟虑的可靠结构,我就无法工作。我什至更进一步,尝试建立类似伪代码工作流程的东西,理论上可以通过任务来完成,希望能够在 IDE 的帮助下完成。
目前,我可以与任何感兴趣的人分享我使用 Bing 创建的初步工作流程:
创建 TreeView+DataGrid 的初步工作流程
从这篇(10 岁!?)帖子中,我可以看到这比我想到的要多得多,但它是可行的。
当然,首先必须确定应用程序的类型。我的窗口类型为 WPF-DBFirst-desktop,当前窗口的类型为 TreeView-DataGrid,代码可以根据一种或多种模式并使用不同的语言创建。而且,在与 Bing 一起工作 4 个月后,我可以看到人工智能将为此提供非常强大的帮助。 Microsoft/Visual Source 何时允许人工智能审查我们的代码是否有错误?
这不是让生活变得更轻松吗?尤其是当您 80 岁时,这是您的第一个应用程序?

I fully support the concern expressed in this post. I just can´t work without a solid previously thought-out structure. I am even going a bit further and trying to establish something like a pseudocode workflow which, in theory, could be filled out task by task, hopefully with the help of the IDE.
At the moment I can share with whoever is interested a preliminary workflow that I created with Bing:
preliminary wfw for creating a TreeView+DataGrid
From this (10 years old!?) post, I can see that there is a lot more to this than what I have come up with, but it is doable.
Of course, the type of applications would first have to be identified. Mine would be of the type WPF-DBFirst-desktop, and the current window would be of the type TreeView-DataGrid, the code could be created from one or several patterns and in different languages. And, after 4 months of working alongside Bing, I can see that AI would be a very powerful help for this. When will Microsoft/Visual Source include the possibility for our code to be reviewed for errors by AI?
Wouldn´t that make life easier? particularly when you are 80 and it is your first app?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文