aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-24 13:49:20 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-24 13:49:20 +0200
commit8e875c7d05720f92ead97b75f3367555a5153dff (patch)
tree74660a5895cfae137c2e56b15e43cccb6431cc83 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs
parent1ee3c5e5cdacd6797fbcb87a7784b40fe5d6be7f (diff)
downloadTango-8e875c7d05720f92ead97b75f3367555a5153dff.tar.gz
Tango-8e875c7d05720f92ead97b75f3367555a5153dff.zip
Implementing the new Machine Studio ActionLogs module.
Related Work Items: #2213
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/App.xaml12
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Tango.MachineStudio.ActionLogs.csproj4
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModels/MainViewVM.cs75
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml215
4 files changed, 225 insertions, 81 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/App.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/App.xaml
new file mode 100644
index 000000000..3ab646c7c
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/App.xaml
@@ -0,0 +1,12 @@
+<Application x:Class="Tango.MachineStudio.ActionLogs.App"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+ <Application.Resources>
+ <ResourceDictionary>
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="pack://application:,,,/Tango.MachineStudio.Common;component/Resources/MaterialDesign.xaml" />
+ <ResourceDictionary Source="pack://application:,,,/Tango.MachineStudio.Common;component/Themes/LightThemeColors.xaml" />
+ </ResourceDictionary.MergedDictionaries>
+ </ResourceDictionary>
+ </Application.Resources>
+</Application> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Tango.MachineStudio.ActionLogs.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Tango.MachineStudio.ActionLogs.csproj
index 1a5d06616..0d6fa213c 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Tango.MachineStudio.ActionLogs.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Tango.MachineStudio.ActionLogs.csproj
@@ -82,6 +82,10 @@
<DependentUpon>MainView.xaml</DependentUpon>
</Compile>
<Compile Include="ActionLogsModule.cs" />
+ <Page Include="App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Views\MainView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModels/MainViewVM.cs
index a550a1911..5f2d86b40 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModels/MainViewVM.cs
@@ -2,14 +2,18 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Windows;
using Tango.BL;
using Tango.BL.Builders;
using Tango.BL.Entities;
using Tango.BL.Enumerations;
+using Tango.BL.ValueObjects;
using Tango.Core.Commands;
+using Tango.Core.ExtensionMethods;
using Tango.MachineStudio.Common;
using Tango.SharedUI.Components;
@@ -17,6 +21,8 @@ namespace Tango.MachineStudio.ActionLogs.ViewModels
{
public class MainViewVM : StudioViewModel
{
+ #region properties
+
private DateTime _startSelectedDate;
public DateTime StartSelectedDate
{
@@ -49,48 +55,83 @@ namespace Tango.MachineStudio.ActionLogs.ViewModels
public SelectedObjectCollection<ActionLogType> SelectedActionLogTypes
{
get { return _selectedActionLogTypes; }
- set { _selectedActionLogTypes = value; RaisePropertyChanged(nameof(SelectedActionLogTypes)); }
+ set { _selectedActionLogTypes = value;
+ RaisePropertyChanged(nameof(SelectedActionLogTypes)); }
}
+ private ActionLog _selectedActionLog = null;
+ public ActionLog SelectedActionLog
+ {
+ get { return _selectedActionLog; }
+ set { _selectedActionLog = value;
+ SelectedItemChanged();
+ RaisePropertyChangedAuto();
+ InvalidateRelayCommands();
+ }
+ }
+
+ private ActionLogDifference _differenceObject;
+ public ActionLogDifference DifferenceObject
+ {
+ get { return _differenceObject; }
+ set { _differenceObject = value; RaisePropertyChangedAuto(); }
+ }
+
+
+ private bool _isRunning;
+ public bool IsRunning
+ {
+ get { return _isRunning; }
+ set { _isRunning = value; }
+ }
+
+ #endregion
+
public RelayCommand SearchCommand { get; set; }
public RelayCommand CopyToClipBoardCommand { get; set; }
public MainViewVM()
{
ActionLogs = new ObservableCollection<ActionLog>();
- SearchCommand = new RelayCommand(Search);
- CopyToClipBoardCommand = new RelayCommand(CopyToClipBoard);
- DateTime now = DateTime.Now; ;
+ SearchCommand = new RelayCommand(GetActionLogs, ()=> !IsRunning);
+ CopyToClipBoardCommand = new RelayCommand(CopyToClipBoard, () => SelectedActionLog != null && SelectedActionLog.DifferenceObject != null);
+ DateTime now = DateTime.Now;
StartSelectedDate = now.AddMonths(-1);
EndSelectedDate = now;
-
+ _isRunning = false;
var source = Enum.GetValues(typeof(ActionLogType)).Cast<ActionLogType>().ToObservableCollection();
var syncedSource = Enum.GetValues(typeof(ActionLogType)).Cast<ActionLogType>().ToObservableCollection();
SelectedActionLogTypes = new SelectedObjectCollection<ActionLogType>(source, syncedSource);
-
- //SelectedActionLogTypes.ToList().ForEach(x => x.IsSelected = true);
}
public override void OnApplicationReady()
{
}
-
- private void Search()
- {
- GetActionLogs();
- }
+
private void CopyToClipBoard()
{
+ DataObject data = new DataObject(SelectedActionLog.DifferenceObject.ToJsonString());
+ System.Windows.Clipboard.SetDataObject(data);
+
}
+
+ /// <summary>
+ /// New Database Query with search parameters. Initialization ActionLogs property.
+ /// </summary>
private async void GetActionLogs()
{
string filter = SearchFilter?.ToLower();
+ if (String.IsNullOrWhiteSpace(filter)) filter = null;
+
using (ObservablesContext db = ObservablesContext.CreateDefault())
{
- ActionLogs = await new ActionLogsCollectionBuilder(db).Set(x => x.LastUpdated < EndSelectedDate && x.LastUpdated >= StartSelectedDate)
+ DateTime startUtc = StartSelectedDate.ToUniversalTime();
+ DateTime endUtc = EndSelectedDate.ToUniversalTime() + DateTime.Now.TimeOfDay;
+ IsRunning = true;
+ ActionLogs = await new ActionLogsCollectionBuilder(db).Set(x => x.LastUpdated <= DbFunctions.TruncateTime(endUtc) && x.LastUpdated >= DbFunctions.TruncateTime(startUtc.Date))
.WithUsers()
.WithActionType(SelectedActionLogTypes.SynchedSource.ToArray())
.Query(y => y.Where
@@ -99,7 +140,15 @@ namespace Tango.MachineStudio.ActionLogs.ViewModels
|| (x.RelatedObjectName != null && x.RelatedObjectName.ToLower().StartsWith(filter))
|| (x.User != null && x.User.Contact != null && x.User.Contact.FullName.ToLower().StartsWith(filter)))))
.BuildAsync();
+ IsRunning = false;
}
}
+
+ private void SelectedItemChanged()
+ {
+ if (SelectedActionLog == null || SelectedActionLog.DifferenceObject== null)
+ return;
+ DifferenceObject = SelectedActionLog.DifferenceObject;
+ }
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml
index 53db8c11d..60ce2560c 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml
@@ -3,19 +3,19 @@
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:local="clr-namespace:Tango.MachineStudio.ActionLogs.Views"
xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
xmlns:vm="clr-namespace:Tango.MachineStudio.ActionLogs.ViewModels"
xmlns:global="clr-namespace:Tango.MachineStudio.ActionLogs"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
- xmlns:localConverters="clr-namespace:Tango.MachineStudio.ActionLogs.Converters"
+ xmlns:diff="clr-namespace:Tango.BL.ValueObjects;assembly=Tango.BL"
mc:Ignorable="d"
d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
<UserControl.Resources>
-
+ <sharedConverters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<sharedConverters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
- <localConverters:ActionLogTypesToStringConverter x:Key="ActionLogTypesToStringConverter"/>
</UserControl.Resources>
<Grid IsEnabled="{Binding IsFree}">
<Grid.RowDefinitions>
@@ -23,70 +23,80 @@
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="70"></TextBlock>
- <Grid Grid.Row="1" Margin="20 0 10 20">
+ <Grid Grid.Row="1" Margin="40 0 40 40">
<Grid.RowDefinitions>
- <RowDefinition Height="60"/>
+ <RowDefinition Height="70"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
- <ColumnDefinition Width ="6*"/>
- <ColumnDefinition Width ="4*"/>
+ <ColumnDefinition Width ="7*"/>
+ <ColumnDefinition Width ="3*"/>
</Grid.ColumnDefinitions >
- <DockPanel x:Name ="SearchButtons" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Stretch">
- <StackPanel DockPanel.Dock="Left">
- <TextBlock FontSize="10">Start Date:</TextBlock>
- <DatePicker x:Name="startdatePicker" SelectedDate="{Binding StartSelectedDate}" materialDesign:HintAssist.Hint="Pick start date" Width="160" VerticalAlignment="Center" FontSize="16" />
- </StackPanel>
- <StackPanel DockPanel.Dock="Left" Margin="40 0 0 0">
- <TextBlock FontSize="10">End Date:</TextBlock>
- <DatePicker x:Name="endDatePicker" SelectedDate="{Binding EndSelectedDate}" materialDesign:HintAssist.Hint="Pick end date" Width="160" VerticalAlignment="Center" FontSize="16"/>
- </StackPanel>
- <DockPanel DockPanel.Dock="Left" Margin="50 0 0 0" >
- <TextBlock DockPanel.Dock="Top" Text="Action Log Type:" VerticalAlignment="Center" FontSize="10"></TextBlock>
- <ToggleButton Width="200" Margin="0 5 0 0">
- <ToggleButton.Template>
- <ControlTemplate>
- <Grid>
- <Border CornerRadius="3" BorderBrush="{StaticResource BorderBrushGainsboro}" BorderThickness="1">
- <DockPanel>
- <materialDesign:PackIcon Width="16" Height="16" DockPanel.Dock="Right" Kind="ChevronDown" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}" />
- <TextBlock>Select Actions</TextBlock>
- </DockPanel>
- </Border>
- <Popup IsOpen="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=IsChecked}">
- <Border Padding="5">
- <ItemsControl ItemsSource="{Binding SelectedActionLogTypes}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <DockPanel Margin="2">
- <CheckBox VerticalAlignment="Center" DockPanel.Dock="Left" IsChecked="{Binding IsSelected}" />
- <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="{Binding Data,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
- </DockPanel>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </Border>
- </Popup>
- </Grid>
- </ControlTemplate>
- </ToggleButton.Template>
- </ToggleButton>
- </DockPanel>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="50 0 0 0">
- <materialDesign:PackIcon Kind="Magnify" Width="26" Height="26"/>
- <TextBox Width="210" materialDesign:HintAssist.Hint="Search by ID, user, related object name" Text="{Binding SearchFilter,UpdateSourceTrigger=PropertyChanged}" />
- </StackPanel>
- <Button Width="120" Padding="5" HorizontalAlignment="Right" DockPanel.Dock="Right" Command="{Binding SearchCommand}">Search</Button>
- </DockPanel>
+ <Grid x:Name ="SearchButtons" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Stretch">
+ <Border Padding="8" BorderBrush="DimGray" BorderThickness="0" Background="{StaticResource Logging.Background}" HorizontalAlignment="Stretch" CornerRadius="2">
+ <Border.Effect>
+ <DropShadowEffect ShadowDepth="4" BlurRadius="10" Opacity="0.5"/>
+ </Border.Effect>
+ <StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Orientation="Horizontal">
+ <StackPanel >
+ <TextBlock FontSize="10">Start Date:</TextBlock>
+ <DatePicker x:Name="startdatePicker" SelectedDate="{Binding StartSelectedDate}" materialDesign:HintAssist.Hint="Pick start date" Width="160" VerticalAlignment="Center" FontSize="16" />
+ </StackPanel>
+ <StackPanel Margin="50 0 0 0">
+ <TextBlock FontSize="10">End Date:</TextBlock>
+ <DatePicker x:Name="endDatePicker" SelectedDate="{Binding EndSelectedDate}" materialDesign:HintAssist.Hint="Pick end date" Width="160" VerticalAlignment="Center" FontSize="16" />
+ </StackPanel>
+ <DockPanel Margin="50 0 0 0" >
+ <TextBlock DockPanel.Dock="Top" Text="Action Log Type:" VerticalAlignment="Center" FontSize="10"></TextBlock>
+ <ToggleButton Width="200" Margin="0 5 0 0">
+ <ToggleButton.Template>
+ <ControlTemplate>
+ <Grid>
+ <Border CornerRadius="3" BorderBrush="{StaticResource borderBrush}" BorderThickness="1" TextElement.Foreground="Black">
+ <DockPanel>
+ <materialDesign:PackIcon Width="16" Height="16" DockPanel.Dock="Right" Kind="ChevronDown" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}" />
+ <TextBlock VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}">
+ <Run Text=" Select Actions"></Run>
+ <Run>(</Run><Run Text="{Binding SelectedActionLogTypes.SynchedSource.Count,Mode=OneWay}"></Run><Run>)</Run>
+ </TextBlock>
+ </DockPanel>
+ </Border>
+ <Popup StaysOpen="False" IsOpen="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=IsChecked}" >
+ <Border Padding="5" Background="{DynamicResource ComboBox.Floating.Background}" BorderBrush="{StaticResource AutoCompleteTextBox.Popup.BorderBrush}">
+ <ScrollViewer MaxHeight="600" Background="{DynamicResource ComboBox.Floating.Background}">
+ <ItemsControl ItemsSource="{Binding SelectedActionLogTypes}" Foreground="{StaticResource MainWindow.Foreground}">
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <DockPanel Margin="2">
+ <CheckBox VerticalAlignment="Center" DockPanel.Dock="Left" IsChecked="{Binding IsSelected}" />
+ <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="{Binding Data,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
+ </DockPanel>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </ScrollViewer>
+ </Border>
+ </Popup>
+ </Grid>
+ </ControlTemplate>
+ </ToggleButton.Template>
+ </ToggleButton>
+ </DockPanel>
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="50 10 0 0">
+ <materialDesign:PackIcon Kind="Magnify" Width="26" Height="26"/>
+ <TextBox Width="Auto" materialDesign:HintAssist.Hint="Search by ID, user, related object name" Text="{Binding SearchFilter,UpdateSourceTrigger=PropertyChanged}" />
+ </StackPanel>
+ </StackPanel>
+ </Border>
+ <Button Width="120" HorizontalAlignment="Right" Command="{Binding SearchCommand}" Margin="10 0 10 0" VerticalAlignment="Center">Search</Button>
+ </Grid>
- <Grid IsEnabled="{Binding IsFree}" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Stretch">
- <DataGrid Margin="0 0 0 10" SelectionMode="Single" SelectionUnit="FullRow"
- BorderBrush="{StaticResource borderBrush}" IsReadOnly="True" BorderThickness="1"
- Background="{StaticResource TransparentBackgroundBrush}"
- AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False"
+ <Grid IsEnabled="{Binding IsFree}" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Stretch" >
+ <DataGrid Margin="0 0 0 10" SelectionMode="Single" SelectionUnit="FullRow" RowHeight="40" BorderBrush="{StaticResource borderBrush}" IsReadOnly="True" BorderThickness="1"
+ Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserReorderColumns="True"
CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding ActionLogs}"
- SelectedItem="{Binding SelectedActionLog}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
+ SelectedItem="{Binding SelectedActionLog}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" FontSize="11">
<DataGrid.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="BorderThickness" Value="0"/>
@@ -94,23 +104,92 @@
<Setter Property="VerticalContentAlignment" Value="Center"></Setter>
</Style>
</DataGrid.CellStyle>
+ <DataGrid.RowStyle>
+ <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
+ <Style.Triggers>
+ <Trigger Property="IsMouseOver" Value="True">
+ <Setter Property="Background" Value="Transparent"></Setter>
+ <Setter Property="Foreground" Value="{StaticResource AccentColorBrush}" />
+ <Setter Property="Cursor" Value="Hand"></Setter>
+ </Trigger>
+ <Trigger Property="IsSelected" Value="True">
+ <Setter Property="Background" Value="Transparent"></Setter>
+ </Trigger>
+ <Trigger Property="IsFocused" Value="True">
+ <Setter Property="Background" Value="Transparent"></Setter>
+ </Trigger>
+ </Style.Triggers>
+ </Style>
+ </DataGrid.RowStyle>
<DataGrid.Columns>
- <DataGridTextColumn Header="ID" Binding="{Binding ID}" Width="Auto" />
- <DataGridTextColumn Header="ACTION" Binding="{Binding Type, Converter={StaticResource EnumToDescriptionConverter}}" Width="Auto" MinWidth="100"/>
- <DataGridTextColumn Header="USER" Binding="{Binding UserGuid}" Width="Auto" MinWidth="100"/>
+ <DataGridTextColumn Header="ID" Binding="{Binding ID}" Width="40" />
+ <DataGridTextColumn Header="ACTION" Binding="{Binding ActionType, Converter={StaticResource EnumToDescriptionConverter}}" Width="Auto"/>
+ <DataGridTextColumn Header="USER" Binding="{Binding User.Contact.FullName}" Width="Auto"/>
<DataGridTextColumn Header="RELATED OBJECT NAME" Binding="{Binding RelatedObjectName}" Width="Auto" />
- <DataGridTextColumn Header="GUID" Binding="{Binding RelatedObjectGuid}" Width="Auto" />
- <DataGridTextColumn Header="MESSAGE" Binding="{Binding Message}" Width="Auto" />
+ <DataGridTextColumn Header="RELATED OBJECT ID" Binding="{Binding RelatedObjectGuid}" Width="Auto" />
+ <DataGridTextColumn Header="MESSAGE" Binding="{Binding Message}" Width="1*" />
+ <DataGridTextColumn Header="TIME" Binding="{Binding LastUpdated}" Width="1*" />
</DataGrid.Columns>
</DataGrid>
</Grid>
- <DockPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Stretch">
- <Button Width="Auto" Padding="5" HorizontalAlignment="Right" DockPanel.Dock="Right" Command="{Binding SearchCommand}">COPY TO CLIPBOARD</Button>
- </DockPanel>
- <Grid Grid.Row="1" Grid.Column="1" Margin="20 0 10 20" IsEnabled="{Binding IsFree}" HorizontalAlignment="Stretch" >
+ <Grid Grid.Row="1" Grid.Column="0" Visibility="{Binding IsRunning,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
+ <mahapps:ProgressRing Margin="20 60 20 40" Width="80" Height="80" IsActive="{Binding IsRunning}"></mahapps:ProgressRing>
+ <TextBlock Text="Loading..." HorizontalAlignment="Center" FontSize="20" FontStyle="Italic" VerticalAlignment="Center" Margin="0 20 0 0"></TextBlock>
+ </StackPanel>
</Grid>
+ <Border Grid.Row="0" Grid.Column="1" Margin="40 6 11 8" Padding="8" BorderBrush="DimGray" BorderThickness="0" Background="{StaticResource Logging.Background}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="2">
+ <Border.Effect>
+ <DropShadowEffect ShadowDepth="4" BlurRadius="10" Opacity="0.5"/>
+ </Border.Effect>
+ <DockPanel VerticalAlignment="Center" HorizontalAlignment="Stretch" >
+ <Button Width="Auto" HorizontalAlignment="Right" DockPanel.Dock="Right" Command="{Binding CopyToClipBoardCommand}">Copy to clipboard</Button>
+ <TextBlock DockPanel.Dock="Top" Margin="10 5 0 0" Foreground="{StaticResource DimGrayBrush}" FontSize="16" VerticalAlignment="Center">Object Changes</TextBlock>
+ </DockPanel>
+ </Border>
+ <Border Grid.Row="1" Grid.Column="1" Margin="40 0 10 10" IsEnabled="{Binding IsFree}" BorderThickness="1" BorderBrush="{StaticResource BorderBrushGainsboro}" >
+ <DockPanel >
+ <TextBlock DockPanel.Dock="Top" Height="40" Text="{Binding DifferenceObject.Name, Mode=OneWay}" VerticalAlignment="Center" Padding="5" FontSize="18" HorizontalAlignment="Center"></TextBlock>
+ <TreeView x:Name="treeView" ItemsSource="{Binding DifferenceObject.Children, Mode=OneWay}" Background="{StaticResource TransparentBackgroundBrush}" >
+ <TreeView.ItemContainerStyle>
+ <Style TargetType="TreeViewItem" BasedOn="{StaticResource {x:Type TreeViewItem}}">
+ <Setter Property="IsExpanded" Value="True" />
+ <Setter Property="Background" Value="Transparent"></Setter>
+ <Style.Triggers>
+ <Trigger Property="IsMouseOver" Value="True">
+ <Setter Property="Background" Value="Transparent"></Setter>
+ </Trigger>
+ <Trigger Property="IsFocused" Value="True">
+ <Setter Property="Background" Value="Transparent"></Setter>
+ </Trigger>
+ <Trigger Property="IsSelected" Value="True">
+ <Setter Property="Background" Value="Transparent"></Setter>
+ </Trigger>
+ </Style.Triggers>
+ </Style>
+ </TreeView.ItemContainerStyle>
+ <TreeView.Resources>
+ <HierarchicalDataTemplate DataType="{x:Type diff:ActionLogDifference}" ItemsSource="{Binding Children}">
+ <TextBlock Text="{Binding Name}" Margin="5 0 0 0" ToolTip="{Binding}" />
+ </HierarchicalDataTemplate>
+
+ <DataTemplate DataType="{x:Type diff:ActionLogDifferenceValue}">
+ <TextBlock Margin="5 0 0 0" ToolTip="{Binding}">
+ <Run Text="{Binding Name}"/>
+ <Run>: </Run>
+ <Run Text="{Binding Before,Mode=OneWay}" Foreground="{StaticResource DimGrayBrush}"/>
+ <Run> | </Run>
+ <Run Text="{Binding After,Mode=OneWay}" Foreground="{StaticResource RedBrush100}"/>
+ </TextBlock>
+ </DataTemplate>
+ </TreeView.Resources>
+ </TreeView>
+
+ </DockPanel>
+ </Border>
+
</Grid>
</Grid>
</UserControl>