aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.Synchronization.UI/Views/MainView.xaml
blob: bc927399b27e60732007c4c932b51f612214768d (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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<UserControl x:Class="Tango.Synchronization.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:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:System="clr-namespace:System;assembly=mscorlib"
             xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:fa="http://schemas.fontawesome.io/icons/"
             xmlns:local="clr-namespace:Tango.Synchronization.UI.Views"
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="1000" Background="#202020">

    <UserControl.Resources>
        <VisualBrush x:Key="badgeBackground">
            <VisualBrush.Visual>
                <Border>
                    <Path Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                        <Path.RenderTransform>
                            <ScaleTransform ScaleX="-1"></ScaleTransform>
                        </Path.RenderTransform>
                        <Path.Fill>
                            <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                <GradientStop Color="#202020" Offset="0.4" />
                                <GradientStop Color="#FF4E4E4E" Offset="1"/>
                            </LinearGradientBrush>
                        </Path.Fill>
                        <Path.Data>
                            <PathGeometry Figures="M 53.868 43.913 H 19.511 c -0.444 0 -0.875 -0.151 -1.221 -0.428 L 0.734 29.439 c -0.978 -0.783 -0.978 -2.271 0 -3.053 L 18.29 12.341 c 0.347 -0.277 0.777 -0.428 1.221 -0.428 h 34.356 c 1.081 0 1.958 0.877 1.958 1.958 v 28.084 c 0 1.081 -0.876 1.958 -1.957 1.958 z" FillRule="NonZero"/>
                        </Path.Data>
                    </Path>
                </Border>
            </VisualBrush.Visual>
        </VisualBrush>

        <converters:BooleanInverseConverter x:Key="BooleanInverseConverter"></converters:BooleanInverseConverter>
    </UserControl.Resources>

    <Grid>
        <Grid.Style>
            <Style TargetType="Grid">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsBusy}" Value="True">
                        <Setter Property="Cursor" Value="AppStarting"></Setter>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsBusy}" Value="False">
                        <Setter Property="Cursor" Value="Arrow"></Setter>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </Grid.Style>

        <Grid.RowDefinitions>
            <RowDefinition Height="100"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>

        <Grid>
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20 15">
                <Image Source="/Images/server.png" RenderOptions.BitmapScalingMode="Fant"></Image>
                <TextBlock Text="Tango DB Synchronizer" VerticalAlignment="Center" Margin="20 0 0 0" FontSize="36" Foreground="Silver">
                    <TextBlock.Effect>
                        <DropShadowEffect/>
                    </TextBlock.Effect>
                </TextBlock>
            </StackPanel>

            <Rectangle VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Margin="20 0 50 0" Stroke="DimGray" StrokeThickness="1" StrokeDashArray="5"></Rectangle>
        </Grid>

        <Grid Grid.Row="1" Margin="10">
            <Grid.RowDefinitions>
                <RowDefinition Height="218*"/>
                <RowDefinition Height="5"/>
                <RowDefinition Height="151*"/>
            </Grid.RowDefinitions>

            <Grid IsEnabled="{Binding IsBusy,Converter={StaticResource BooleanInverseConverter}}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="600"/>
                    <ColumnDefinition Width="1*"/>
                </Grid.ColumnDefinitions>

                <Grid Margin="5">
                    <GroupBox Header="Compare">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="57*"/>
                                <RowDefinition Height="50"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition MaxWidth="250" />
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>

                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>

                                <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20 0 0 0">
                                    <TextBlock Background="{StaticResource badgeBackground}" Padding="5" Width="200" FontSize="11" HorizontalAlignment="Left">Master DataBase</TextBlock>
                                    <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
                                        <TextBox IsReadOnly="True" Width="130" BorderBrush="#4E4E4E" Text="{Binding MasterDBName}"></TextBox>
                                        <Button Margin="5 0 0 0" Cursor="Hand" VerticalAlignment="Center" Style="{DynamicResource MetroCircleButtonStyle}" mahapps:ButtonHelper.PreserveTextCase="True" BorderThickness="0" Command="{Binding BrowseMasterDBCommand}">
                                            <fa:ImageAwesome Icon="FolderOpen" Width="24" Foreground="Gray"></fa:ImageAwesome>
                                        </Button>
                                    </StackPanel>
                                </StackPanel>

                                <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="1" Margin="20 0 0 0">
                                    <TextBlock Background="{StaticResource badgeBackground}" Padding="5" Width="200" FontSize="11" HorizontalAlignment="Left">Slave DataBase</TextBlock>
                                    <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
                                        <TextBox IsReadOnly="True" Width="130" BorderBrush="#4E4E4E" Text="{Binding SlaveDBName}"></TextBox>
                                        <Button Margin="5 0 0 0" Cursor="Hand" VerticalAlignment="Center" Style="{DynamicResource MetroCircleButtonStyle}" mahapps:ButtonHelper.PreserveTextCase="True" BorderThickness="0" Command="{Binding BrowseSlaveDBCommand}">
                                            <fa:ImageAwesome Icon="FolderOpen" Width="24" Foreground="Gray"></fa:ImageAwesome>
                                        </Button>
                                    </StackPanel>
                                </StackPanel>
                            </Grid>

                            <Button Margin="20 10" Grid.Row="1" Width="130" HorizontalAlignment="Left" Style="{StaticResource AccentedSquareButtonStyle}" mahapps:ButtonHelper.PreserveTextCase="True" BorderThickness="0" Command="{Binding CompareCommand}">
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">COMPARE</TextBlock>
                                    <fa:ImageAwesome Icon="LongArrowRight" VerticalAlignment="Center" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Button},Path=Foreground}" Width="16"></fa:ImageAwesome>
                                </StackPanel>
                            </Button>

                            <Grid Grid.Column="1" Grid.RowSpan="2">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="20"/>
                                    <RowDefinition Height="205*"/>
                                </Grid.RowDefinitions>
                                <TextBlock Margin="10 5 0 0">Differences</TextBlock>
                                <ListBox Margin="10" Background="#151515" Grid.Row="1" ItemsSource="{Binding Differences}" SelectedItem="{Binding SelectedDifference,Mode=TwoWay}">
                                    <ListBox.ItemTemplate>
                                        <DataTemplate>
                                            <Border Padding="10">
                                                <StackPanel Orientation="Horizontal">
                                                    <fa:ImageAwesome Icon="Cog" Width="20" Height="20" Foreground="Gray"></fa:ImageAwesome>
                                                    <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Text="{Binding Description}"></TextBlock>
                                                </StackPanel>
                                            </Border>
                                        </DataTemplate>
                                    </ListBox.ItemTemplate>
                                </ListBox>
                            </Grid>
                        </Grid>
                    </GroupBox>
                </Grid>

                <Grid Grid.Column="1">
                    <GroupBox Header="Synchronize" Margin="10">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="1*"/>
                                <RowDefinition Height="50"/>
                            </Grid.RowDefinitions>

                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="20"/>
                                    <RowDefinition Height="71*"/>
                                </Grid.RowDefinitions>
                                <TextBlock Margin="10 0 0 0" VerticalAlignment="Bottom">SQL Command</TextBlock>
                                <TextBox Margin="10" Foreground="Gray" FontSize="11" Text="{Binding SelectedDifference.Command,Mode=OneWay}" BorderThickness="0" IsReadOnly="True" Background="#151515" Padding="5" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" AcceptsReturn="True" Grid.Row="1"></TextBox>
                            </Grid>

                            <Grid Grid.Row="1">
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                    <Button Margin="10 10" Grid.Row="1" Width="120" HorizontalAlignment="Right" Style="{StaticResource AccentedSquareButtonStyle}" mahapps:ButtonHelper.PreserveTextCase="True" BorderThickness="0" Command="{Binding CommitCommand}">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">COMMIT</TextBlock>
                                            <fa:ImageAwesome Icon="Bolt" VerticalAlignment="Center" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Button},Path=Foreground}" Width="16"></fa:ImageAwesome>
                                        </StackPanel>
                                    </Button>
                                    <Button Margin="10 10" Grid.Row="1" Width="120" HorizontalAlignment="Right" Style="{StaticResource AccentedSquareButtonStyle}" mahapps:ButtonHelper.PreserveTextCase="True" BorderThickness="0" Command="{Binding CommitAllCommand}">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">COMMIT ALL</TextBlock>
                                            <fa:ImageAwesome Icon="SortAmountAsc" VerticalAlignment="Center" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Button},Path=Foreground}" Width="16"></fa:ImageAwesome>
                                        </StackPanel>
                                    </Button>
                                </StackPanel>
                            </Grid>
                        </Grid>
                    </GroupBox>
                </Grid>
            </Grid>

            <GridSplitter Margin="5 0 5 0" Grid.Row="1" Height="5" HorizontalAlignment="Stretch" VerticalAlignment="Center">
                <GridSplitter.Background>
                    <LinearGradientBrush>
                        <GradientStop/>
                        <GradientStop Color="#FF848484" Offset="0.5"/>
                        <GradientStop Offset="1"/>
                    </LinearGradientBrush>
                </GridSplitter.Background>
            </GridSplitter>

            <Grid Grid.Row="2" Background="Black" Margin="10 5">

                <TextBox Text="{Binding Log,Mode=OneWay}" Background="Transparent" IsReadOnly="True" Padding="5" BorderThickness="0" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" FontSize="11" Foreground="Silver">

                </TextBox>

                <Border HorizontalAlignment="Right" Margin="0 0 10 0" VerticalAlignment="Top" Width="300" Height="40" Padding="5" CornerRadius="0 0 30 30" BorderThickness="1 0 1 1" BorderBrush="DimGray">
                    <Border.Style>
                        <Style TargetType="Border">
                            <Setter Property="RenderTransform">
                                <Setter.Value>
                                    <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform>
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsBusy}" Value="True">
                                    <DataTrigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.EnterActions>
                                    <DataTrigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0" BeginTime="00:00:01" Duration="00:00:0.5"></DoubleAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.ExitActions>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Border.Style>
                    <Border.Background>
                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                            <GradientStop Color="#FF272727"/>
                            <GradientStop Color="#FF777777" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>

                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20 0 0 0">
                        <mahapps:ProgressRing Width="24" Height="24" Foreground="Gainsboro"></mahapps:ProgressRing>
                        <TextBlock Text="{Binding Status}" Foreground="Gainsboro" VerticalAlignment="Center" Margin="10 0 0 0"></TextBlock>
                    </StackPanel>
                </Border>

            </Grid>
        </Grid>
    </Grid>
</UserControl>