简体   繁体   English

使用C#在WPF中创建项目的先决条件

[英]Prerequisites for creating a project in WPF with C#

I have been thinking a lot lately about making a fully functional project with a small team using C# WPF UI. 最近,我一直在考虑如何使用C#WPF UI与一个小型团队一起创建功能齐全的项目。 The goal is to create a construction management software. 目的是创建一个施工管理软件。 It is not about "reinventing the wheel", the idea behind this is to gain experience in software programming. 这与“重新发明轮子”无关,其背后的想法是获得软件编程方面的经验。

Some of the general knowledge that we possess: 我们拥有的一些常识:

  • We have been introduced in OOP at the University. 我们已经将OOP引入了大学。

  • We have programmed in Visual Studio before, but only standard C#. 我们以前在Visual Studio中进行过编程,但只有标准C#。

  • We watched this playlist of Tutorials on WPF 我们在WPF上观看了此教程的播放列表

  • We have also been looking at some tamplates on Telerik, but our understanding in WPF is too shallow right now to comprehend them. 我们也一直在研究Telerik上的一些模板,但是我们对WPF的了解目前太浅,无法理解它们。

Some of the things we would love to understand: 我们想了解的一些事情:

  • What SQL Server would be appropriate for this kind of software, we used Microsoft SQL Server so far. 到目前为止,哪种SQL Server适用于这种软件,我们已使用Microsoft SQL Server。

  • Any recommendation of books that might help us enhance our skill in building a database such as: reading from it, creating appropriate relation-ships, etc would be greatly appreciated. 推荐任何可能有助于我们提高建立数据库技能的书籍, 例如:从数据库中阅读,建立适当的关系等等

  • Any recommendation of books for C#, LINQ or anything you know and might help us. 有关C#,LINQ的书籍的任何建议或任何您知道且可能对我们有帮助的书籍。

We want to treat this project seriously and we know that we will struggle with this documentation step for quite a while. 我们想认真对待这个项目,并且我们知道我们将在相当长的一段时间内难以完成这个文档步骤。 Please let us know if there is any other step or fundamental thing that we missed, thank you! 如果您错过了其他任何步骤或基本事项,请告诉我们,谢谢!

I really enjoyed the book Pro C# 7 . 我真的很喜欢Pro C#7 I think it's very well written and comprehensive. 我认为它写得很好而且很全面。 It even covers WPF at a reasonable level. 它甚至涵盖了合理水平的WPF。 There are also chapters on dealing with SQL databases. 也有关于处理SQL数据库的章节。

Once you're familiar with C# and some WPF basics, you can read Windows Presentation Foundation 4.5 Cookbook . 熟悉C#和一些WPF基础知识之后,您可以阅读Windows Presentation Foundation 4.5 Cookbook I found that their specific examples and explanations helped me understand how WPF works. 我发现他们的特定示例和解释帮助我理解了WPF的工作原理。

Then it's about getting your hands dirty by trying things out. 然后就是尝试将事情弄脏。 You'll find a lot of resources online as you search for problems you run into. 搜索遇到的问题时,会在网上找到很多资源。 There are tons of blog posts explaining specific WPF solutions, and of course there's StackOverflow. 有大量的博客文章解释了特定的WPF解决方案,当然还有StackOverflow。

Good luck. 祝好运。

With WPF you should use MVVM. 对于WPF,您应该使用MVVM。 Unfortunately, there are no good books that will teach you that though. 不幸的是,虽然没有好书可以教你这一点。 I have a bunch of articles and samples on TechNet wiki and Gallery. 我在TechNet Wiki和Gallery上有一堆文章和示例。 A number of these originated from coaching and teaching newbies. 其中许多源于辅导和教学新手。

https://social.technet.microsoft.com/wiki/contents/articles/30959.user-page-andy-oneill.aspx https://social.technet.microsoft.com/wiki/contents/articles/30959.user-page-andy-oneill.aspx

Some of what's in there ought to help. 其中的一些内容应该有所帮助。

Use viewmodel first for navigation. 首先使用viewmodel进行导航。 Don't use pages, use usercontrols and bind content to a property returns a viewmodel. 不使用页面,使用用户控件并将内容绑定到属性将返回视图模型。 Template using datatype=vmtype into usercontrols in the ui. 模板使用datatype = vmtype进入ui中的usercontrols。

I think redcurry's recommendation of pro c#7 is good. 我认为redcurry对pro c#7的推荐不错。 I like Jon Skeet's c# in depth. 我更喜欢Jon Skeet的c#。 For database theory. 用于数据库理论。 Bear in mind it has changed very little in 20 years. 请记住,它在20年内变化很小。 Hence rather old books are still good and you can pick up copies really cheap nowadays. 因此,相当古老的书籍仍然不错,如今您可以以非常便宜的价格领取书籍。 For example https://www.amazon.co.uk/dp/0201752840?slotNum=0&linkCode=g12&imprToken=uS5pZKPLsrVEOJop6zd4iA&creativeASIN=0201752840&tag=javarevisit01-21 well worth a fiver. 例如, https ://www.amazon.co.uk/dp/0201752840?slotNum = 0& linkCode = g12 imprToken = uS5pZKPLsrVEOJop6zd4iA creativeASIN = 0201752840 tag = javarevisit01-21非常值得。 My big tips on indexing: By default - add an auto integer as primary key rather than using any natural key you think will "always" be unique. 我关于索引的重要提示:默认情况下-添加自动整数作为主键,而不是使用您认为“总是”唯一的自然键。 They inevitably change. 它们不可避免地发生变化。

Don't add too many indexes. 不要添加太多索引。

The old advice is still true. 旧的建议仍然是正确的。 Normalise 'til it hurts and then denormalise 'til it works. 归一化直到伤害,然后归一化直到起作用。

SQL server is good, easy to find online advice and sql express is free. SQL Server很好,很容易找到在线建议,而sql express是免费的。 Jobs are very useful but the "full" version of sql server is expensive. 作业非常有用,但是SQL Server的“完整”版本价格昂贵。 If you will have large quantities of sql server and low/no budget then MySQL. 如果您将拥有大量的sql服务器且预算较低/没有预算,则使用MySQL。

There are free resources for sql server on the web. Web上有免费的SQL Server资源。 For example http://www.sqlservercentral.com/ 例如http://www.sqlservercentral.com/

I've never read a book on LINQ. 我从没看过有关LINQ的书。 I learnt it as I went by looking up stuff on the web. 我在网上查找资料时就学到了。 I rely heavily on intellisense when writing anything isn't fairly simple. 当编写任何东西不是很简单时,我都严重依赖于智能感知。 My big tip on LINQ is not to use it for complex queries and as complexity increases in one you're writing you should look at the generated sql. 我对LINQ的最大建议是不要将其用于复杂的查询,并且随着您编写的复杂性增加,您应该查看生成的sql。 Complicated linq is prone to generating terribly inefficient sql. 复杂的linq倾向于生成效率极低的sql。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM