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

learn more… | top users | synonyms

2
votes
0answers
14 views

WPF ListView Pagination using MVVM Pattern

A few days ago, I was looking for simple pagination example and I decided to write my own version. It is one of my first apps using MVVM Pattern, so I am not sure I did right. I would appreciate if ...
6
votes
2answers
67 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 ...
8
votes
2answers
193 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 ...
2
votes
2answers
80 views

Custom TextBox control: AppendLine

Is there any way to improve this simple addition to the textbox control: appending a new line? ...
10
votes
7answers
2k views

How to simplify this if else statement?

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. ...
1
vote
1answer
73 views

Access View from current/corresponding ViewModel

Sometimes when developing a WPF application, I need to access a certain Window (View) from the corresponding ...
3
votes
3answers
148 views

WPF Calculator Code

I've coded a calculator in C# with WPF as the UI. I wish to know mainly about these points: Ways of optimizing Better techniques, tactics and ways of coding this All flaws on the surface as well as ...
5
votes
2answers
187 views

Good practice for client code to MVC WebApi service

I have written a very simple web service with MVC and WebApi. Now I'm working on the client code which will be a WPF application (and soon Windows 8 Store/Phone app). What I have done works, but I'm ...
2
votes
1answer
90 views

ViewStateManager for more than just Controls?

Okay - so basically I have a login form that has a couple of 'states' it needs to display (connecting, input credentials, authenticating, invalid credentials, etc...etc...) - in the past I've ...
2
votes
1answer
69 views

Cross Thread Access to Object in ViewModel

This is a fairly straight forward question. I have a C# WPF MVVM application that call a C++ DLL to do some compilation/crunching. To update the UI C# application for progress updates I am using ...
2
votes
0answers
108 views

Possible memory leak with WPF Custom Control?

I might have a potential memory leak with my custom control. Do I actually have one? ...
6
votes
2answers
229 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 ...
5
votes
1answer
157 views

Adding groups to ListView depending on the data in a list

I have written simple code which loops through a list object and create groups in ListView depending on the data in the list. I have a list object of type ...
2
votes
1answer
78 views

Rewriting WPF GridViewColumn alignment in a less verbose way

I wanted just to right align one column in WPF and I found out that the syntax is not exactly syntetic... Is there a way to make it more syntetic? Consider that this one colum, but I have 20 columns ...
4
votes
1answer
84 views

Insert Model object effectively using entity framwork

I have a WPF MVVM Application. I have a Customer Model which is generated by an entity framework (Database first approach) and one CustomerViewModel where I ...
5
votes
1answer
129 views

Justification of my current approach and possible suggestions about alternative to a Grid in a StackPanel form for an easier way of inserting new rows

In my real life example I am at a layout stage and before I actually move any further I would like to review my current approach. I am still learning about UI, XAML on WPF technology and I guess I ...
2
votes
1answer
66 views

Optimizing playlist processing

I am trying to process an audio library file which is about 350 KB. My application processes each song on the file gets its meta-data and displays it in a List Box. The problem is that it takes too ...
0
votes
1answer
53 views

Defining a DataTemplateBase

I have defined some DataTemplates are similar. The templates are like that: ...
3
votes
1answer
111 views

Keep the sequential nature while updating the UI of the progress of the HTTP request

Let's say that I have a method that makes an HTTP request that will take a long time to finish. While that's happening the UI is not updating because I'm doing it in the UI's thread. One solution is ...
4
votes
2answers
85 views

Same function, variable parameters and types with lambda

In my current project, I find myself using Dispatcher.Invoke a lot. Before each call I test if the current dispatcher is the right one. I want to write a wrapper ...
10
votes
1answer
727 views

Is there a better way to get a child?

I have the following Code to get ImageColorPicker child: ...
4
votes
1answer
264 views

Preventing keydown delay

I created a class to prevent the default delay which happens when holding down the key on Windows Forms. It seems like the class is working correctly but I don't know if I'm using the best practice. ...
5
votes
1answer
57 views

Managing Contact Collections

I have a WPF/MVVM form that contains sections for managing Recipient Contacts, CC Contacts and BCC Contacts. Each of the three sections has buttons/ICommands for 'Add', 'Clear', 'Previous' and 'Next' ...
10
votes
1answer
217 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 ...
4
votes
3answers
133 views

Better method for my property Checking, replacement of switch statement

I'm hoping this is the correct place for this, I'm struggling a little for wording as i'm not sure what you would call this. Basically, i have a system in place where my datagrid marks cells that ...
1
vote
2answers
868 views

Progress bar in a multi-thread application

I am developing a WPF application and was practising around the multi-threading. I have write the following code ...
10
votes
1answer
135 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 ...
3
votes
1answer
162 views

Optimizing a very simple wpf app - attempt on handling 2 buttons with a common event

I am quite new to event programming in C# specially in WPF. I have made a very simple core app which I am planning on extending. It's very simple as its purpose is learning curve and doing things ...
7
votes
2answers
2k views

Pong game in WPF

This is my first post here and one of my first WPF projects. The game works, but I would like to get some advice regarding what could be done better/differently. I would especially like to find out ...
6
votes
1answer
5k views

Sort ObservableCollection after added new item

For a WPF application, I have to sort the items in ObservableCollection after Added new item. ...
3
votes
1answer
233 views

Is this a good user control layout for WPF?

Below is a code snippet of how I have been laying out my WPF control XAML. I do it mainly because I get intellisense in the editor and I can change the implementation of the viewmodel and push the ...
1
vote
1answer
529 views

Facebook OAuth in WPF & C# Example

I am developing a WPF application that requires me to get an Access Token from Facebook using oAuth. After much searching online, I came to the following conclusions: OAuth must be done in a browser ...
3
votes
2answers
2k views

WPF Window with different DataTemplates

I have to do a task hard for me and maybe you can help me. I try to design a window dialog to update data from a database view. This database view contains integer, DateTime, string, Time, Boolean ...
2
votes
1answer
828 views

WPF Load boolean values in combobox

I have a Combobox and I want to edit a boolean value. ...
3
votes
2answers
860 views

Enabling discard pending changes on DbContext

This code review request is tightly coupled with this SO question, this is the solution I implemented to solve the problem being asked about there. All my ViewModels get constructor-injected with a ...
1
vote
1answer
2k views

ListView MultiSelect, MVVM and RoutedCommands

As far as I know (and I don't claim to know much about this!), direct binding to ListView.SelectedItems isn't possible in WPF. I've seen work-arounds involving ...
4
votes
2answers
2k views

Is this an effective way of populating a datagrid of comboboxes

The goal is to have a DataGrid of comboboxes, 10 rows, 3 columns. Here's the XAML to create said grid: ...
2
votes
1answer
86 views

How best to implement a POCO editor which is split over a number of TabItems?

I am currently working on a project which uses the MVVM pattern. I have a POCO which I want to present in an editor and, because the object is composed from a number of smaller, reusable POCOs, I ...
5
votes
2answers
774 views

Filtered wpf textbox

I am tring to make a texbox which filters user input to match specified type, so i can discard some of my validation logic. For example, if i specify ushort i want ...
1
vote
1answer
2k views

WPF Localisation - using resx

I have a small WPF application which I'm not exactly localizing, but not hard-coding resources either. I know WPF doesn't use .resx files for that purpose, but I exposed the resource strings as public ...
3
votes
1answer
3k views

WPF circle and line drawer solution

I've created a WPF program which can draw lines and circles on a canvas. It works well, but I don't think it's the best solution. How can I make it work better? How would you create this program? ...
5
votes
1answer
347 views

Can this reactive code be improved?

I have a view model that I'm migrating to RxUI. It exposes a collection of brokers along with a bool indicating whether there is a market (ie. at least one broker). ...
11
votes
1answer
5k views

Single-instance WPF application

This is the code I implemented so far to create a single instance WPF application: ...
1
vote
1answer
3k views

Performance of WPF datagrid when using DataGridTemplateColumn

I am using DataGrid to show storagehouse occupancy (Occupied-Show Image With a box, Not Occupied-Show Empty Image). In DataGrid I am using ...
10
votes
1answer
367 views

Does my code conform to modern conventions?

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 ...
2
votes
2answers
539 views

MVVM notification messages

I have been looking at a couple of different approaches on how I can notify the UI about messages coming from the ViewModel, and wanted to see if this seemed appropriate or if it is too coupled. (We ...
3
votes
1answer
1k views

improve code for delayed dispatcher invoke

I knocked this up quickly to allow delayed Invoke on the dispacther, along with canceling the existing invocation and replacing with a new one, this allows throttling an action. ...
2
votes
1answer
493 views

C# based IRC application (with WPF as UI)

I would like to know how I could improve my C# project. I'm not really sure whether or not I'm allowed to just post a link to the Google Code project here, so sorry if it's not allowed, I'll edit my ...
7
votes
2answers
2k 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 ...
3
votes
2answers
451 views

Continues If statements

I have a program where it takes the students name and last name and score and saves it. When checking to see if a textbox has information in it, I use ALOT of ...