Friday, February 13, 2015

TaskGroup



TaskGroup class
This item only can be used on Metro Tasks Screen. It contains task buttons and one optional header.
Examples
The following example shows how to use TaskGroup.

In the MainSurfaceSlider.xaml file, add the codes as following
<src:SurfaceSlider
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:src="clr-namespace:LinsUIWPF;assembly=LinsUIWPF" 
x:Class="Demo.SurfaceSliders.MainSurfaceSlider" 
mc:Ignorable="d" Height="435" Width="1130">

<!--------------------------------------------->

<src:SurfaceSliderTasksPanel>
<src:TaskGroup ID="4011" Text="File Operation">
<src:TaskGroupHeader>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter x:Name="GroupHeader1" Content="{Binding}" ContentTemplate="{StaticResource TaskGroupHeaderTemplate1}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
</src:TaskGroupHeader>
<src:TaskButton Text="Copy" ID="4012ButtonType="LARGE" ViewID = "{StaticResource DESERTLAND_DOC_ID}" CommandID="{StaticResource COPY_COMMAND_ID}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter x:Name="CopyTask" Content="{Binding}" ContentTemplate="{StaticResource CopyTaskTemplate}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
</src:TaskButton>
</src:TaskGroup>
</src:SurfaceSliderTasksPanel>

<!--------------------------------------------->

</src:SurfaceSlider>
  
§  Constructors
1)  public TaskGroup()
Remarks
Initialize a new instance of TaskGroup
§  Members
1)  public CONTENT_HORIZONTAL_ALIGNMENT Alignment { get; set; }
Remarks
Gets or sets the way that the group header title will be aligned. It can be one of the following values,
§   LEFT:             
The title of the group header will be aligned with left.
§   RIGHT:                
The title of the group header will be aligned with right.
§   CENTER:         
The title of the group header will be aligned at center.
2)  public virtual Rect Bounds { get; }
Remarks
Retrieve both the size and the location of the task group, in pixels, relative to its parent.
3)  public virtual Rect BoundsAtMDIFrame { get; }
Remarks
Retrieve both the size and the location of the task group, in pixels, relative to MDI frame.
4)  public FontFamily Font { get; set; }
Remarks
Gets or sets the font of the header title. The default is SystemFonts.MenuFontFamily.
5)  public Color FontColor { get; set; }
Remarks
Gets or sets the font color of the header title. The default is SystemManager.FlexParameters.DefaultToolItemFontColor.
6)  public double FontSize { get; set; }
Remarks
Gets or sets the font size of the header title. The default is SystemFonts.MenuFontSize.
7)  public FontStyle FontStyle { get; set; }
Remarks
Gets or sets the font style of the header title. The default is normal.
8)public FontWeight FontWeight { get; set; }
Remarks
Gets or sets the font weight of the header title. The default is normal.
9)  public TaskGroupHeader Header { get; }
Remarks
Get the header. This member can be null.
10)public FlexCollection<TaskButton> Items { get; }               
Remarks
Retrieve the task buttons it contains.          
11)public virtual long ID { get; set; }               
Remarks
Every task group should have a unique ID. If the user does not assign a number to the ID, a unique number which is larger than FlexConstants.m_nUserDefinedControlStartID (10,000,000) will be automatically generated and assigned to it. If the ID is between FlexConstants.m_nUserDefinedControlStartID (1000) and FlexConstants.m_nUserDefinedControlStartID (10,000,000), then once the task group is created, it will never been destroyed, and its layout will be persistent and customizable. You can always use LinsUIToolItemManager.GetTaskGroup() to retrieve its instance, once it is created.
12)public virtual string Text { get; set; }
Remarks
Gets or sets the text of the task group.

Demo

References:
Command,
Command Events,
Commands Manager,
Create a Command,
Dynamically Link a Tool Item to a Command Existed in an Optional Assembly,
FlexToolBarBaseButton,
Features,
How To,
Index,
Instruction,
LinsUIWPFDockingManager,
SurfaceSlider,
SurfaceSliderFooter,
SurfaceSliderHeader,
SurfaceSliderTasksPanel,
TaskButton,
TaskGroupHeader,
Tool Items Manager

No comments:

Post a Comment