In this article, you will find a demo of a VB.NET way to duplicate the spinning panel effect widely used on the iPhone to let a panel host content both on its front and its back.
|
<UserControl x:Class="Bornander.UI.Test.Stocks.SymbolHistory"
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:c="clr-namespace:Bornander.UI.Test.Controls"
mc:Ignorable="d"
d:DesignHeight="128" d:DesignWidth="420">
<UserControl.Resources>
<Style TargetType="Label" x:Key="graphLabel">
<Style.Setters>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style.Setters>
</Style>
<LinearGradientBrush x:Key="graphBackground" StartPoint="0.5, 0" EndPoint="0.5, 1">
<GradientStop Color="#F0F0F0" Offset="0"/>
<GradientStop Color="#101020" Offset="0.2"/>
<GradientStop Color="#101020" Offset="0.5"/>
<GradientStop Color="#101020" Offset="0.8"/>
<GradientStop Color="#000000" Offset="1"/>
</LinearGradientBrush>
<Pen x:Key="graphLine" Brush="Yellow" Thickness="2.0"/>
<Pen x:Key="graphAverageLine" Brush="DarkGoldenrod" Thickness="1.0"/>
</UserControl.Resources>
<Border BorderBrush="Black" BorderThickness="2">
<Grid Background="{StaticResource ResourceKey=graphBackground}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="{Binding Path=Max, Mode=OneWay, Converter={StaticResource ResourceKey=doubleToAmount}}" Style="{StaticResource ResourceKey=graphLabel}"/>
<Label Grid.Row="2" Grid.Column="0" Content="{Binding Path=Min, Mode=OneWay, Converter={StaticResource ResourceKey=doubleToAmount}}" Style="{StaticResource ResourceKey=graphLabel}"/>
<Label Grid.Row="0" Grid.Column="1" Content="{Binding Path=Name, Mode=OneWay}" HorizontalContentAlignment="Right" Style="{StaticResource ResourceKey=graphLabel}"/>
<c:SimpleGraph Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Max="{Binding Path=Max, Mode=OneWay}" Min="{Binding Path=Min, Mode=OneWay}" Values="{Binding Path=History, Mode=OneWay}" LinePen="{StaticResource ResourceKey=graphLine}" AverageLinePen="{StaticResource ResourceKey=graphAverageLine}" />
</Grid>
</Border>
</UserControl>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Article videos
Oakmead Apps Android Games
21 Feb 2014: Best VB.NET Article of January 2014 - Second Prize
18 Oct 2013: Best VB.NET article of September 2013
23 Jun 2012: Best C++ article of May 2012
20 Apr 2012: Best VB.NET article of March 2012
22 Feb 2010: Best overall article of January 2010
22 Feb 2010: Best C# article of January 2010