Windows Presentation Foundation (WPF) is part of the Microsoft .NET framework used to create rich client user experiences for Windows application.
0
votes
0answers
7 views
WPF textblock needs to fill entire stackpanel contents [on hold]
How can I have that the textblock fills the entire stack panel space minus the radio button's width?
The radio button must pad right and the textblock must stretch the remaining area.
<Window ...
8
votes
1answer
375 views
Is there a better way to get a child?
I have the following Code to get ImageColorPicker child:
foreach (CustomTabItem customTabItem in SelectedWindowsTabControl.Items)
{
TabItem ti = ...
4
votes
1answer
38 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
41 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' ...
9
votes
1answer
61 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 ...
3
votes
3answers
87 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 ...
0
votes
1answer
12 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
...
9
votes
1answer
77 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 ...
2
votes
1answer
71 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
304 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
914 views
Sort ObservableCollection after added new item
For a WPF application, I have to sort the items in ObservableCollection after Added new item.
public void UpdateSource(ObservableCollection<SomeType> source, SomeType newItem)
{
...
3
votes
1answer
152 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
208 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
...
2
votes
2answers
632 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
383 views
WPF Load boolean values in combobox
I have a Combobox and I want to edit a boolean value.
<dxe:ComboBoxEdit ItemsSource="{Binding EnumItemsSource}"
DisplayMember="Name"
...
2
votes
1answer
236 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
344 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 code-behind which I'm not too crazy ...
4
votes
2answers
671 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:
<DataGrid Name="grid1"
AutoGenerateColumns="False">
<DataGrid.Columns>
...
2
votes
1answer
68 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
406 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 my textbox to only accept text ...
1
vote
1answer
996 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 ...
2
votes
1answer
1k 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
254 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). In addition, it has a property for ...
5
votes
1answer
3k views
WPF Single Instance Best Practices
This is the code I implemented so far to create a single instance WPF application:
#region Using Directives
using System;
using System.Globalization;
using System.Reflection;
using System.Threading;
...
1
vote
1answer
2k 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 DataGridTemplateColumn to override the Images.
My Main Form ...
10
votes
1answer
344 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
438 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.
public static class ...
2
votes
1answer
419 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 ...
6
votes
2answers
1k 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 ...
2
votes
2answers
357 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 If statements. Is there a cleaner way to ...
3
votes
1answer
219 views
Putting items next to each other
So I want to put some text next to it's lable.
(both of which are text blocks - which are faster than lables as I understand it)
The best way i've found for doing this is a strack panel.
So I have, ...
2
votes
1answer
1k views
Image Proccessing Optmization?
I'm using Winforms C# .net 3.5.
I'm getting frames and this is hiwo i handle them:
delegate void videoStream_NewFrameDelegate(object sender, NewFrameEventArgs eventArgs);
public void ...
2
votes
1answer
2k views
Helper methods for working with the WPF Dispatcher
I've written the following small helper class for use in my WPF applications. It comes up from time to time that I need to display message boxes, or otherwise interact with the UI from a non UI ...
2
votes
1answer
260 views
How can I improve this code about categories and subcategories?
This is the code that I'm using. I'm working on LINQ TO SQL and I'm using this model in my program:
How can I model this class in a database
The person must have to enter the level, for example 1.2, ...
1
vote
1answer
281 views
Can someone help me to improve this code?
Here is the project which currently I'm working.
http://www.megaupload.com/?d=NGJWS9C3
Sorry guys if the code is a mess. I'm a beginner, I'm still learning from you, and for that reason, I need a ...
-1
votes
2answers
230 views
Can I improve this code using delegates?
I guess I might use delegates. But I'm not certain if I can apply for it.
Sorry if the code is a mess. I'm a beginner and am still learning. For that reason, I need a little of help to improve ...
4
votes
1answer
599 views
Trying to un-hack this DataTemplateSelector
I'm trying to emulate the default behavior of an ItemsControl in a ContentControl--Bind Content to an object property and use the correct DataTemplate based on that object's type.
I've tried to ...
5
votes
1answer
604 views
Request of Code Review of my first WPF MVVM attempt
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 ...
5
votes
2answers
1k views
WPF MVVM confusion
I have been trying to wrap my head around mvvm for the last week or more and still struggling a bit. I have watched Jason Dolingers MVVM video and gone through Reed Copsey lessons and still find ...
2
votes
1answer
434 views
Custom UIElement Animations
Having fancy animations in WPF is quite nice so i tried to implement a generic fading animation for UIElements which i use for the Popups in my application. I was wondering if there was anything wrong ...
5
votes
1answer
268 views
Refactor code for usability
I need help to refactor my code. I usually had a hard time figuring out how to make my code reusable.
I have an XML file that hold the data for each Tag element. Tag element should have child nodes ...
13
votes
5answers
8k 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 ...
7
votes
2answers
2k 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, ...