iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Can one set the ItemsSource at the root level of a UXDesktopDock to an ObJectModel with children and have that bind via a heirarchical data template. This should drive the creation of not only the Top-Level buttons, but also the childlevel StackItems?
If so, can you provide an example soon. Thanks.
Based on my test using the attached simple sample, the provided suggestion run as intended. The sample page requires some images which you could retrieve from our provided ClientUI sample.
Hi Rick,
This feature has a bug in RC version and currently being fixed.
But to make sure that we can cover your scenario i'll explained how we can achive it and there some workaround you can try on with the RC version.
From my understanding it seems that you want to bind UXDesktopDock to an hierarchical object model and want to change the settings of each UXDesktopDockButton and its StackItems.
This is do-able but not through HierarhicalDataTemplate.
HierarchicalDataTemplate is used to define template in a uniform hierarhical structure such as MenuItem and TreeViewItem ( we don't have treeview component yet, but thats the idea)
For your scenario this is what you want to do.
public class Item { public ChildrenItemCollection Children public string DisplayText public ImageSource DisplayImage } public class ChildrenItem { public string DisplayChildText public ImageSource DisplayChildImage }
then do the binding as follows:
<Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource SampleDataSource}}"> <Intersoft:UXDesktopDock CollectionMemberPath="Children" DisplayMemberPath="DisplayText" ImageMemberPath="DisplayImage" ItemsSource="{Binding Collection}" ItemContainerStyle="{StaticResource UXDesktopDockButtonStyle1}"/> </Grid>
This will define the first level binding (Item lvl) to create the UXDockButton.
Note that there's definition call CollectionMemberPath, this define the path to look for SubItem Collection and since our data structure use Children as its property name we specify Children for CollectionMemberPath value.
The second steps is bind the second level (SubItem lvl) to do this you need to create a style for ItemContainerStyle.
ItemContainerStyle basically provide style across all item that belong to that specific control (in this case UXDesktopDock)
<Style x:Key="UXDesktopDockButtonStyle1" TargetType="Intersoft:UXDesktopDockButton"> <Setter Property="ImageMemberPath" Value="DisplayChildImage"/> <Setter Property="StackMode" Value="GridStyle"/> </Style>
This will specify binding definition for ChildrenItem (StackItem)
Note that you can try on with ImageMemberPath in this level for RC version, the other properties such as DisplayMemberPath is not working but it will be in RTM version.
To workaround this you need to have the same property name for parent and child.
public class Item { public ChildrenItemCollection Children public string DisplayText public ImageSource DisplayImage } public class ChildrenItem { public string DisplayText public ImageSource DisplayImage }
If you have the same property name DisplayText at parent and DisplayText at children.
You do not need to specify anything at child level, since the parent - child settings will be applied (meaning if the child property isn't changed it will use the parent one)
<Style x:Key="UXDesktopDockButtonStyle1" TargetType="Intersoft:UXDesktopDockButton"> <Setter Property="FlippingEffectEnabled" Value="True"/> <Setter Property="StackMode" Value="GridStyle"/> </Style>
Hope this helps
Regards
Andry
Hi, Andry...
unfortunately the approach you have posted does not work. I tested it with "Intersoft WebUI Studio 2010 R1". The items will be bound but not displayed.
What went wrong?
Best,
Maxwell
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname