aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml
blob: 3533e3148ca0d9e460e0cf775ccab9bda93db5aa (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<UserControl x:Class="Tango.FSE.UI.Views.MainView"
             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:global="clr-namespace:Tango.FSE.UI"
             xmlns:vm="clr-namespace:Tango.FSE.UI.ViewModels"
             xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:commonControls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common"
             xmlns:local="clr-namespace:Tango.FSE.UI.Views"
             mc:Ignorable="d" 
             Background="{StaticResource FSE_PrimaryBackgroundBrush}"
             Foreground="{StaticResource FSE_PrimaryForegroundBrush}"
             d:DesignHeight="450" 
             d:DesignWidth="800" 
             d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" 
             DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
    <Grid>
        <controls:NavigationControl x:Name="NavigationControl" TransitionType="Fade">
            <local:LoadingView/>
            <local:LoginView/>
            <local:LayoutView/>
        </controls:NavigationControl>

        <!--DIALOGS-->
        <Grid x:Name="gridDialogs" IsVisibleChanged="GridDialogs_IsVisibleChanged" Background="{StaticResource FSE_SemiTransparentBrush}" Visibility="{Binding NotificationProvider.HasMessageBox,Converter={StaticResource BooleanToVisibilityConverter}}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="100*"/>
                    <RowDefinition Height="155*" MaxHeight="350" MinHeight="300" />
                    <RowDefinition Height="100*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100*"/>
                    <ColumnDefinition Width="200*" MaxWidth="780" MinWidth="400" />
                    <ColumnDefinition Width="100*"/>
                </Grid.ColumnDefinitions>
                <Grid Margin="20" RenderTransformOrigin="0.5,0.5" Grid.Column="1" Grid.Row="1">
                    <Grid.Style>
                        <Style TargetType="Grid">
                            <Setter Property="RenderTransform">
                                <Setter.Value>
                                    <ScaleTransform ScaleX="0" ScaleY="0" />
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding NotificationProvider.HasMessageBox}" Value="True">
                                    <DataTrigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" From="0" To="1" Duration="00:00:0.1" />
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" From="0" To="1" Duration="00:00:0.1" />
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.EnterActions>
                                    <DataTrigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" From="1" To="0" Duration="00:00:0.1" />
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" From="1" To="0" Duration="00:00:0.1" />
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.ExitActions>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Grid.Style>

                    <Border DataContext="{Binding NotificationProvider.CurrentMessageBox}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" CornerRadius="5" Margin="10">
                        <Border.Effect>
                            <DropShadowEffect BlurRadius="10" />
                        </Border.Effect>
                        <Grid ClipToBounds="True">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30*" />
                                    <RowDefinition Height="80*" />
                                    <RowDefinition Height="35*" />
                                </Grid.RowDefinitions>
                                <Grid>
                                    <Border CornerRadius="5 5 0 0" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}"></Border>
                                    <Border CornerRadius="5 5 0 0" BorderBrush="{StaticResource FSE_BorderBrush}" BorderThickness="0 0 0 1">
                                        <StackPanel VerticalAlignment="Center" Margin="10 0 0 0" Orientation="Horizontal" HorizontalAlignment="Left">
                                            <material:PackIcon Width="24" Height="24" Margin="0 0 10 0" x:Name="msgIcon">
                                                <material:PackIcon.Style>
                                                    <Style TargetType="material:PackIcon">
                                                        <Setter Property="Foreground" Value="{StaticResource FSE_InfoBrush}"></Setter>
                                                        <Setter Property="Kind" Value="InfoOutline"></Setter>
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding Type}" Value="Warning">
                                                                <Setter Property="Foreground" Value="{StaticResource FSE_WarningBrush}"></Setter>
                                                                <Setter Property="Kind" Value="AlertOutline"></Setter>
                                                            </DataTrigger>
                                                            <DataTrigger Binding="{Binding Type}" Value="Error">
                                                                <Setter Property="Foreground" Value="{StaticResource FSE_ErrorBrush}"></Setter>
                                                                <Setter Property="Kind" Value="AlertCircleOutline"></Setter>
                                                            </DataTrigger>
                                                            <DataTrigger Binding="{Binding Type}" Value="Success">
                                                                <Setter Property="Foreground" Value="{StaticResource FSE_SuccessBrush}"></Setter>
                                                                <Setter Property="Kind" Value="Check"></Setter>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </material:PackIcon.Style>
                                            </material:PackIcon>
                                            <TextBlock VerticalAlignment="Center" Foreground="{Binding ElementName=msgIcon,Path=Foreground}" Text="{Binding Title}" FontSize="{StaticResource FSE_MessageBoxTitleFontSize}"></TextBlock>
                                        </StackPanel>
                                    </Border>
                                    <commonControls:IconButton Icon="Close" Padding="8" Margin="0 0 5 0" Command="{Binding CloseCommand}" CommandParameter="{Binding}" HorizontalAlignment="Right" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"/>
                                </Grid>

                                <TextBlock Grid.Row="1" Margin="40" Text="{Binding Message}" VerticalAlignment="Top" HorizontalAlignment="Left" TextWrapping="Wrap"></TextBlock>

                                <Grid Grid.Row="2" Margin="10">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="80*" />
                                        <ColumnDefinition Width="50*" />
                                        <ColumnDefinition Width="50*" />
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Column="1" x:Name="btnCancel" Height="Auto" Style="{StaticResource MaterialDesignRaisedLightButton}" FontWeight="Normal" Margin="0 0 10 0" Command="{Binding CloseCommand}" Visibility="{Binding HasCancel,Converter={StaticResource BooleanToVisibilityConverter}}" Content="{Binding CancelText}"></Button>
                                    <Button Grid.Column="2" x:Name="btnOK" IsDefault="True" Style="{StaticResource MaterialDesignRaisedLightButton}" Height="Auto" FontWeight="Normal" Margin="0 0 0 0" Command="{Binding OKCommand}" Content="{Binding OKText}"></Button>
                                </Grid>
                            </Grid>
                        </Grid>
                    </Border>
                </Grid>
            </Grid>
        </Grid>
        <!--DIALOGS-->
    </Grid>
</UserControl>