Early experiences of C1OutlookBar for Silverlight

Source: Internet
Author: User

The c1OutlookBar Control for Silverlight and WPF is added to ComponentOne 2011 v3. It corresponds to the C1NavBar of WinForms. Because "OutlookBar" is more appropriate and accurate, we use this name on the XAML platform. There are Outlook2007 and 2010 styles.

650) this. width = 650; "style =" border-right-0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px "title =" clip_image002 "border =" 0 "alt =" clip_image002 "width =" 580 "height =" 360 "src =" http://www.bkjia.com/uploads/allimg/131228/1QI533E-0.jpg "/>

OutlookBar is similar to a TabControl. You can select any Item in the Content panel. You can create a category for them by priority. You can drag and drop the OutlookBar to collapse or expand projects. In this way, you can easily customize the items displayed and which are minimized to the bottom menu. :

650) this. width = 650; "style =" display: inline "title =" clip_image003 "alt =" clip_image003 "height =" 340 "src =" http://www.bkjia.com/uploads/allimg/131228/1QI52141-1.gif "/>

The entire control can be minimized to the leftmost or rightmost. When you do not need the navigation bar, you can easily hide it and use limited screen space to display other UIS.

C1OutlookBar supports 14 different exterior styles. In fact, basically all ComponentOne Studio controls can adapt to various style by setting several Brush attributes. Thanks to ClearStyle technology.

650) this. width = 650; "style =" border-right-0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px "title =" clip_image005 "border =" 0 "alt =" clip_image005 "width =" 580 "height =" 500 "src =" http://www.bkjia.com/uploads/allimg/131228/1QI53264-2.jpg "/>

 

Control Structure

In the most basic example, we can create a C1OutlookBar using several lines of simple XAML code. Each Item contains four main attributes: Header, Content, LargeIcon, and SmallIcon. As shown in:

650) this. width = 650; "style =" border-right-0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px "title =" clip_image007 "border =" 0 "alt =" clip_image007 "width =" 580 "height =" 238 "src =" http://www.bkjia.com/uploads/allimg/131228/1QI52Z0-3.jpg "/>

In addition, you need to specify the content that can be displayed when the control is collapsed, which can be achieved by defining the icon templates. The following XAML code is the full code of C1OutlookBar:

 

 
 
  1. <c1:C1OutlookBar Name="c1OutlookBar1" Expanded;170" IsExpanded="True"  >  
  2.     <!-- content shown when the bar is collapsed -->  
  3.     <c1:C1OutlookBar.CollapsedContent>  
  4.         <c1:C1LayoutTransformer>  
  5.             <c1:C1LayoutTransformer.LayoutTransform>  
  6.                 <RotateTransform Angle="270" />  
  7.             </c1:C1LayoutTransformer.LayoutTransform>  
  8.             <TextBlock FontSize="13" TextAlignment="Center" VerticalAlignment="Center"  
  9.                         Text="Navigation Pane" />  
  10.         </c1:C1LayoutTransformer>  
  11.     </c1:C1OutlookBar.CollapsedContent>  
  12.     <!-- define icon templates -->  
  13.     <c1:C1OutlookBar.LargeIconTemplate>  
  14.         <DataTemplate>  
  15.             <Image Source="{Binding}" ;24" Height="24" />  
  16.         </DataTemplate>  
  17.     </c1:C1OutlookBar.LargeIconTemplate>  
  18.     <c1:C1OutlookBar.SmallIconTemplate>  
  19.         <DataTemplate>  
  20.             <Grid Height="24">  
  21.                 <Image Source="{Binding}" ;16" Height="16" />  
  22.             </Grid>  
  23.         </DataTemplate>  
  24.     </c1:C1OutlookBar.SmallIconTemplate>  
  25.     <!-- items -->  
  26.     <c1:C1OutlookItem Header="Home" SmallIcon="Images/16/Home.png" LargeIcon="Images/24/Home.png">  
  27.         <TextBlock Text="My Home" />  
  28.     </c1:C1OutlookItem>  
  29.     <c1:C1OutlookItem Header="Files" SmallIcon="Images/16/Cab1.png" LargeIcon="Images/24/Cab1.png">  
  30.         <TextBlock Text="My Files" />  
  31.     </c1:C1OutlookItem>  
  32.     <c1:C1OutlookItem Header="Sales" SmallIcon="Images/16/ChartPie.png" LargeIcon="Images/24/ChartPie.png">  
  33.         <TextBlock Text="My Sales" />  
  34.     </c1:C1OutlookItem>  
  35.     <c1:C1OutlookItem Header="History" SmallIcon="Images/16/History.png" LargeIcon="Images/24/History.png">  
  36.         <TextBlock Text="My History" />  
  37.     </c1:C1OutlookItem>  
  38.     <c1:C1OutlookItem Header="Settings" SmallIcon="Images/16/User.png" LargeIcon="Images/24/User.png">  
  39.         <TextBlock Text="My Settings" />  
  40.     </c1:C1OutlookItem>  
  41. </c1:C1OutlookBar> 

 

Page Layout

When C1OutlookBar is collapsed, the content area in the middle is automatically expanded, and the interface is full of free space. This function is well supported, especially when the C1OutlookBar is placed in the Grid and the ColumnDefinition width is set to Auto. It is also important to initialize ExpandedWidth. Of course, this attribute can be modified at runtime. The Code is as follows:

 
 
  1. <Grid x:Name="LayoutRoot">  
  2.     <Grid.ColumnDefinitions>  
  3.         <ColumnDefinition ;Auto" />  
  4.         <ColumnDefinition />  
  5.     </Grid.ColumnDefinitions>  
  6.     <c1:C1OutlookBar Expanded;200" IsExpanded="True" />  
  7. </Grid> 

650) this. width = 650; "style =" display: inline "title =" clip_image001 "alt =" clip_image001 "height =" 340 "src =" http://www.bkjia.com/uploads/allimg/131228/1QI54E8-4.gif "/>

 

Working in MVVM Mode

C1OutlookBar is an ItemsControl. We can set ItemsSource to a list defined by ViewModel. In this case, we can also set ItemTemplate and ContentTemplate. LargeIconTemplate and SmallIconTemplate.

 

For more functions, download Studio for Silverlight or Studio for WPF.

This article from the "grape city control blog" blog, please be sure to keep this source http://powertoolsteam.blog.51cto.com/2369428/748550

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.