Hot answers tagged

13 votes
Accepted

Filter Collection by Multiple Criteria

You can build the LINQ query in several steps by appending new where clauses ...
Olivier Jacot-Descombes's user avatar
8 votes
Accepted

MVVM - ObservableCollection & Entity Framework DbContext

An EF DbContext is an IDisposable object that should be as short-lived as possible. There are a number of problems with this: <...
Mathieu Guindon's user avatar
8 votes
Accepted

Winform, with a workaround to avoid dependencies

If you start thinking with code, you will almost always end up doing bad things. Why? Because it is not natural. OK, no more preaching and let's get to work. Review of Your Code I apologize for ...
CodingYoshi's user avatar
7 votes
Accepted

WPF Mvvm async function ViewModel

General Your model should not return an ObservableCollection because that collection should be used only if its change notification ability is needed (e.g. with ...
JanDotNet's user avatar
  • 8,538
7 votes
Accepted

ViewModels Mediator with multiple generic callbacks

I don't feel like you should override + and -. Fine, it makes the syntax cuter, but it makes your code much less readable for ...
IEatBagels's user avatar
  • 12.4k
6 votes
Accepted

Monitoring the clipboard

Your code looks fine except for two points: a Dispose() method should never throw an exception but yours will likely throw one if it is called twice. This can be ...
Heslacher's user avatar
  • 50.3k
6 votes

AsyncCommand using MVVM and WPF

You should avoid code duplication in constructors. For larger objects this practice can quickly spin out of control. Re-use existing constructors instead: ...
Nikita B's user avatar
  • 13k
6 votes
Accepted

Data Model for a Memory Game

Design review or code review? Well, in real-world projects we communicate the design in its own way first, not just say “here’s code that implements my design.” I would like to see a paragraph ...
JDługosz's user avatar
  • 11.3k
6 votes

Scraping an parsing jockeys data using Task.Run

if (TaskCancellation == true) { break; } ...
Peter Taylor's user avatar
  • 24.1k
5 votes
Accepted

Code Explorer 2.0: A folder hierarchy to organize VBA projects

Looks pretty good. Some readability improvements: Magic character '.' should be moved into a named constant like ...
ChrisWue's user avatar
  • 20.3k
5 votes

Fetching, adding, and viewing games

Disclaimer: I don't review Xaml, I focus on the C# part only. ...
Heslacher's user avatar
  • 50.3k
5 votes
Accepted

MVVM Navigation WPF

One of the basic principals of MVVM is, that the view model doesn't know the view. My experience is, that this principal can be (and should be) applied for the most cases. However, it is possible that ...
JanDotNet's user avatar
  • 8,538
5 votes

ViewModels Mediator with multiple generic callbacks

You should not be calling it a dictionary because you changed the expected behaviour of the IDictionary interface. The MSDN clearly states that the getter of the ...
t3chb0t's user avatar
  • 44.1k
5 votes

ViewModels Mediator with multiple generic callbacks

I fully agree with TopinFrassi and t3chb0t. Some other points The MultiDictionary and the AddableHashSet are not required and ...
JanDotNet's user avatar
  • 8,538
5 votes

ViewModels Mediator with multiple generic callbacks

Don't test whether a HashSet contains a key if you want to remove it: if(list.Contains(value)) { list.Remove(value); } ...
Deduplicator's user avatar
  • 18.9k
5 votes
Accepted

MVVM pattern in Xamarin login form

No, it's not correct. View-model shouldn't contain anything related to view. It means LoginViewModel shouldn't contain references on progress bar and label. ...
Maxim's user avatar
  • 2,532
5 votes
Accepted

Test all properties with single test function

too vague & hiding test cases ...
t3chb0t's user avatar
  • 44.1k
5 votes
Accepted

Visual Studio exception visualizer for lengthy exception messages

...
Peter Taylor's user avatar
  • 24.1k
5 votes

MVVM model letting the user select a directory in a testable manner

Review You always instantiate inner dialogs for both platforms, even though one will never be called. Your platform will not change at runtime. Use the Lazy pattern to only instantiate the required ...
dfhwze's user avatar
  • 13.9k
4 votes
Accepted

Fetching, adding, and viewing games

You should only use OneTime bindings when binding to classes which do not implement INotifyPropertyChanged interface, otherwise ...
Nikita B's user avatar
  • 13k
4 votes

MIST - auto-implemented, attribute-driven .NET notification mechanism

That's looks great, I didn't know that Cecil can be integrated in MSBUILD. To add to another reviewers: You are using OpCodes.Call, consider using ...
Bogdan Mart's user avatar
4 votes

AsyncCommand using MVVM and WPF

I realized that the question is quite old, but still seems to have some relevance. I guess people feel attracted, because they expect to find a usable asynchronous ...
BionicCode's user avatar
4 votes

ListBox with a dynamic number of TextBox elements

ExcludedPath If the value of the properties aren't changed you won't need to raise the PropertyChangedEvent so a simple check like ...
Heslacher's user avatar
  • 50.3k
4 votes

ListBox with a dynamic number of TextBox elements

There is not much to improve... additional to the points from Heslacher: a) That code: ...
JanDotNet's user avatar
  • 8,538
4 votes

Converting models into a list of ViewModels

I don't know what to say more then: make it an extension and return an IEnumerable<T> instead by using linq do you mean something like this? ...
t3chb0t's user avatar
  • 44.1k
4 votes

MP3 tag Project in MVVM style

Avoid using regions or use them only sparingly. Grouping fields or constructors doesn't make any sense and doesn't help anyone. Avoid the this keyword. It's rarely ...
t3chb0t's user avatar
  • 44.1k
4 votes
Accepted

C# MVVM pattern sanity check

MVVM MVVM is normally structured as following: ...
Pieter Witvoet's user avatar
4 votes
Accepted

Testing async method call from constructor

Trying to load the data asynchronously in the constructor is a bad idea and in my opinion goes against what the constructor is for. Constructors cannot be async, and asynchronous initialization can ...
Nkosi's user avatar
  • 3,236
4 votes

Addition Program using wpf through MVVM

Some quick remarks: Give things proper names. "Model.cs" is a bad name for a class, and in your case it is even the name of a namespace. Microsoft has Naming Guidelines; please follow them. Same for ...
BCdotWEB's user avatar
  • 11.2k
4 votes
Accepted

MVVM model letting the user select a directory in a testable manner

Additionally to the great answer of dfhwze, I'll provide an alternative implementation that includes some of the suggestions. Primary, I would implement each case separatly and create / dispose the ...
JanDotNet's user avatar
  • 8,538

Only top scored, non community-wiki answers of a minimum length are eligible