Showing posts with label Metro Style. Show all posts
Showing posts with label Metro Style. Show all posts

Saturday, February 14, 2015

Making WPF application contain both metro-style and traditional windows style with LinsUIWPF Suite


Step 1: Download the libraries.
Step 2: Follow the link How to create a new project with LinsUIWPF Suite to create a WPF project.
Step 3: Follow the link How to create a metro screen with LinsUIWPF Suite to create a metro screen.
Step 4: You can customize a task button as follows,

<src:TaskButton ButtonType="LARGE" ViewID = "1001">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Copy" FontWeight="Thin" FontSize="12" FontStyle="Italic" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,10,0,0"/>
<Image Grid.Row="1" Stretch="Fill" Source="../Resource/Copy.ico" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0" Width="100" Height="80"/>
</Grid>

</src:TaskButton>

Step 5: Follow the link How to create a document with LinsUIWPF Suite to create a document and assign its ID to 1001.
Now you are ready to run the application.

The two demonstrations Metro  and Normal are from the Sample Code.


Metro  Style


Traditional Windows Style


Demo



Friday, February 13, 2015

SurfaceSlider


SurfaceSlider class
This is Metro Tasks Screen which displays programs and dynamically updated content on a grid of task buttons.
Examples
The following example shows how to use SurfaceSlider.

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:SurfaceSliderHeader>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter x:Name="Header1" Content="{Binding}" ContentTemplate="{StaticResource HeaderTemplate1}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
</src:SurfaceSliderHeader>

<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="4012" ButtonType="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:SurfaceSliderFooter Margin="0,0,-34,0">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter x:Name="Footer1" Content="{Binding}" ContentTemplate="{StaticResource FooterTemplate1}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom"/>
</Grid>
</src:SurfaceSliderFooter>


</src:SurfaceSlider>
  
§  Constructors
1)  public SurfaceSlider()
Remarks
Initialize a new instance of SurfaceSlider
§  Members
1)  public virtual Rect Bounds { get; }
Remarks
Retrieve both the size and the location of this surface slider, in pixels, relative to its parent.
2)  public virtual Rect BoundsAtMDIFrame { get; }
Remarks
Retrieve both the size and the location of this surface slider, in pixels, relative to MDI frame.
3)  public SurfaceSliderFooter Footer { get; set; }
Remarks
Assign or retrieve the footer. This member can be null.
4)  public SurfaceSliderHeader Header { get; set; }
Remarks
Assign or retrieve the header. This member can be null.
5)  public SurfaceSliderTasksPanel TasksPanel { get; set; }               
Remarks
Assign or retrieve the task panel. 

Demo



References:

SurfaceSliderFooter



SurfaceSliderFooter class
This item only can be used on Metro Tasks Screen. It is a customizable container used to display information and dynamically updated content about the application.
Examples
The following example shows how to use SurfaceSliderFooter.

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:SurfaceSliderHeader>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter x:Name="Header1" Content="{Binding}" ContentTemplate="{StaticResource HeaderTemplate1}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
</src:SurfaceSliderHeader>

<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="4012" ButtonType="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:SurfaceSliderFooter Margin="0,0,-34,0">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter x:Name="Footer1" Content="{Binding}" ContentTemplate="{StaticResource FooterTemplate1}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom"/>
</Grid>
</src:SurfaceSliderFooter>


</src:SurfaceSlider>
  
§  Constructors
1)  public SurfaceSliderFooter()
Remarks
Initialize a new instance of SurfaceSliderFooter
§  Members
1)  public virtual Rect Bounds { get; }
Remarks
Retrieve both the size and the location of this footer, in pixels, relative to its parent.


Demo


SurfaceSliderHeader



SurfaceSliderHeader class
This item only can be used on Metro Tasks Screen. It is a customizable container used to display information and dynamically updated content about the application.
Examples
The following example shows how to use SurfaceSliderHeader.

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:SurfaceSliderHeader>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter x:Name="Header1" Content="{Binding}" ContentTemplate="{StaticResource HeaderTemplate1}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
</src:SurfaceSliderHeader>

<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:SurfaceSliderFooter Margin="0,0,-34,0">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter x:Name="Footer1" Content="{Binding}" ContentTemplate="{StaticResource FooterTemplate1}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom"/>
</Grid>
</src:SurfaceSliderFooter>


</src:SurfaceSlider>
  
§  Constructors
1)  public SurfaceSliderHeader()
Remarks
Initialize a new instance of SurfaceSliderHeader
§  Members
1)  public virtual Rect Bounds { get; }
Remarks
Retrieve both the size and the location of this header, in pixels, relative to its parent.

Demo