aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml
blob: 2e1eaf6a13cbc63bd5eed192d077f0348722942d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<UserControl x:Class="Tango.MachineStudio.Developer.Views.EmbroideryDisplayView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:emb="clr-namespace:Tango.EmbroideryUI;assembly=Tango.EmbroideryUI"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:converters="clr-namespace:Tango.MachineStudio.Developer.Converters"
             xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views"
             mc:Ignorable="d" 
             Width="1280" Height="720" Background="{StaticResource WhiteBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:EmbroideryDisplayViewVM, IsDesignTimeCreatable=False}">

    <UserControl.Resources>
        <converters:ByteArrayToBitmapSourceConverter x:Key="ByteArrayToBitmapSourceConverter" />
    </UserControl.Resources>
    
    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="60"/>
                <RowDefinition Height="593*"/>
                <RowDefinition Height="60"/>
            </Grid.RowDefinitions>

            <Grid>
                <StackPanel Orientation="Horizontal">
                    <Image Source="../Images/sewing-machine.png" Width="48"></Image>
                    <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="20" Text="{Binding Job.EmbroideryFileName}"></TextBlock>
                </StackPanel>

                <Rectangle VerticalAlignment="Bottom" Stroke="Silver"></Rectangle>
            </Grid>

            <Grid Grid.Row="1">
                <Grid.Background>
                    <ImageBrush ImageSource="../Images/seamless-grid.jpg" Stretch="None" Opacity="0.5" TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,32,32"></ImageBrush>
                </Grid.Background>
                <Rectangle HorizontalAlignment="Left" Stroke="Silver"></Rectangle>
                <Rectangle HorizontalAlignment="Right" Stroke="Silver"></Rectangle>
                <Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding Job.EmbroideryJpeg,Converter={StaticResource ByteArrayToBitmapSourceConverter}}"></Image>
            </Grid>

            <Grid Grid.Row="2">
                <Rectangle VerticalAlignment="Top" Stroke="Silver"></Rectangle>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button Height="50" Command="{Binding ExportCommand}" Width="180">
                        <StackPanel Orientation="Horizontal">
                            <materialDesign:PackIcon Kind="Export" Width="24" Height="24" />
                            <TextBlock Margin="5 0 0 0" FontSize="16">EXPORT</TextBlock>
                        </StackPanel>
                    </Button>
                </StackPanel>
            </Grid>
        </Grid>
    </Grid>
</UserControl>
nment}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" /> </AdornerDecorator> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> <!-- Template for OverloadViewer. --> <Style TargetType="{x:Type cc:OverloadViewer}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type cc:OverloadViewer}"> <Grid> <Grid.Resources> <cc:CollapseIfSingleOverloadConverter x:Key="collapseIfSingleOverloadConverter"/> <!-- Style of the UpDownButton --> <Style TargetType="{x:Type Button}" x:Key="upDownButtonStyle"> <Style.Setters> <Setter Property="Background" Value="LightGray"/> <Setter Property="Padding" Value="2,2,2,2"/> <Setter Property="Width" Value="9"/> <Setter Property="Height" Value="9"/> <Setter Property="SnapsToDevicePixels" Value="True"/> <Setter Property="OverridesDefaultStyle" Value="True"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Border Name="bd" Background="{TemplateBinding Background}" CornerRadius="2"> <ContentControl Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}"/> </Border> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="true"> <Setter TargetName="bd" Property="Background" Value="LightBlue"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style.Setters> </Style> <DataTemplate x:Key="TextBlockTemplate"> <TextBlock TextWrapping="Wrap" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}" /> </DataTemplate> </Grid.Resources> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="1*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="1*"/> </Grid.RowDefinitions> <StackPanel Grid.Row="0" Grid.Column="0" Margin="0,0,4,0" Orientation="Horizontal" Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Provider.Count, Converter={StaticResource collapseIfSingleOverloadConverter}}"> <Button Name="PART_UP" Style="{StaticResource upDownButtonStyle}"> <Path Stroke="Black" Fill="Black" Data="M 0,0.866 L 1,0.866 L 0.5,0 Z" Stretch="UniformToFill" /> </Button> <TextBlock Margin="2,0,2,0" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Provider.CurrentIndexText}"/> <Button Name="PART_DOWN" Style="{StaticResource upDownButtonStyle}"> <Path Stroke="Black" Fill="Black" Data="M 0,0 L 1,0 L 0.5,0.866 Z" Stretch="UniformToFill" /> </Button> </StackPanel> <ContentPresenter Grid.Row="0" Grid.Column="1" ContentTemplateSelector="{StaticResource templateSelector}" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Provider.CurrentHeader}" /> <ContentPresenter Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" ContentTemplateSelector="{StaticResource templateSelector}" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Provider.CurrentContent}" /> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary>