Learning WPF and MVVM

I have recently joined a new developing project building a thick client application using WPF and MVVM. I have developed applications in various .NET frameworks from 1.1 through to 3.5 and all major technologies; WebForms, MVC and WinForms. On all of my projects I have enjoyed every minute of it but on this project I feel that I am struggling and as such not enjoying it as much. When .NET 3.5

学习WPF和MVVM

我最近加入了一个使用WPF和MVVM构建胖客户端应用程序的新开发项目。 我已经开发了从1.1到3.5以及所有主要技术的各种.NET框架的应用程序; WebForms,MVC和WinForms。 在我所有的项目中,我都喜欢每一分钟,但是在这个项目中,我觉得我很挣扎,因此没有那么享受。 当.NET 3.5在2008年推出时,我非常喜欢学习新的语言特性(LINQ,MVC,Lambda表达式等),并且涉足WPF,所以请不要假设我反对学习新的东西。 但是这个项目的学习

Using the same .proto file for both a C# and C++ project

I am attempting to use the same .proto file (protobuf) for a C# and a C++ project. My problem is that the C# file requires an import and some options set (protobuf-csharp-port) while the C++ file doesn't. Is there any way I can tell protoc to ignore imports/options under certain circumstances? Currently my only way around this is to create two different .proto files, and update both when

对于C#和C ++项目使用相同的.proto文件

我正在尝试为C#和C ++项目使用相同的.proto文件(protobuf)。 我的问题是,C#文件需要导入和一些选项集(protobuf-csharp-port),而C ++文件则不需要。 有什么方法可以告诉protoc在某些情况下忽略进口/选项吗? 目前,我唯一的解决方法是创建两个不同的.proto文件,并在进行更改时进行更新。 啊,这个栗子:( 是的,这是一个痛苦。 不,我目前没有很好的方法。 我想要一种说法:“这个导入的文件仅用于扩展选项,并

Is there a .NET/C# wrapper for SQLite?

I'd sort of like to use SQLite from within C#.Net, but I can't seem to find an appropriate library. Is there one? An official one? Are there other ways to use SQLite than with a wrapper? From https://system.data.sqlite.org: System.Data.SQLite is an ADO.NET adapter for SQLite. System.Data.SQLite was started by Robert Simpson. Robert still has commit privileges on this repository

是否有SQLite的.NET / C#包装?

我有点喜欢从C#.Net中使用SQLite,但我似乎无法找到合适的库。 有一个吗? 官方的? 有没有其他的方式来使用SQLite比包装? 从https://system.data.sqlite.org: System.Data.SQLite是SQLite的ADO.NET适配器。 System.Data.SQLite由Robert Simpson创建。 Robert仍然对此存储库拥有提交权限,但不再是活跃的贡献者。 开发和维护工作现在主要由SQLite开发团队执行。 SQLite团队致力于长期支持System.Data.SQLite。

Deleting nodes from large XML files

i have a large XML document that is to large to be loaded using XmlDocument. i need to go through each child of a node and check it agaisnt a condition, then delete accordingly , then finally save the document. <root> <node id="1"> <child delete="false"/> </node> <node id="2"> <child delete="true"/> </node> </root> for example i would want to del

从大型XML文件中删除节点

我有一个很大的XML文档可以使用XmlDocument加载。 我需要通过一个节点的每个孩子,并检查它是否违反条件,然后相应地删除,最后保存文档。 <root> <node id="1"> <child delete="false"/> </node> <node id="2"> <child delete="true"/> </node> </root> 例如我想要删除节点2,并且此过程必须重复数百次。 任何帮助,将不胜感激。 谢谢。 编辑可能有人解释我如何去做这

displaying a "dynamic" table

I'd like to display a table of items in WPF. In general that's not that hard, except that: I know, which columns I want to display only at runtime (user in a way defines them), and I'd like to avoid using codebehind: the XAML, where I want to display the table is inside a DataTemplate , which is inside another DataTemplate etc. Introducing CodeBehind there will be problematic (th

显示一个“动态”表格

我想在WPF中显示一个项目表。 一般来说,这并不难,除了: 我知道,我只想在运行时显示哪些列(用户以某种方式定义它们),以及 我想避免使用代码隐藏:在XAML,在这里我想显示的表里面是一个DataTemplate ,这是另一个里面DataTemplate等引入代码隐藏会有问题(虽然我会做,如果我没有其他的选择) 。 我虽然使用WPF的DataGrid ,它足够聪明,可以在运行时提取列名(取决于集合项的属性),但我知道哪些列只在运行时显示

Best practice for displaying the same collection in multiple datagrid controls

I have a situation where I need to create a tab control, with a datagrid on each tab. I am using an observable collection and for an example the items in the collection are of either group A, B, C. One tab/datagrid would display items from group A, and subsequent tab/datagrids would display groups B & C respectively. Any edits to any of the 3 datagrids would have to be ultimately captured i

在多个数据网格控件中显示相同集合的最佳实践

我有一种情况,我需要创建一个选项卡控件,每个选项卡上都有一个数据网格。 我正在使用一个可观察的集合,例如集合中的项目是A,B,C组中的一个。一个选项卡/数据网格会显示来自A组的项目,后续的选项卡/数据网格将分别显示组B和C。 对任何3个数据网格的任何编辑都必须最终在可观察集合中捕获。 我的问题是完成此任务的最佳方法是什么? 我对WPF比较陌生,我的第一种方法是创建一个用户控件数据网格,因为每个数据网格将具

Grouping and displaying a collection of events in a table with WPF

I'm after some WPF advice; I have a list of objects that define a time, event type and description like so: public class AnEvent { public EventType EventType { get; set; } public DateTime TimeStamp { get; set; } public string Description { get; set; } } I want to display the collection of items like this: ------------------------------------- | Time | Type1 | Type3

使用WPF在表格中分组并显示一组事件

我经历了一些WPF的建议; 我有一个定义时间,事件类型和描述的对象列表,如下所示: public class AnEvent { public EventType EventType { get; set; } public DateTime TimeStamp { get; set; } public string Description { get; set; } } 我想显示这样的项目的集合: ------------------------------------- | Time | Type1 | Type3 | ------------------------------------- | 12:00 | Eve

What WPF C# Control is similar to a CWnd in C++?

What would be the best WPF control in C# (VS 2008) that you can place on a form that would allow you to do drawing similar to the "Paint" function for the CWnd class in C++? Also, that could display bitmaps, have a scroll bar, and the ability to accept user inputs (ie. MouseMove, Button Clicks, etc...). Basically all the functionality of a CWnd in a control on a WPF form? The UIElem

WPF C#控件与C ++中的CWnd类似吗?

C#(VS 2008)中最好的WPF控件是什么,你可以放在一个表单上,这样你就可以在C ++中为CWnd类绘制类似于“Paint”的绘图函数了? 此外,它可以显示位图,具有滚动条以及接受用户输入的能力(即MouseMove,Button Clicks等)。 基本上所有的功能的CWnd在WPF窗体上的控件? UIElement是支持输入和绘图的最低级元素。 虽然,使用WPF,你真的必须做很少的手动绘图。 你确定你需要这样做吗? 另外,滚动条永远不会继承你的元素。

Is a conversion from a pointer to type to a pointer to array of type safe?

A few days ago I stumbled on a code where an extensive use of conversions from pointer to type to pointer to array of type was made to give a bi-dimensional view of a linear vector in memory. A simple example of such a technique is reported below for clarity: #include <stdio.h> #include <stdlib.h> void print_matrix(const unsigned int nrows, const unsigned int ncols, double (*A)[nco

是从指针到类型转换为指向安全类型数组的指针?

几天前,我偶然发现了一个代码,其中广泛使用了从指针到类型的指针转换为指向类型 数组的指针,以便在内存中提供线性矢量的二维视图。 为了清楚起见,下面报道了这种技术的一个简单例子: #include <stdio.h> #include <stdlib.h> void print_matrix(const unsigned int nrows, const unsigned int ncols, double (*A)[ncols]) { // Here I can access memory using A[ii][jj] // instead of A[ii*ncols + j

new Uri decoding relative path

The following code... string date = DateTime.UtcNow.ToString("o"); Console.WriteLine(date); string encodedDate = WebUtility.UrlEncode(date); Console.WriteLine(encodedDate); Uri uri = new Uri("https://mywebsite/"); Console.WriteLine(uri.ToString()); string relativePath = $"/mM0jpk613J5lzY00c3EaxQ%3D%3D/{encodedDate}"; Console.WriteLine(relativePath); uri = new Uri(uri, relativePath); Console.Writ

新的Uri解码相对路径

下面的代码... string date = DateTime.UtcNow.ToString("o"); Console.WriteLine(date); string encodedDate = WebUtility.UrlEncode(date); Console.WriteLine(encodedDate); Uri uri = new Uri("https://mywebsite/"); Console.WriteLine(uri.ToString()); string relativePath = $"/mM0jpk613J5lzY00c3EaxQ%3D%3D/{encodedDate}"; Console.WriteLine(relativePath); uri = new Uri(uri, relativePath); Console.WriteLine(ur