First use of ShellListView and ShellTreeListBox

Shell for WPF Forum

Posted 5 years ago by Peter Treier
Version: 19.1.0682
Avatar

Good Morning all

It's the first time that I use the Shell Components...

I use the Shelltreebox in a Grid on a User Control - basically the same layout as shown in the sample. I got this Error for both components:


A value of type 'ShellListView' cannot be added to a collection or dictionary of type 'UIElementCollection'.

The Build is successful an the Control seems to be working.

Any Ideas - maybe missing Reference?
Peter

Comments (7)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Peter,

I'm sorry you're having trouble.  Can you give more information about this error...  Do you mean you only see it in the VS designer or elsewhere?  Can you post as simple of XAML as possible to make it occur?  Thanks!


Actipro Software Support

Posted 5 years ago by Peter Treier
Avatar

Well, here is a simplyfied version of my code

<Window>
	<Grid x:Name="BaseGrid">
	
		<shell:ShellTreeListBox x:Name="treeListBox" Grid.Row="0" RootSpecialFolderKind="Computer" />

		<GridSplitter Grid.Row="0" Grid.Column="1" Width="6" ResizeBehavior="PreviousAndNext" />

		<shell:ShellListView Grid.Row="0" Grid.Column="2" x:Name="listView"
									 RootShellFolder="{Binding ElementName=treeListBox, Path=SelectedShellObject}"
									 CanIncludeLinks="False" CanUseThumbnails="False" />
		<Grid.DataContext>
			<viewModel:MainVM />
		</Grid.DataContext>
	</Grid>

	<Window.DataContext>
		<viewModel:MainVM />
	</Window.DataContext>

</Window>

[Modified 5 years ago]

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Peter,

Could you let us know where exactly you are seeing the problem?  I loaded your Grid into a new Window in a new WPF project and added the Grid's ColumnDefinitions and removed the DataContext since I don't have that VM.  That being said, the app ran fine, and the VS 2019 designer opened without any issues either.  I could see both controls in the designer.


Actipro Software Support

Posted 3 years ago by JP Garza
Avatar

I am getting the same message: imgur image

I am currently using many other ActiproSoftware dlls and all of them are working fine, but the ActiproSoftware.Shell.Wpf.dll

My attempt steps to make it work where these:

  1. Add assembly reference
  2. Set "Copy Local" to Yes
  3. Set "Specific Version" to No
  4. Add namespace to xaml file → xmlns:shell="http://schemas.actiprosoftware.com/winfx/xaml/shell" 

When I try to create a Shell object in xaml this is what IntelliSense gives me: imgur image

It appears like I am only able to see the ActiproSoftware.Windows.Controls.Shell.Primitives controls but not the ActiproSoftware.Windows.Controls.Shell controls

Visutal Studio version → 16.7.14
ActiproSoftware version → 19.1.685.0

[Modified 3 years ago]

Posted 3 years ago by JP Garza
Avatar

I found what the issue was. The Actipro WPF Studio Documentation CHM said I needed to add all three references to make it work:

1. ActiproSoftware.Grids.Wpf.dll, ActiproSoftware.Shell.Wpf.dll
2. ActiproSoftware.Grids.Wpf.dll, ActiproSoftware.Grids.Wpf.dll
3. ActiproSoftware.Grids.Wpf.dll, ActiproSoftware.Editors.Wpf.dll

I had only added the first one.

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi JP,

I was just about to post this but saw you figured it out already.  I'll keep my reply in tact below though.

The first thing to check is whether you also reference our Grids and Shared assemblies.  Shell controls inherit TreeListView/TreeListBox that are defined in Grids.  Maybe if you don't have the Grids reference, the VS designer doesn't realize the shell controls are actually controls, and it therefore reports that error?

If you have those Grids/Shared references too, it should be working fine if you are absolutely positive that ALL your Actipro assemblies in your bin folder are the same exact version/build numbers.  You might want to walk through there and double check the versions of the assemblies VS copied there.  In v20.1 and later, we started offering NuGet packages on nuget.org, so it makes consuming proper assembly versions easier.


Actipro Software Support

Posted 3 years ago by JP Garza
Avatar

Makes sense. Also, great to hear you guys added support for NuGet packages! Thanks for the reply!

The latest build of this product (v24.1.3) was released 28 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.