Click here to Skip to main content
15,885,146 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I am busy fighting with the ListView control for a NavigationWindow type application (something similar to what the control panel does in windows).

Basically I am using DataTemplate modelling of an object and using MyNavigationWindow.Navigate(MyModel) with view loading automatically from the object's DataTemplate. While I can get to the GridView option going okay, it seems like I cannot seem to (for the life of me) get the LargeIconView type accessible from either my XAML or from within code (or any of the other view types for that matter).

Please note that I am using System.Windows.Controls.ListView and not System.Windows.Forms.ListView.

Can anyone help as to what I am missing be it assembly wise ot what-not?

Thanks in advance,
me :D
Posted
Comments
Sergey Alexandrovich Kryukov 4-Feb-14 15:51pm    
If this is what you mean, please add the tag "WPF", it will be helpful.
—SA
nortee 4-Feb-14 15:56pm    
Hi,
I am not sure sure if this is related to WPF... since I am using NavigationWindow and am using DataTemplate definitions for the models. Basically when I put/ include System.Windows.Forms to the project it breaks in some strange way. this is what my XAML looks like:
<pre>
<resourcedictionary
="" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" xmlns:acobjects="clr-namespace:MyNampespace.Models">
<datatemplate datatype="{x:Type acObjects:MainMenuModel}">
<grid verticalalignment="Stretch" horizontalalignment="Stretch">
<ListView >
<i:interaction.triggers>
<i:eventtrigger eventname="Loaded">
<ei:callmethodaction targetobject="{Binding}" methodname="menu_Loaded">


<ListView.View>
<gridview>
<gridviewcolumn header="Name">
<gridviewcolumn header="Description">

</ListView.View>
<Image/>
</ListView>



</pre>

As an offhand, I know that if it was a normal WPF app I can do this, but obviously something is different and I am not sure how to resolve this issue.
Sergey Alexandrovich Kryukov 4-Feb-14 15:59pm    
What? Not related to WPF? Then it could be Silverlight or something... You are showing XAML, so what could it be. And if you developing some UI and not sure if it is related to WPF or not, aren't you afraid of wasting your time? It's generally good to know what you are doing... :-)
—SA
nortee 4-Feb-14 16:07pm    
It's definitely not Silverlight... as mentioned this is something similar to the control panel in Windows... Yes it looks like WPF (and it probably is knowing my oversight of things), but the fact of the matter is that it should be not a case of having to build up something from the ViewBase in order to get the LargeIconView functionality... Does that make sense?

If I have to build it from the ViewBase, then I suppose that's what I'll have to do, but this is something that should not be needed and should already be built in?

Basically all I did this:
Create a WPF Application
Change MainWindow inherited class from Window to NavigationWindow

Then built the DataTemplate definitions for my model views. The minute I add System.Windows.Forms it 'breaks' (try it and you will see). The fact that both are ListView controls should mean that they should at least have these view types (or am I clutching at straws here?).

Thanks,
me
Sergey Alexandrovich Kryukov 4-Feb-14 16:13pm    
Look, what you are talking about? You created a WPF application and then "not sure sure if this is related to WPF". What is that, new method of work, Ignorance-Oriented-Programming? I need to think at this idea... :-)

By the way, thank you for accurate formulation of the question anyway; you provided full type names, which it very good.
I answered your question in full, did you noticed that? :-)

—SA

1 solution

I never tried to find such a view type, but I cannot see if it is available in WPF. Look: http://msdn.microsoft.com/en-us/library/system.windows.controls.viewbase%28v=vs.110%29.aspx[^].

It looks like there is no such thing at the moment. That tells me that you might need to develop your own view based on System.Windows.Controls.ViewBase. You can find a short tutorial on doing such things here: http://msdn.microsoft.com/en-us/library/ms748859%28v=vs.110%29.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900