I am an experienced coder who is trying to learn C# and WPF. Now, I am a bit of a stickler for detail, and I want to make sure my applications blend in with the rest of the user interface. However, I cannot seem to get this done using a ListView. My setup is simple - add a ListView to my window, bind to an ObservableCollection of my choice, and run the application.
The result is that the items pop up just fine (be it without meaningful contents). However, the selection rectangle on a ListView is always the dark blue that throws me back to the pre-XP days as opposed to the neater themed selection you have using the default Windows 7 visual style. To see that kind of selection in action, just select a file in explorer, or for another example look in the Programs and Features in the Control Panel. That looks nice and slick.
How can I get WPF to properly theme my ListView depending on my user settings? I don't want to reinvent the entire selection code and add tons of styling and doodahs like that - I want a plain Windows application that looks okay. The button works fine, textboxes work fine, comboboxes look fine, etc. It's just the ListView that looks totally crap.
Edit: I have no problems using another (very, very preferably not a thirdparty) control if required, but I do want a list of items that looks native and I approach a layout similar to the Tiles option in Explorer for each selected item (icon, desc, extra line of info). Vertical scrolling only is what I need.
If you use a ListView with ListView.View set to a GridView then you get a pretty similar look as Windows 7 explorer. (Atleast in my opinion, or is this the look you're talking about?). It also follows the active theme
Example 1. ListView with GridView to the right. Selection active
Example 2. ListView with GridView to the right. Selection inactive
Example 3. Using High Contrast Theme #2
Related
I'm using Elysium for creation Metro-like GUI for Windows 7.
I want to create GUI for app with 3 columns with dynamic content with similar animation like its done in many mobile apps and some websites with Javascript ("infinite scrolling pages").
So you press refresh button and it adds few new feeds to each column with smooth animation.
I'm trying to move away from idea of using Javascript itself for rendering results but I pretty much don't see any other option.
What kind of controls should I use for that or/and how to implement such effect?
Update 1: Looks like its called Pile Board
Update 2: Currently looking into ObservableCollection and Elysium.Extras (DataGrid) combo.
Seems like there's also MahApps as alternative to Elysium with Pile control included.
I have a windows 8 application that has both list views and grid views. I see the following behavior when multi-selecting items on touch screens:
Grid View: Swipe down on touch screen for selecting items
List view: Swipe left or right for selecting items
Is this the standard behavior? I could not find any documentation on this.
This is for a Windows 8 Store App.
You didn't say whether you were writing WPF or Windows Store Apps, but as always, MSDN is the place to look for documentation either way. For WPF, you have:
ListView Class
GridView Class
And for Windows Store Apps, you have:
ListView Class
GridView Class
If you can't find the information that you need there, then I imagine the next best thing would be to create a simple application without setting any extra properties on your controls and then just try swiping them and then that will be the default behaviour.
What is the terminology for the extended automatic loading of a ListBox in windows phone 8 xaml.
So when you are scrolling and you get to near the bottom of the list, it automatically calls a function or Command or whatever that adds more data to the bottom of the list so you can continue to scroll.
I can't think of what to search for :S
I am using an MVVM style of architecture and have used button Command Bindings for everything, so I guess if there is a Viewmodel way of doing the automatic updating, that'd be swell!
This is virtualizing :)
Read about it at the following page, please
How to place search button in DataGridView cell in Windows Application like font selecting in control property window in Visual Studio 2010
This may not be a direct answer to your question but you might want to look at Object List View
http://objectlistview.sourceforge.net/cs/index.html
It actually wraps a ListView but has a lot of capabilities including reading data from a database as I recall. This provides for in-cell editors. For standard things like colors it has a built in cell editor. If that does not work then you can roll your own.
I am new to WPF and am trying to find the right control.
I am coding a WPF app that has two sections. The left side is an Outlook like sidebar (Odyssey controls).
For everything else I want a control that I can easily swap the contents of based on what is in the side bar.
So the user selects an option in the side bar and all the controls in the main section would change.
If I was writing this in Windows Forms I could just create a few Panels and then show the one that is relevant (and hide the others). When I try this in WPF you can see the contents of the panel underneath. I know I could make them not visible, but I am getting the feeling that I may be going about this the wrong way.
So here is the question. What is the best way (in WPF) to handle content sections of the app to change.
Based on your example (switching what is shown based on what is selected in a side panel) I'd recommend restyling a TabControl because that's really tab switching even if it doesn't look like it. Check out this for a decent example, set TabStripPlacement to Left and you will have a good start.
Depending on how your data is set up a Master-Detail pattern might be another good choice.
If you want to switch everything programmatically you'll want to use a ContentPresenter and DataTemplates for the UI "panels". This article by Josh Smith is about MVVM but his example application is basically the pattern you'll be looking for.