<UserControl x:Class="XAMLFinance.View.XAMLFinanceView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:view="clr-namespace:XAMLFinance.View" xmlns:vm="clr-namespace:XAMLFinance.ViewModel" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <UserControl.Resources> <Style TargetType="Button" x:Key="TabHeaderButtonStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid> <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Opacity="0.5" Margin="0"/> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="true"> <Setter TargetName="contentPresenter" Property="Opacity" Value="1" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style TargetType="ContentControl" x:Key="tabHeaderStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ContentControl"> <StackPanel Orientation="Horizontal" Background="Transparent" IsHitTestVisible="True"> <ContentPresenter Content="{TemplateBinding Content}"/> <StackPanel Orientation="Horizontal" x:Name="ButtonPanel" Visibility="Hidden"> <Button Command="{Binding Path=CloseCommand}" Style="{StaticResource TabHeaderButtonStyle}"> <Image Source="../Images/close-icon.png" Stretch="None"/> </Button> <Button Command="{Binding Path=PopOutCommand}" Style="{StaticResource TabHeaderButtonStyle}"> <Image Source="../Images/new-window.png" Stretch="None"/> </Button> </StackPanel> </StackPanel> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="true"> <Setter TargetName="ButtonPanel" Property="Visibility" Value="Visible"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </UserControl.Resources> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="100"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <StackPanel Orientation="Vertical"> <Button Command="{Binding Path=ViewPriceListCommand}" Margin="5"> <StackPanel Orientation="Vertical"> <Border BorderBrush="#444" Margin="3" BorderThickness="1"> <Image Source="../Images/markets.png" /> </Border> <TextBlock Text="FTSE 100" HorizontalAlignment="Center"/> </StackPanel> </Button> <Button Command="{Binding Path=ViewHeatMapCommand}" Margin="5"> <StackPanel Orientation="Vertical"> <Border BorderBrush="#444" Margin="3" BorderThickness="1"> <Image Source="../Images/heatmap.png" /> </Border> <TextBlock Text="Heatmap" HorizontalAlignment="Center"/> </StackPanel> </Button> </StackPanel> <TabControl Grid.Column="1" ItemsSource="{Binding Path=ViewModels}" SelectedIndex="{Binding Path=SelectedTabIndex, Mode=TwoWay}"> <TabControl.ItemTemplate> <DataTemplate> <ContentControl Style="{StaticResource tabHeaderStyle}"> <TextBlock Text="{Binding Path=Title}"/> </ContentControl> </DataTemplate> </TabControl.ItemTemplate> </TabControl> </Grid> </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.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)