13
votes
Accepted
Filter Collection by Multiple Criteria
You can build the LINQ query in several steps by appending new where clauses
...
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:
<...
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 ...
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 ...
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 ...
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 ...
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:
...
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 ...
6
votes
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 ...
5
votes
Fetching, adding, and viewing games
Disclaimer: I don't review Xaml, I focus on the C# part only.
...
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 ...
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 ...
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 ...
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);
}
...
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. ...
5
votes
Accepted
5
votes
Accepted
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 ...
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 ...
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 ...
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 ...
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
...
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:
...
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?
...
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 ...
4
votes
Accepted
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mvvm × 184c# × 146
wpf × 95
xaml × 20
.net × 12
dependency-injection × 12
android × 11
design-patterns × 10
swift × 10
object-oriented × 9
java × 7
xamarin × 7
javascript × 6
beginner × 6
kotlin × 6
sqlite × 6
databinding × 6
entity-framework × 5
ios × 5
async-await × 5
unit-testing × 4
authentication × 4
rubberduck × 4
system.reactive × 4
uwp × 4