Tim Hibbard

CEO for EnGraph software
posts - 626, comments - 1586, trackbacks - 459

My Links

News



Add to Google

Twitter












Tag Cloud

Article Categories

Archives

Post Categories

Image Galleries

EnGraph Blogs

Links

Other

Roll

WPF

There are 22 entries for the tag WPF
WPF TimeSpinner Control
As I discussed in my last post, we created a TimeSpinner control based on the Extended WPF Toolkit’s ButtonSpinner. Now, the toolkit has a DateTimeUpDown control that will display a date or time and allow the user to click the spinners for each time part, but I needed a little more. I needed the raw text to be editable and I wanted the spinners to just modify the minutes portion. I also wanted to have special parsing based on the number of characters entered. 4 chars:Parse as military time. 3 chars:...

Posted On Thursday, April 14, 2011 10:16 AM | Feedback (3) |

Smarter DateTime.AddMinutes
Our software will automatically generate pick up and drop off times based on distance of trip, how many other people are on the bus, how long it takes to drop them off, etc. We display these times in our custom TimeSpinner control based on WPF Extended Toolkit’s button spinner. Since the computer is generating the time, they are often not human-friendly. 6:00 AM is a lot easier to remember than 6:03 AM. So we give the users the option to modify these times. Using the spinners, they can adjust the...

Posted On Tuesday, April 12, 2011 8:26 AM | Feedback (1) |

WPF–Show Dialog with backdrop
Sometimes it handy to force the user’s attention to a specific screen. We can do this with a dialog, but sometimes the user doesn’t know that window is on top. To draw the user’s eye to the window, I like to place a backdrop between the rest of the application and the dialog window. I use the following code to make that happen. 1: public bool? ShowDialogWithBackdrop(Window win) 2: { 3: //create backgroup 4: Window backgroundWindow = new Window(); 5: backgroundWindow.Top = 0; 6: backgroundWindow.Left...

Posted On Friday, April 08, 2011 9:17 AM | Feedback (1) |

EnGraph is hiring – ASP.NET, Kansas City
EnGraph is looking for an ASP.NET developer to join our team. We are a small company in Lenexa, KS that creates .NET applications for Paratransit agencies. A good candidate would be very comfortable with ASP.NET, Forms Authentication and JavaScript. A huge bonus would be knowledge of IIS, Google Maps API, AJAXPro, ActiveReports, WPF and SQL. We are accepting resumes immediately and look to hire as soon as January 18th. We would consider contract or full-time and we would require office attendance....

Posted On Wednesday, December 30, 2009 1:07 PM | Feedback (1) |

The last couple months of our life via twitter
Pre-approval letter in hand, let the house shopping begin!10:10 AM Apr 28th Apparently it's impossible to look at a house without the realtor begging to be your buyer's agent. Back off people!1:36 PM Apr 30th Finally going live with software that I've been working on for 2+ years!3:59 PM Apr 30th First install and we run into a proxy brick wall...smooth4:43 PM Apr 30th Done with an exhausting day of house hunting. Found a lot that we liked. One that we LOVED, in shawnee of all places.6:40 PM May...

Posted On Friday, July 17, 2009 10:51 AM | Feedback (3) |

Simple class to parse Twitter with LINQ
In ParaPlan 4.0, we use twitter to maintain a change log. I wanted to display this information to our users, so I wrote a little class that calls the RSS feed and uses LINQ to parse the data. All I need is the message and the date, so that is all it pulls out. Here is the class: public class Twitter { public string Message { get; set; } public DateTime PubDate { get; set; } public static List<Twitter> Parse(string User) { var rv = new List<Twitter>(); var url = "http://twitter.com/statuse...

Posted On Monday, January 05, 2009 2:53 PM | Feedback (8) |

WPF – Hide a listbox when it doesn’t have any items
This code example will show how to hide a listbox from the user when it doesn’t have any items. It involves binding the Visibility of the listbox to the Items.Count of the listbox. We run the Items.Count through a converter that will return a Visibility.Visible object if the Item.Count is not zero. Here is the converter class: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Data; using System.Windows; namespace HideAListBox { public class...

Posted On Tuesday, December 09, 2008 3:48 PM | Feedback (24) |

WPF - Using SystemColors to add color to ListBox
Using colors is a simple way make your application less boring. You can change the color of the selected and unselected item in a ListBox by using code like this: <Style TargetType="ListBoxItem"> <Style.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrush... Color="LightGreen"/> <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="LightBlue"/> </Style.Resources> </Style> This style can be put in the resources of the ListBox...

Posted On Tuesday, November 11, 2008 4:41 PM | Feedback (1) |

WPF - Changing the content of a ToggleButton when checked
I don't think the WPF ToogleButton has a distinct visual difference between it's checked and unchecked state. So I wanted to change the text displayed when the button was checked. So I created a trigger that looked at the IsChecked property and changed the content property accordingly. However, the default template of a ToggleButton changes it's appearance when it is checked, so certain properties are not written as expected. To fix this, I set the content property in the styles of the toggle button...

Posted On Tuesday, May 13, 2008 11:54 AM | Feedback (6) |

Uninstalled VS2005 from TeamBuild machine
All of our projects that use TeamBuild are now being built with Visual Studio 2008, so to free up some much needed space on our server, I uninstalled Visual Studio 2005. Now all our builds are failing with the message: error MSB3147: Could not find required file 'setup.bin' in 'e:\b\Goldstar\gs_main\Sour... I found a thread on MSDN that suggested reinstalling the .NET SDK, so I'm trying that. Update: I had also uninstalled VS 2008 Team Suite trial, when...

Posted On Wednesday, May 07, 2008 4:28 PM | Feedback (1) |

WPF Custom Control Dependency Property Gotcha
Let's say you have a custom WPF control called SearchTextBox. It has a textbox and a button labeled "search". Simple enough, you reuse it in your application when you want to provide search. Then one day, you decide you need this control needs to be bindable. So you expose a public property Text and map it to textSearch just like you would in WinForms. Well, that doesn't work, so you google around and stumble upon Dependency Properties and learn how to create your own (VS snippet shortcut propdb)...

Posted On Tuesday, April 22, 2008 1:11 AM | Feedback (27) |

WPF - Get ListBoxItem from ListBox.SelectedItem
I had some trouble today getting the actual control that hosts data in a WPF listbox. The magic class is ListBox.ItemContainerGenerator used like this:MyStateObject current = this.myListBox.SelectedItem as MyStateObject; ListBoxItem lbi = this.myListBox.ItemContaine... as ListBoxItem; lbi.Margin = new Thickness(10); Technorati tags: WPF, C#, ListBox, ItemContainerGenerator...

Posted On Wednesday, February 13, 2008 2:01 PM | Feedback (4) |

WPF - Show/Hide element based on CheckBox.Checked
A lot of times, I need to show or hide a textbox based the value of a checkbox. In WinForms 2.0. This was easy: myTextBox.Visible = myCheckBox.Checked; With the new Visibility Enum in WPF, this becomes a bit trickier. To accomplish this, you need to implement a converter that will accept a boolean value and return a visibility value. The converter I used is here: using System; using System.Collections.Generic; using System.Text; using System.Windows.Data; using System.Windows; namespace ParaPlan.Converters...

Posted On Monday, December 10, 2007 11:24 AM | Feedback (6) |

WPF - TextBox.SelectAll
I think that any business application should select all the text in a TextBox when the user tabs into it. Your advanced users that take advantage of the tab key will appreciate it. In WinForms 2.0, the best way of accomplishing this was to create a new control that inherited from TextBox that implemented SelectAll functionality and use your new control instead of the normal TextBox. In WPF, this is much easier. In the App.xaml.cs, override the OnStartup method and use the EventManager.RegisterClassH...

Posted On Tuesday, September 18, 2007 8:29 AM | Feedback (7) |

WPF Access Keys
In WPF, access keys are created like this:_Click Me! Pre-WPF was:&Click Me! Access keys in buttons work differently based on the type of control your text is rendered in. This code will only bring the keyboard focus to the button, it will not generate a click event: <Button Click="clickMeClick">_Click Me!</Button> When the user presses Alt - C on their keyboard, they expect the button to act as if it has been clicked, not just selected. To set keyboard focus and generate a click event,...

Posted On Tuesday, August 28, 2007 10:15 AM | Feedback (1) |

Becoming a better developer
Dru was kind enough to tag me on how I could be a better developer. I think that in addition to being a better developer, I also need to deliver better applications. We all have different reasons for our geeky ways, and mine is to create applications that save people time. So here is my list: Start giving more talks - I really enjoy giving my talks on Ajax.net and Real time GPS implications, but I'm not an expert on AJAX and most people find my opinions on GPS to be a bit "abrasive". I need to isolate...

Posted On Friday, July 20, 2007 3:09 PM | Feedback (2) |

Real world desktop WPF applications - UI Validation
Intro to this series of posts. Some of the code I use for UI validation came from Paul Stovell, who is working on a WPF Element that acts like WinForms 2.0 ErrorProvider control. Paul's control didn't quite fit my needs, so I've tweaked a few things so I can provide visual validation in a generic fashion from my base class. All of our objects implement:Public Event InvalidProperty(string PropertyName, string ErrorMessage);Public Event Validated(object sender);Public bool IsValid; Our objects also...

Posted On Thursday, July 19, 2007 11:39 AM | Feedback (1) |

Real world desktop WPF applications - UI Validation
Intro to this series of posts. Some of the code I use for UI validation came from Paul Stovell, who is working on a WPF Element that acts like WinForms 2.0 ErrorProvider control. Paul's control didn't quite fit my needs, so I've tweaked a few things so I can provide visual validation in a generic fashion from my base class. All of our objects implement:Public Event InvalidProperty(string PropertyName, string ErrorMessage);Public Event Validated(object sender);Public bool IsValid; Our objects also...

Posted On Thursday, July 19, 2007 11:36 AM | Feedback (1) |

Real world desktop WPF applications - Data binding
Intro to this series of posts. There are a ton of posts out there about data binding with INotifyPropertyChanged objects in WPF, so I won't regurgitate what other people have already written. There is one point that I haven't see much clear documentation about that I would like to cover. Hosting data bound custom controls. Let's say we have a location control that is bound to a location object like so: <TextBox Text="{Binding Path=Address1}"/> <TextBox Text="{Binding Path=Address2}"/>...

Posted On Monday, July 16, 2007 12:03 PM | Feedback (2) |

Real world desktop WPF applications
The last month or so, I've been wallowing in Windows Presentation Foundation (WPF), trying to determine if it is the correct direction for our next version of our flagship software, ParaPlan. WPF is flashy and fun and bubbly, but there are not many examples of real world enterprise applications that are built around WPF. After much research, and significantly pushing back our deployment timeline, we decided to rebuild ParaPlan 4.0 using WPF for our UI. We were able to use our existing 2.0 UI framework...

Posted On Sunday, July 15, 2007 10:52 PM | Feedback (4) |

Kansas University GIS Day 2006 Wrapup
Matt Dunbar & Co. did a fantastic job putting together GIS day at Kansas University. My favorite part of the day was judging the student competition. Seven students gave ten minute presentations on unique uses of GIS. They showed everything from a geographic boundary of where grits are consumed (apparently South Carolina is the capital of all that is grits) to a traffic analysis of SW Douglas Country in Kansas. The winner was Lincoln Lewis. He showed how to make GIS data pretty using a suite...

Posted On Thursday, November 16, 2006 12:24 PM | Feedback (2) |

HDC 2006 wrapup
Heartland Developers Conference 2006 in Omaha was a huge success! Joe Olson, Phil Wolfe and everybody else involved did a great job getting everything put together. Day 1: Joe Stagner did the opening keynote on Federated Logic. Basically using data sources that live anywhere on the internet with ASMX web services. He even talked a little bit about GPS and web based mapping solutions. Something that is near and dear to my heart. Next, I went to Dave Donaldson's talk on Power Programming with Attributes....

Posted On Wednesday, November 01, 2006 2:30 PM | Feedback (2) |

Powered by: