Questions tagged [wpf]

Windows Presentation Foundation (WPF) is part of the Microsoft .NET framework used to create rich client user experiences for Windows application.

Filter by
Sorted by
Tagged with
44 votes
3 answers
6k views

Simon Says: "Make me a pretty game"

In Memoriam Ralph H. Baer, co-inventor of the original "Simon" game, died Saturday December 6th 2014, at 92. With his passing, this friendly little challenge inadvertently became a memorial to ...
Mathieu Guindon's user avatar
31 votes
1 answer
30k views

Single-instance WPF application

This is the code I implemented so far to create a single instance WPF application: ...
Tommaso Belluzzo's user avatar
29 votes
2 answers
30k views

Is nesting grids a good idea?

I find myself nesting a lot of grids inside grids in WPF. I just found myself 3 Grids deep, and stopped to think: "Should I be doing this?" Is there some kind of performance cost? Is it unmaintainable?...
Frames Catherine White's user avatar
21 votes
5 answers
12k views

MVVM, WPF Ribbon V4, with Prism

This weekend I've been having one heck of a time getting WPF Ribbon v4 working with MVVM and Prism (using unity). After much trial and error, I believe I have it working. I was hoping someone could ...
Scott's user avatar
  • 673
19 votes
1 answer
45k views

Sort ObservableCollection after added new item

For a WPF application, I have to sort the items in ObservableCollection after Added new item. ...
Jerry Bian's user avatar
17 votes
2 answers
5k views

Understanding the MVVM concepts and validation of my code

I have been learning MVVM concepts and trying to implement it in my new project. I want to validate my work that I have been doing these past days. I want to know if I follow correctly the MVVM ...
Sam's user avatar
  • 171
14 votes
1 answer
33k views

Is there a better way to get a child?

I have written the following code to get ImageColorPicker child: ...
Ron's user avatar
  • 243
14 votes
1 answer
14k views

A ViewModel using ReactiveUI 6 that loads and sends data

Most of the Rx Compelling Examples™ load and store data locally, which I don't find that Compelling. I spent some time coming up with how to best perform the following actions but want to make sure I ...
detroitpro's user avatar
14 votes
1 answer
6k views

Detecting UI thread hanging and logging stacktrace

I have an application that needs to always be responsive. I've written a class that is designed to monitor the UI thread. The goal is to provide useful information in the logs to be able to understand ...
Brian Flynn's user avatar
12 votes
2 answers
987 views

MVVM data binding for a video encoding form

I am creating a C# WPF application. I am intending to bind all of the GUI controls via data binding to my ViewModel, rather than code behind - as per MVVM. I have ...
Dan Sewell's user avatar
12 votes
4 answers
4k views

Countdown control with arc animation

I've implemented countdown timer control with arc animation that looks like this Implementation notes: For arc visualization I've created class Arc derived from <...
Vadim Ovchinnikov's user avatar
12 votes
1 answer
5k views

Markdown Display in WPF

I wanted to display a markdown document in WPF sensibly without relying on an HTML rendering system. I wrote a control based on the RichTextBox, and used Microsoft'...
user avatar
12 votes
4 answers
3k views

CommandBinding refresh on parameter changed

I need the command I am executing on a datagrids context menu to know which column was clicked on. XAML ...
MikeT's user avatar
  • 330
12 votes
1 answer
159 views

Rubberduck "GoTo Anything" Navigation

The next version of rubberduck is going to include a pretty nifty "goto anything" / find symbol navigation tool that lets the user enter an identifier name in a combobox: UI To achieve the ...
Mathieu Guindon's user avatar
12 votes
1 answer
5k views

Linq for ObservableCollection

Purpose ObservableCollection<T> is not strictly a WPF class, but its intended purpose seems to be for use in WPF. It's the standard implementation of ...
Peter Taylor's user avatar
  • 24.1k
11 votes
7 answers
2k views

Overlap detection for laying out elements on a page

How would you simplify/improve the readability of this code? Because even after my attempt to improve the readability I think it still looks messy. ...
WiiMaxx's user avatar
  • 467
11 votes
1 answer
521 views

Grid UI layout for a database

I've spent a few days making the transition from WinForms to WPF, and do not have much time for tutorials as the work needs to be done quickly. I was wondering if anyone could take a look at a sample ...
Dot NET's user avatar
  • 213
11 votes
2 answers
293 views

Markdown Markup Editor: MK2

Following on from this question I have added some more functionality to Markdown Markup, and made it more WPF idiomatic. It now supports saving data from any of the four boxes, and loading Markdown ...
Der Kommissar's user avatar
11 votes
2 answers
645 views

A Binary Editor with Live Text Preview

This is a tool I needed for some other things (it's incomplete, but almost done) which is essentially just a text-editor that has two text-boxes: the left being the binary view / raw bytes, the right ...
Der Kommissar's user avatar
11 votes
1 answer
1k views

Lots of Storyboards in XAML, huge file

After spending a few ages writing out every combination of triggers, bindings and storyboards, I finally managed to get my program working. First time working with WPF, so I made a big mess. Now it's ...
Taelia's user avatar
  • 213
11 votes
1 answer
6k views

Simple Tic-Tac-Toe Application in WPF

I made a Tic-Tac-Toe game in WPF and was just hoping for some input as I am pretty new to WPF and I am still a student so I'm sure that my C# code in general may be lacking XAML: ...
TrillKouda's user avatar
10 votes
4 answers
1k views

Resx Editor in WPF

To aid in the localization of .resx files, I made a generic resx comparer that allows you to edit the values of the resx's. Also, this is my first proper adventure in WPF (I've just been using ...
user avatar
10 votes
3 answers
57k views

Best way of updating a list of unique items

I am wondering what the best practice for updating a list that only accepts unique items. Right now, I have a button that loads data from a database into a list. I can press this button numerous times ...
St0ffer's user avatar
  • 135
10 votes
2 answers
265 views

Settings, setting settings, and settings handlers

So, back in this question, I built a set of settings. Now, I am trying to clean the entire system up. This is the abstract base class: ...
user avatar
10 votes
3 answers
11k views

Pong game in WPF

I would especially like to find out how this project should be constructed to be "fully MVVM". I did some reading about MVVM and I started to implement some ideas, but I don't fully understand it yet....
user34325's user avatar
  • 101
10 votes
5 answers
1k views

Setting user permissions, where certain permissions imply other permissions

The purpose of the class is to set permissions for a user. These include delete, download, upload, view, etc. These properties often depend on other properties, and setting them has side effects. For ...
FUR10N's user avatar
  • 203
10 votes
1 answer
237 views

Visual Studio exception visualizer for lengthy exception messages

I use Autofac a lot and for everything and when you make a mistake and forget to register a dependency etc. it'll tell you exaclty what's wrong. Although its ...
t3chb0t's user avatar
  • 44.3k
10 votes
1 answer
289 views

Code Explorer 2.0: A folder hierarchy to organize VBA projects

Next release of Rubberduck will introduce a very cool @Folder annotation system that the Code Explorer will use to organize modules into - you guessed it - folders: ...
Mathieu Guindon's user avatar
10 votes
1 answer
34k views

Navigation between pages in WPF MVVM application

I did a project in WPF MVVM. Just a single Window with single Frame control and few Pages. My problem was communication between ...
tobiasznowak's user avatar
10 votes
1 answer
239 views

TicTactics Presentation

This is my take at the current code-challenge, Ultimate Tic-Tac-Toe, at least the presentation part. As I chose to write a WPF application for my game, and this is my very first time fiddling with a <...
Mathieu Guindon's user avatar
9 votes
4 answers
5k views

C# WPF Simple Calculator

I've implemented simple +-*/ calculator in WPF. I know that here are few implementations of the same thing, but each is different, with different advantages or ...
Majak's user avatar
  • 309
9 votes
3 answers
6k views

AsyncCommand using MVVM and WPF

Goals I want to be able to call async code using the MVVM pattern I want to be able to add loading animations/screens without having to add properties for each command on my viewmodels I may want to ...
Bruno Klein's user avatar
9 votes
2 answers
1k views

Am I handling "spot the missing DLL" right?

I have a .net 4.5 desktop script which has dependencies on some third party libraries (dll's). These libraries are used in my MainWindowViewModel. I need to check ...
Mehrad's user avatar
  • 812
9 votes
2 answers
4k views

Animating the color of a line in WPF

I'm thinking about how to do a color transition for a line in WPF. I'm looking for this to be as simple and succinct as possible, and also the "correct" way in the WPF world. This is what I have, ...
Factor Mystic's user avatar
9 votes
1 answer
2k views

Creating interactive tours for WPF applications

I am developing a WPF component that can be used to create interactive tours for WPF applications. To further improve the API in terms of usability and intuitiveness, the input of other developers is ...
JanDotNet's user avatar
  • 8,538
8 votes
2 answers
5k views

Add or view pattern with MVVM

I have a model called WorkOrder which I want to be able to manage from a single window. The required operations (for now) are only Insert and view, so this is what ...
Yoav's user avatar
  • 319
8 votes
3 answers
2k views

Simple pack Uri builder

I want to make the creation of the pack Uri for WPF resources more verbose so they are easier to read and less error-prone and I thought I implement it using the builder pattern. The base class for ...
t3chb0t's user avatar
  • 44.3k
8 votes
2 answers
215 views

Non-Entity framework database interaction model

A C# WPF user interface has been developed for the Book Inventory MySQL database previously shown in this question. Since the database had already been developed this was a database first ...
pacmaninbw's user avatar
  • 23.8k
8 votes
2 answers
15k views

Wiring CollectionView and updating itself without the need for Refresh()

I have been using your expertise developing my application using parts of WPF that I have never touched before. In this stage my View does all I need it to do, however, I am not sure if I've done my ...
Mehrad's user avatar
  • 812
8 votes
3 answers
756 views

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

I have a component that I've used myself for quite some time, the short story is that it automagically implements a property change notification mechanism (very useful for implementing ...
Mik3c's user avatar
  • 101
8 votes
1 answer
16k views

MVVM - ObservableCollection & Entity Framework DbContext

I'm trying to catch WPF using MVVM pattern, where my set of models is implementing ObservableCollection as well as Entity Framework's ...
Majak's user avatar
  • 309
8 votes
2 answers
7k views

Concurrent observable collection

I'm working on a WPF 4.5 desktop application that has several nested collections with the following key aspects: writes mainly from UI thread, but also from worker threads writes are relatively ...
mike's user avatar
  • 181
8 votes
2 answers
1k views

Easly cancellable operations WPF

Several times we need to be able to revert the data the user is inserting to a previous state (cancel data update). In order to keep DRY and for the sake of separation of concerns I thought about a ...
Bruno Costa's user avatar
  • 5,566
8 votes
1 answer
360 views

WPF BindableProperty<TValue> to Reduce Boiler Plate

I'm sure anyone who has used WPF is familiar with the irritating boilerplate code surrounding properties, usually of this form. ...
HarrisW's user avatar
  • 83
7 votes
2 answers
19k views

Task timer async

I had been still using BackGroundWorker and decided to learn async Task. My test project is a simple timer that can be canceled. The target project is to read instruments with a delay for sampling. ...
paparazzo's user avatar
  • 5,976
7 votes
5 answers
4k views

Another DataGrid (ObservableCollection) Filtering Method

I have re-written my DataGrid filtering method to try to improve performance and I feel that although this is the fastest yet, there is still room for improvement ...
CBR's user avatar
  • 299
7 votes
2 answers
3k views

Noughts and Crosses WPF app

I've been learning C# and was looking for some feedback on my latest project, which is a standard Noughts and Crosses game. Two people are required to play (no AI yet). MainWindow.xaml.cs ...
Everless Drop 41's user avatar
7 votes
3 answers
1k views

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

Right now i have a WPF application supposed to display some media into a WPF Window, from actions in another WPF Window ( for example : you write text in a textbox, you click on a button, and the text ...
Cédric MEYER's user avatar
7 votes
1 answer
346 views

Loading BitmapImages out of a Zip file

I'm working on a personal project to get better with C#, and as part of that I have a zip file with 20 or so images saved inside. I want to load those images out of the zip file and display them in my ...
Lightning759's user avatar
7 votes
1 answer
1k views

View Model Base

I needed to write code in WPF for a client. The application is done with prism (not my decision, they already had people working on it), so I got a sparkling clean new module to work in. Since this ...
DerMeister's user avatar

1
2 3 4 5
7