September 30, 2012 - I updated the code to now support setting a MouseOverColor.

This will not work well if you set RowPadding since this sets the Padding on the Border whereas the MouseOverColor is set on either the inner StackPanel or Grid; consequently, I added two new methods to set margin or padding on image or textblock:

.SetImageMargin(0, 0, new Thickness(0, 10, 0, 10))
.SetTextBlockPadding(0, 1, new Thickness(0, 10, 0, 10))

These appear to work well in conjunction with the MouseOverColor.

NOTE: You likely may want to set the SelectedContentControlColor to match the MouseOverColor so that the color "sticks" when you single-click on an item:

.SetSelectedContentControlColor(Colors.BlanchedAlmond);

October 2nd, 2012 - Added support for Tooltip. When you add text, there is now an overload to tie the inline run of the Textblock to a tooltip for that row.

October 3rd, 2012 - Added support for setting MaxHeight, MaxWidth, Visibility, UseLayoutRounding, and Horizontal Text Alignment. Also, added support for alternating row colors.

alternating_row_colors.png

October 6th, 2012 - Added improved performance via "paging", swapping in rows on the fly and wiring up the vertical scrollbar to work in tune with this. Also, updated the RemoveByKey code to honor this new paging approach. Adding new row elements on-the-fly post-load appears to work as well. Finally, I added a RemoveAll method (and a Dispose). For sorting, you'd likely want to remove all, sort, and then re-add.

October 7th, 2012 - I ripped out the "paging" code from the night before. Instead, I was able to simply leverage ObservableCollection with a new Bind() method (to add it to ItemSource). This corrected the performance issues. 1500 rows are now adding in 10 seconds on my slow home PC. I believe this is reasonable in WPF terms.
One good thing that came out of yesterday's code is support for adding a step for the page buttons and thumb delta:
.SetVerticalPageDownStep(25)
.SetVerticalPageUpStep(25)
.SetVerticalThumbStep(10)
These are set to default to 1, but you may adjust to suit the anticipated size of your data set.

Also, added support for the PageDown and PageUp Repeat Button behavior with Delay and Interval:
.SetVerticalPageDownDelay(30)
.SetVerticalPageDownInterval(3)
.SetVerticalPageUpDelay(30)
.SetVerticalPageUpInterval(3)

October 8th, 2012 - I provided defaults for text font and text color (so you don't have to define these for things to work.) Also, I added support for UseHorizontalListBox and UseWrapPanel():

wrappanel.png

October 10th, 2012 - Added default item border brush and thickness. Got rid of the Bind() call. I just cause it to be repeated internally behind the scenes every time AddRowElements is called. I also added an overload for SetGridProperties that let's you repeat a width and UnitType automatically based on number of columns. (This is useful for quick prototyping.)

October 16th, 2012 - Added support for setting Font or Text Color for an entire column or row within the grid in a single listbox item. This is in contrast to only be able to set these per cell. Also, changed the Project to target .NET 4.0 instead of .NET 4.5 (to support a broader audience.)

October 17th, 2012 - Added support for Step, Delay, and Interval on the ScrollDown and ScrollUp buttons (not just page down and page up). Also, streamlined the setting of colors on the page down and page up. Finally, added support to the scrollbar thumbs for border color, pressed color (it's actually Thumb.IsDragging so it is really draggedcolor), and mouseovercolor. I will need to add the Step, Delay, and Interval to the Horizontal Scrollbar buttons . . . soon.

October 18th, 2012 - Added support for Subscribing to doubleclick with a filter by the text in the listboxitem. So if you addText with category Scissors and category Tape, then you could filter to only subscribe to Tape and not Scissors. Also, if you update Scissors on one listboxitem to Tape via UpdateByKey, I now let you add the subscription after such an update. UpdateByKey now returns a TextBlock and you can call a new overload on SubscribeMouseDoubleClick to let you subscribe to that listboxitem on-the-fly, (yet still honoring the filter by text you applied earlier.)

October 19th, 2012 - Brought parity to the horizontal scrollbar to match the functionality of the vertical scrollbar. The scrollbars are much improved now.

October 20th, 2012 - Added sorting and filtering. The filtering is a hard-filtering where it actually completely removes items that don't match the predicate (so you'd have to remove all and re-add row elements from scratch if you want to re-set the list after filtering!) I also fixed a bug with the scroll button step on the scrollbars. I also added the ability to update all textblocks at a certain row-column position for all listboxitems OR for just a range based on a starting index and count, like so:

myListBox.UpdateTextBlocks<string>(1, 0, 3, 5, txtbLock => { txtbLock.Visibility = Visibility.Hidden; });

October 21st, 2012 - Added support for sorting by first one textblock in this listboxitem and then by a second textblock (each flexible to be ASC or DESC). Same with filtering, added ability to filter by more than one textblock. Added a few more settings for Image (e.g. Stretch) as well as an overload for AddImage that allows setting a columnspan and rowspan.

November 7th, 2012 - Started work on Grid Extensions. Split the solution into two projects with a FasterWPF.dll to hold the extensions code and the other project merely to house the Demo WPF app.

November 10th, 2012 - Did a bunch of cleanup and re-factoring. Continued the effort of abstracting away portions of the ListBox Extensions to Common Extensions. There is still a lot of work left to complete this abstraction process to get to a clean set of re-usable methods.

November 13th, 2012 - Started first draft of abstracting away ScrollViewer extensions to a new IScrollViewerStrategy interface. Re-organized a few things in the FasterWPF project.

November 15th, 2012 - Experimented with a new AddAnything<K,T> method to allow adding any type of child to any type of parent container (assuming of course that the parent container implements the necessary IStrategy interface.)

container.AddAnything<CheckBox, Grid>(gridguid1, 0, 0)

This can be used in conjunction with new static classes for each child type to hold string setting keys (basically the writeable properties of the control) that may easily be reflected over, for example:

public static class ButtonSetting
{
public static string ActualHeight="ButtonActualHeight";
public static string ActualWidth="ButtonActualWidth";
public static string AllowDrop="ButtonAllowDrop";
. . . etc.

Furthermore, this approach may leverage a new method that is like a "StoreAnySetting" passing in the string setting key from above almost like an enum:

.StoreSetting<Grid>(FasterWPF.SettingsManager.ButtonSetting.Content, "Hello World")

The idea is to allow easily adding support for any type of child control and parent container. The only downside to this approach is that I had been highly customizing a few of these settings and their application to smooth out a few of the WPF rough patches . . . this library isn't just about laying out controls via x-y coordinates but also about being able to easily style child controls in an intuitive way.

However, I believe I may still add such smoothing out methods in more explicit (but optional) Add methods, such as in an AddButton method. But this AddAnything method may allow me to make traction now in the short-term, then I can back-fill with more fine-grained methods such as AddButton later?

November 17th, 2012 - Cleaned up the demo app quite a bit. Also, added new methods: AddExisting<K,T> and Set<K,T>(string propertyOnK, object value). This use of generics begins to open up support for nearly all the major WPF controls. I just need to add more parent containers implementing IStrategy and finish filling out this interface. Of course, I also need to add more Exception handling and null checking. It wouldn't hurt to write up documentation. It wouldn't hurt to add more 'canned' styles and scenarios? Looking forward to the next few check-ins though . . .

November 17th, 2012 - started adding support for DockPanel, allowing you to add composite children to DockPanel via code-behind instead of via DataTemplates. Remember: you can still always add regular children, like a button. This anti-databinding anti-datatemplate library focuses on composites but you can still add individual controls as you normally would.

November 18th, 2012 (AM) -Finished abstracting event subscription to Common Extensions even though event subscription hasn't been made completely generic at this point. Currently just adding support for a subset of events (SingleClick, DoubleClick, SelectionChanged) that can be subcribed to/opted into.

Added support for DockPanel.

Added support for RemoveByKey (added Remove to IStrategy interface.)

Added support to settings for SetAttachedProperty and Set(row,col).

Added ability to set width and height of Grid and Border, and added support for setting Row Height(s).

Added separate SubscribeSingleClick vs. SubscribeSelectionChanged.

November 18th, 2012 (PM) -Updated the Home page on the codeplex project and improved the demo in the code to match the new screenshots (created new release). The flexibility in working with the anti-databinding approach feels good so far. There are still WPF gotchas that I inevitably continue to run into, but this code library feels like a step in the right direction for me. I anticipate that having everything in code-behind may allow for easier code re-use and abstraction than copy-pasting XAML.

November 22nd 2012 -Started working on AddAnyEventToParent, AddAnyEventByKey AddAnyEventAtXY, and AddAnyEventByKeyAtXY. It's interesting that I ended up NOT using Rx for these AddAnyEvent methods. Instead, I just use reflection but I do still adhere to leveraging an IDisposable for unsubscribing, remaining in line with Rx. Also, began adding support for TreeView parent container.

November 23rd 2012 -Added support for AddAnyEventOnBorder, AddAnyEventOnContainer, AddAnyEvent at key - x - y coordinate. Also, added mirror-image unsubscribe methods.

Last edited Dec 30, 2012 at 3:46 AM by stagathome0069, version 2

Comments

No comments yet.