Hot answers tagged

20 votes
Accepted

MVVM data binding for a video encoding form

Unlearn WinForms. Your view has way too many concerns. As @TeaDrivenDev mentioned, XAML is pretty verbose... and WPF bindings will turn your view model into a very combersome mess of getters and ...
user avatar
18 votes
Accepted

Simon Says: "Make me a pretty game"

Well, first questions is: why don't you use MVVM? Contents of your App class look like something that should be implemented on model/view model level. This looks ...
user avatar
  • 13k
15 votes

Simon Says: "Make me a pretty game"

Magic numbers, you have at least one of them in class App: private async Task PlaySequence() you should extract this to either a ...
user avatar
  • 50k
12 votes
Accepted

Overlap detection for laying out elements on a page

Please, pretty please, use braces. They are totally lacking in your code. ...
user avatar
  • 5,561
12 votes

Understanding the MVVM concepts and validation of my code

Scratching the surface... Naming I have to second @BCdotNET's comment, the "cl" prefixes are Hungarian, confusing and against C# naming standards. Types should be named in ...
user avatar
11 votes
Accepted

Alternative to a Grid in a StackPanel form for an easier way of inserting new rows

WPF readability To keep your xaml looking clean, I reccommend using self closing tags <RowDefinition /> vs ...
user avatar
  • 4,268
11 votes
Accepted

A ViewModel using ReactiveUI 6 that loads and sends data

Sorry to disappoint, but you did everything right! This is a quite good example of using RxUI, Akavache, and Refit together. The only thing I would change, is to not immediately call ...
user avatar
  • 356
11 votes

MVVM data binding for a video encoding form

After reading some of the comments and looking at a few things I think the underlying question is still unanswered. I'll break this answer up into 2 sections. One unit testing, and two smaller code. ...
user avatar
11 votes

Speech Synthesis to showcase how various voices sound with System.Speech.Synthesis

Take a look at arrays. It will allow you to quickly add and remove future options without needing to change the logic of the code. It will also allow you to possibly add more complex logic in a single ...
user avatar
11 votes

C# WPF Simple Calculator

I'm glad to see someone did a WPF calculator, and I hope that I can add to what was already stated. Before I get started: "yes this is a MVVM rant". Now that I got that out of the way, I can ...
user avatar
11 votes
Accepted

Task timer async

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

Add or view pattern with MVVM

View The XAML is rather... simplistic: Each label and textbox (and the Save button) stretches all the way across the window. Instead of just dumping controls into a ...
user avatar
10 votes
Accepted

Speech Synthesis to showcase how various voices sound with System.Speech.Synthesis

One way to remove that ugly block of ifs is to use a string[]. You'd define it like this: ...
user avatar
  • 5,463
10 votes
Accepted

WPF MVVM Navigation

I think ObjectBase name is too generic. Class name should reflect its purpose. ViewModelBase is an example of better naming. ...
user avatar
  • 13k
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 ...
user avatar
10 votes

Countdown control with arc animation

There are a couple of things which could be more consistent. ...
user avatar
9 votes
Accepted

Noughts and Crosses WPF app

First the simple stuff: Standard naming convention for methods in C# is PascalCase while you run a mix of camelCase and ...
user avatar
  • 20.1k
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 ...
user avatar
  • 8,438
9 votes
Accepted

Markdown Display in WPF

...
user avatar
8 votes
Accepted

Am I handling "spot the missing DLL" right?

As I mentioned in the comments, the code you've posted could very well be doing anything that could potentially throw any exception. ...
user avatar
8 votes
Accepted

WPF Calculator Code

Duplication ...
user avatar
  • 22.2k
8 votes
Accepted

Resx Editor in WPF

I would like to add a few thoughts on WPF part of your code: If you need your buttons to occupy half the screen, you should simply replace StackPanel with ...
user avatar
  • 13k
8 votes

Injecting JavaScript to website for ordering products

Alright, let's go through the code top-to-bottom. using Brushes = System.Windows.Media.Brushes; using SystemFonts = System.Windows.SystemFonts; Any particular ...
user avatar
8 votes

C# WPF Simple Calculator

Here're things that I think should be improved: private double a = 0; // the first number private double b = 0; // second number Encapsulate those in a ...
user avatar
  • 43.8k
8 votes
Accepted

Crack the safe, find the right combination

XAML: First I would recommend that you use the Grid.RowDefinitions and Grid.ColumnDefinitions more / better. Then all the mess ...
user avatar
  • 897
8 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 ...
user avatar
  • 43.8k
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: <...
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 ...
user avatar
  • 13.8k
7 votes

Overlap detection for laying out elements on a page

About your question: All of your bool variables are assigned to for each iteration without any concern to what the previous value was. This is a good indication ...
user avatar
7 votes

Understanding the MVVM concepts and validation of my code

Picking up some of what Mat's Mug left clDelegateCommand ...
user avatar
  • 50k

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