11
votes
Accepted
Task timer async
Initial observation is that you should avoid async void like
private async void start() {
//...
}
except for event ...
10
votes
Countdown control with arc animation
There are a couple of things which could be more consistent.
...
10
votes
Accepted
9
votes
Accepted
Non-Entity framework database interaction model
Application Architecture
The architecture of the application is divided into models and views to separate the data and business model
from the user interface. Within the models there is an ...
7
votes
Countdown control with arc animation
1) DispatcherTimer is good for periodic UI updates, but it should not be used to measure time, because it is just not accurate enough. For precise time measurement ...
7
votes
Non-Entity framework database interaction model
I won't read this code beginning to end. Some basic advice:
Namespaces
ExperimentSimpleBkLibInvTool.ModelInMVC.DictionaryTabelBaseModel doesn't follow naming ...
6
votes
Task timer async
You're doing all your work in the 'code-behind' rather than a seperate viewmodel class, but for a project this small doing that 'right' would double the amount of code 😀
...
6
votes
Accepted
Xaml Wpf Snake game
I'm going to review only the code in your post.
You don't use WPF as you have to. In WPF you don't need to perform clear/draw sequence. The right way is to use MVVM and update coordinates of the snake'...
6
votes
Accepted
Loading a XAML file related to a control programmatically?
The conventional way of attaching default template to custom control is to specify default style inside a special resource dictionary. For this approach to work three conditions should be met:
1) ...
6
votes
Accepted
Simple calculator in C# WPF
It's common to write down access modifier for fields
Defining one field per line makes the code more readable because you dont have to scan each declaration line for multiple variables
Initialization ...
6
votes
WPF Palindrome Checker Application
Specification
Palindrome
From wikipedia:
A palindrome is a word, number, phrase, or other sequence of
characters which reads the same backward as forward, such as madam or
racecar or the ...
6
votes
Accepted
TreeView class in WPF class
Review
I see no reason to have 3 constructors, each invoking the other, when two of them are private and only called by another constructor. Keep it simple.
You check for ...
6
votes
Loading BitmapImages out of a Zip file
var zipFile = ZipFile.OpenRead(ChapterLocation);
...
zipFile.Dispose();
One word: using.
...
6
votes
Accepted
WPF login screen and share username and access id across other forms
Some quick remarks:
If you're doing WPF, you should be using MVVM. There is a learning curve, but your code will be vastly easier to maintain once you add more and more features.
Much of the code ...
6
votes
Using default implementations to superpower flags enums with C#
What are you getting that you couldn't get with properties?
...
5
votes
Accepted
Sorting ListView Columns
You do not need three methods for sorting because the only difference between them is the property that you use for sorting. You might as well have only one method that takes a ...
5
votes
Accepted
5
votes
Concurrent observable collection
Raising events inside of a lock is a code smell. Locks should be short lived as possible. Plus since, maybe today, you know what the events will do that doesn't mean in the future they won't change....
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 ...
5
votes
Accepted
Right way to handle, log and display exceptions
The main reason for exceptions (from a developer point of view) is to detect malfunctioning code. Because once this malfunctioning code is executed, the result of an operation and therefore the state ...
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
CommandBinding refresh on parameter changed
OK several years later and looking back I now know what I was doing wrong
this is a misuse of the command parameter
the command parameter is not a variable that you pass into the command on ...
4
votes
Rounded borders for different controls (Button, TextBox, ComboBox) via Attached Property
Holy crap. All that just to get Rounded corners?
Yes, I wholeheartedly agree with that comment. It is astonishing, how some things that sound trivial - are extremely complicated in WPF. But there is ...
4
votes
Accepted
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
WPF Bitmap / BitmapFrame to multi-page / multi-frame TIFF with JPEG encoding
Henrik covered a number of points which I would have raised, so I won't repeat those.
namespace TIFF
{
public class Jpeg
seems inconsistent to me. The ...
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
wpf × 331c# × 320
mvvm × 90
xaml × 67
.net × 34
beginner × 20
performance × 14
event-handling × 13
multithreading × 12
design-patterns × 10
async-await × 10
asynchronous × 9
entity-framework × 8
rubberduck × 7
databinding × 7
object-oriented × 6
image × 6
dependency-injection × 6
tic-tac-toe × 5
active-directory × 5
game × 4
linq × 4
calculator × 4
database × 4
generics × 4