User Profile & Activity

Jonathan Terrell Member
Posted: December 21, 2011 8:25 AM

Hi, I understand that I have to manage the content by handling the spin event, but can't do this as the up/down buttons are always disabled when the control displays. All I want to know is how to enable the spin butons. If the control is not designed to support this type of requirement then that's ok.  Jonathan

Posted: December 20, 2011 4:21 PM

Hi, not sure if it makes any difference, but I'm using a Windows 7 64 bit laptop with a 120 dpi monitor. I also noticed that both lines between the "REQUIRED TO SUPPRESS EXCEPTION" comments are commented out in my copy. However I don't think this makes any difference.  I have attached a copy of the stack trace from my exception. Thanks, Jonathan



Posted: December 20, 2011 3:47 AM

I'm very sorry, I mistakenly typed UXButtonSplit it is the UXButtonSpinner I can not get to work. Jonathan

Posted: December 19, 2011 2:55 PM

Sorry for another question, but what do you mean by 'zoom scenario'.  Thanks, Jonathan

Posted: December 19, 2011 3:45 AM

Hi, in step three you have to click the second (last) menu item labled "Item 1", not the first one.  Thanks, Jonathan

Posted: December 18, 2011 6:07 PM

Hi, there was no physical attachment, the sample project is included within the message as inserted code.  Thanks, Jonathan

Posted: December 16, 2011 7:06 PM

Hi, do you have an update regarding my last reply, or should I close the issue.  Thanks, Jonathan

Posted: December 1, 2011 3:52 AM

Hi, thank you very much for the detailed response.  We are very impressed with the level of assistance we have received during our evaluation.

The example you attached works well, but does not allow an item to be dragged and dropped to an empty sub-folder.  If you remove all the items from a sub-folder then try and drag one back, it is not allowed.  This is why I included the AllowDragObject and DragObjectCommand references in the original example.  I assume trapping the Drop event would also work.  Maybe there is a simpler way to do this? All the best, Jonathan

Posted: November 24, 2011 10:57 AM

Hi, spent some time investigating options. Have attached a small sample that supports drag and drop between two UXTreeViewControl. Would this be the best approach? The first control is declared in xaml, the second created in code-behind. Thanks, Jonathan

XAML code:

<UserControl x:Class="SilverlightApplication15.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 xmlns:UXCollection="clr-namespace:Intersoft.Client.UI.Aqua.UXCollection;assembly=Intersoft.Client.UI.Aqua.UXCollection">
 <Grid>
 <Grid.ColumnDefinitions>
 <ColumnDefinition Width="*" />
 <ColumnDefinition Width="*" />
 </Grid.ColumnDefinitions>
 <UXCollection:UXTreeView x:Name="tree1" Grid.Column="0" BorderThickness="0">
 <UXCollection:UXTreeViewItem Header="Top" AllowDropItem="True" AllowDropObject="True" AllowMoveItem="True" AllowReorderItem="True"
 DropObjectCommand="{Binding DropObjectCommand}" IsExpanded="True">
 <UXCollection:UXTreeViewItem Header="Item 1" />
 <UXCollection:UXTreeViewItem Header="Item 2" />
 <UXCollection:UXTreeViewItem Header="Folder 1" AllowDropItem="True" AllowDropObject="True" AllowMoveItem="True" AllowReorderItem="True"
 DropObjectCommand="{Binding DropObjectCommand}" IsExpanded="True">
 <UXCollection:UXTreeViewItem Header="Item 1.1" />
 <UXCollection:UXTreeViewItem Header="Item 1.2" />
 <UXCollection:UXTreeViewItem Header="Item 1.3" />
 <UXCollection:UXTreeViewItem Header="Item 1.4" />
 <UXCollection:UXTreeViewItem Header="Item 1.5" />
 </UXCollection:UXTreeViewItem>
 <UXCollection:UXTreeViewItem Header="Item 3" />
 <UXCollection:UXTreeViewItem Header="Folder 2" AllowDropObject="True" DropObjectCommand="{Binding DropObjectCommand}" />
 </UXCollection:UXTreeViewItem>
 </UXCollection:UXTreeView>
 <UXCollection:UXTreeView x:Name="tree2" Grid.Column="1" BorderThickness="1,0,0,0" />
 </Grid>
</UserControl>


C# code:

using System;
using Intersoft.Client.Framework.Input;
using Intersoft.Client.UI.Aqua.UXCollection;
using Intersoft.Client.UI.Controls.Interactivity;
namespace SilverlightApplication15 {
 public partial class MainPage {
 public MainPage() {
 DropObjectCommand = new DelegateCommand(ExecuteDropObjectCommand);
 InitializeComponent();
 DataContext = this;
 AMBuildTree();
 }
 public DelegateCommand DropObjectCommand { get; set; }
 public void ExecuteDropObjectCommand(Object parameter) {
 var dropObjectParameter = parameter as DropObjectParameter; // Cast drop object parameters.
 if (dropObjectParameter == null) return;
 var sourceElement = dropObjectParameter.SourceElement as UXTreeViewItem; // Identify the item being dropped.
 if (sourceElement == null) return;
 var sourceElementParent = sourceElement.Parent as UXTreeViewItem; // Identify the parent of the item being dropped.
 if (sourceElementParent == null) return;
 var targetElement = dropObjectParameter.TargetElement as UXTreeViewItem; // Identify the item being dropped onto.
 if (targetElement == null) return;
 sourceElementParent.Items.Remove(sourceElement); // Relocate tree view item.
 targetElement.Items.Add(sourceElement);
 targetElement.AllowDropItem = true;
 targetElement.AllowMoveItem = true;
 targetElement.AllowReorderItem = true;
 }
 private void AMBuildTree() {
 UXTreeViewItem topItem;
 UXTreeViewItem folder;
 tree2.Items.Add(topItem = AMBuildFolder("Top"));
 topItem.Items.Add(AMBuildItem("Item 1"));
 topItem.Items.Add(AMBuildItem("Item 2"));
 topItem.Items.Add(folder = AMBuildFolder("Folder 1"));
 folder.Items.Add(AMBuildItem("Item 1.1"));
 folder.Items.Add(AMBuildItem("Item 1.2"));
 folder.Items.Add(AMBuildItem("Item 1.3"));
 folder.Items.Add(AMBuildItem("Item 1.4"));
 folder.Items.Add(AMBuildItem("Item 1.5"));
 topItem.Items.Add(AMBuildItem("Item 3"));
 topItem.Items.Add(AMBuildFolder("Folder 2"));
 }
 private UXTreeViewItem AMBuildFolder(String label) {
 return new UXTreeViewItem {
 AllowDropItem = true,
 AllowDropObject = true,
 AllowMoveItem = true,
 AllowReorderItem = true,
 DropObjectCommand = DropObjectCommand,
 Header = label,
 IsExpanded = true
 };
 }
 private static UXTreeViewItem AMBuildItem(String label) {
 return new UXTreeViewItem { Header = label };
 }
 }
}

 

Posted: November 23, 2011 1:57 PM

Hi, we had reviewed the documentation specifically the section "How-to: Drag an UIElement using API". As part of our evaluation of the CLientUI we are attempting to convert segments of an existing application using this approach. I have included a simple example, which when run under Silverlight, sees the MouseDown and Up events fire for the standard TreeView control, but not the UXTreeView control. Are we doing something wrong, or do we need to consider a different approach. Thanks, Joanthan

<UserControl x:Class="SilverlightApplication13.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:UXCollection="clr-namespace:Intersoft.Client.UI.Aqua.UXCollection;assembly=Intersoft.Client.UI.Aqua.UXCollection"
    xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls">
  <StackPanel x:Name="LayoutRoot" Background="White">
    <UXCollection:UXTreeView>
      <UXCollection:UXTreeViewItem Header="Top">
        <UXCollection:UXTreeViewItem Header="Item 1" />
        <UXCollection:UXTreeViewItem Header="Item 2" />
        <UXCollection:UXTreeViewItem Header="Item 3" MouseLeftButtonDown="UXTreeViewItem_MouseLeftButtonDown"
            MouseLeftButtonUp="UXTreeViewItem_MouseLeftButtonUp" />
        <UXCollection:UXTreeViewItem Header="Item 4" />
        <UXCollection:UXTreeViewItem Header="Item 5" />
      </UXCollection:UXTreeViewItem>
    </UXCollection:UXTreeView>
    <Controls:TreeView>
      <Controls:TreeViewItem Header="Top">
        <Controls:TreeViewItem Header="Item 1" />
        <Controls:TreeViewItem Header="Item 2" />
        <Controls:TreeViewItem Header="Item 3" MouseLeftButtonDown="UXTreeViewItem_MouseLeftButtonDown"
            MouseLeftButtonUp="UXTreeViewItem_MouseLeftButtonUp" />
        <Controls:TreeViewItem Header="Item 4" />
        <Controls:TreeViewItem Header="Item 5" />
      </Controls:TreeViewItem>
    </Controls:TreeView>
  </StackPanel>
</UserControl>

 

All times are GMT -5. The time now is 6:46 PM.
Previous Next