Skip to main content
11 votes
Accepted

Task timer async

Initial observation is that you should avoid async void like private async void start() { //... } except for event ...
Nkosi's user avatar
  • 3,246
10 votes
Accepted

Using Mutex to prevent multiple WPF application launches

Thing that make me more unhappy is mixing UI logic of your MainWindow class with this single instance logic that really belongs to process (and then ...
Adriano Repetti's user avatar
10 votes

Countdown control with arc animation

There are a couple of things which could be more consistent. ...
Peter Taylor's user avatar
  • 24.1k
10 votes
Accepted

Markdown Display in WPF

...
Peter Taylor's user avatar
  • 24.1k
9 votes
Accepted

Find a value in a comma delimited String

This could be a better/cooler way: return (parameter as string)?.Split(',').Contains(value as string) ?? (object)false; Your example is so short that I don't ...
t3chb0t's user avatar
  • 44.3k
9 votes
Accepted

Simple pack Uri builder

Your code looks pretty got but there are some things that you can simplify, probably the switch cases are the most unwanted part of your code. Verbatim strings ...
Denis's user avatar
  • 8,508
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

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 ...
dfhwze's user avatar
  • 13.9k
7 votes

Shuffles male or females names based on Fisher Yates algorthim

The logic part of your code should definitely be re-written, but since it's one big mess I'm not going to touch that. See whether you really need that many options. You probably don't. I might expand ...
Mast's user avatar
  • 13.4k
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

WPF Multiscreen Media Application

A way to reduce the amount of code in initialize and allow it to be more flexible is by putting your MediaElements into an array: ...
Bruno Costa's user avatar
  • 5,566
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 ...
Nikita B's user avatar
  • 13k
6 votes

Another DataGrid (ObservableCollection) Filtering Method

You can refactor this into LINQ query for (arguably) better readability. ...
Nikita B's user avatar
  • 13k
6 votes
Accepted

Optimize WPF application (2 WPF Windows and a huge mess)

I won't suggest you any miraculous improvements because the code is extremely hard to read this is, currently the worst mess in your code are the meaningless names. ...
t3chb0t's user avatar
  • 44.3k
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 ...
Maxim's user avatar
  • 2,542
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 😀 ...
Kelson Ball's user avatar
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) ...
Nikita B's user avatar
  • 13k
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 ...
JanDotNet's user avatar
  • 8,538
6 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 ...
abuzittin gillifirca's user avatar
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 ...
dfhwze's user avatar
  • 13.9k
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 ...
dfhwze's user avatar
  • 13.9k
6 votes

Loading BitmapImages out of a Zip file

var zipFile = ZipFile.OpenRead(ChapterLocation); ... zipFile.Dispose(); One word: using. ...
Peter Taylor's user avatar
  • 24.1k
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 ...
BCdotWEB's user avatar
  • 11.2k
6 votes

Using default implementations to superpower flags enums with C#

What are you getting that you couldn't get with properties? ...
RobH's user avatar
  • 17k
5 votes

Shuffles male or females names based on Fisher Yates algorthim

Instead of two lists like @Mast proposed, you could use a Dictionary and a List like: ...
fernando.reyes's user avatar
5 votes

Simple pack Uri builder

You're likely to run across 101 different little gotchyas by rolling your own here. For example, you're not escaping any invalid characters in your solution. I would build your implementation on top ...
RubberDuck's user avatar
  • 30.8k
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

Using SQLite in WPF Project

Refactoring for Modularity The whole point of using classes is making your code more modular. The ViewModel doesn't care about the database type. It could be SQLite, but it could also be PostgreSQL, ...
Queder's user avatar
  • 255

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