Creating custom ListView from scratch in Blend - c#

I already looked through the internet but could not find a tutorial that showed the creation of a ListView in Expression Blend. I do not want to modify existing ListViews that are part of Blend, as I have done that already.
I need a tutorial that shows the first steps of creating a custom ListView and, in my case, specifically states all the parts the ListView consists of.
A button for example, can be created in Blend by drawing a Rectangle, adding a ContentPresenter and converting that into a Button user control. I would like to do the same thing for a ListView.
I went through that post already but since it is about WinForms I could not draw any helpful conclusions.
I am thankful for links to similar posts, tutorials and even code snippets.

After a long night of further research I came across this answer. I installed the Windows SDK and there are files that contain the ControlTemplates for WPF Controls. Using them as a blueprint gives me the possibility of creating my own desired version of the ListView.

Related

UWP Multiple MenuItem Views in NavigationView

Is there a way in a NavigationView in UWP to have multiple "Views" for NavigationViewMenuItems? The concept would be to have Categories or Folders as MenuItems, and when clicked or the NavigationViewMenuItems would slide out to the left and show the contents of the folder or category. Then when navigating back out of the folder, the folder and categories list would slide in from the left again. I know I can change the NavigationView.MenuItemsSource in C#, but I'd like to instead have this done primarily in XAML. I've tried numerous ways to do this, but can't seem to find a way that works.
I don't really have any code to demonstrate this, as this is a whole concept issue rather than a single bug that isn't working. I have searched everywhere, and have found numerous articles/links about loading different views into NavigationView.Content, but nothing of changing the MenuItems portion.
Does anyone have any ideas on how to achieve this, or a link to a tutorial I could follow? I can't imagine that this has never been done before, this seems like such a common-sense UI interface.
What you need actually is a Tree Navigator. The UWP has no such a built-in control for us. You could use the third-party control like Syncfusion TreeNavigator.
See the code sample on GitHub: https://github.com/syncfusion/uwp-demos/tree/master/Navigation

How to create user accessible controls(Like labels, Buttons..) dynamically Using Windows Application (C#)

1.Need to create Dynamically controls like Labels, Buttons.
2.After created dynamically control(label,button),that I can able to select that control and moving to other location on that form.
This is a large question and it's impossible to give you a short answer.
There is a quite good sample for a starting point available at codeproject and csharpcorner. Version #2 of this sample is also available.
There is also WPF designer available at github.

Visual objects that change size in c# displayed in a linear list

Please forgive any silly words I may say. I am coming from a Actionscript3 background.
I am using "Visual C# 2010 Express".
I have a simple Form, in a WindowsForm Project, which currently holds just a Listbox. (Which I presume I will have to change to something else).
And I made myself a different display object (User Control) that is currently a Checkbox a title. (More will be added once I get over the hurdle below)
But I can't even get as far as Displaying the UserControl as a list.
I can't seem to find anywhere on the listbox to say "User this displayobject as the visual for listbox". I see tutorials saying "ItemsPanelTemplate" but I get error saying there is no such property for a Listbox.
I even tried making the Form in Design view and it is not in the list down the side of the GUI when I dragged as Listbox on screen.
Now I know how I would do this in pure Actionscript, but I dont know how to do this in Pure C#. Tutorials are not helping, as all the Microsoft site seems to try to give me is XAML (XML). and I am looking for C# code. So I have thrown in the towel and pleading for outside help.
Thank you for any help you can give.
It sounds like you want a list of items, each with a CheckBox and some descriptive text. Try using the CheckedListBox control. MSDN link.
This question also answers the question of how to do custom image drawing for each item in a ListBox. It may be helpful.
Edit after clarification:
Try embedding the UserControl in a ListView, rather than a ListBox.
References on embedding controls in ListViews:
C# listview - embedding controls
Adding button into a Listview in WinForms
You could also use a list of Panels, with each Panel hosting a UserControl.
C# List of Panels
But the real answer, as seen in the question's comments, is that Winforms doesn't have a convenient way to do this. This is a task much better suited to WPF.
You may check out freeware component Better ListView Express from ComponentOwl. It supports simple Details view without columns, two and three-state checkboxes, images and more...
They also offers full version with even more nice features like hierarchical and multi-line items.

C# WPF accordion collapsing Images

I've decided to took up a evening time project. I decided to write a simple GUI application displaying info about units form some game.
I've poked around and decided to do it in a C# WPF application. I have a background in java and C, so programming isn't that different.
I want to add some eye candy to it by having a series of images cropped to half one under another. And when one gets a mouse click I want to show it whole. (ie accordion behaviour), if some picture is already fullsize I want to collapse it.
I was thinking about couple of solutions, but since its my first C# project I thought it best to ask for the best/easiest solution.
Check out this Customizing WPF Expander with ControlTemplate article over on codeproject.com...
I think the WPF Expander control is what you are looking for. You can use a StackPanel to create a series of them.

Suggestions for a C# custom tabcontrol?

Has anybody got any suggestions for a custom tabcontrol implemented in C# and which adheres to these criteria:
Allows the tabs to be placed along the side of the control.
Tab text must read horizontally.
Allow custom colouring.
Open source or no cost.
I prefer not to get my hands dirty with ownerdrawing if a solution already exists.
You probably don't have a need for this anymore but anyone else who stumbles upon it might find it useful.
I found this tabcontrol on CodeProject it is also very easy to Draw your own tabs with it, they even give you a example on the site.
Y(et)A(nother)TabControl
A couple more tab controls.
TabStrip Control
TabStrips: A TabControl in the Visual Studio 2005 way!
The tab control in WPF fulfills all of your requirements. You can override the template and go to town on it.

Categories