Added gridlines
This commit is contained in:
parent
51d0645699
commit
35f677a0fa
@ -84,14 +84,21 @@
|
|||||||
IsHitTestVisible="False"
|
IsHitTestVisible="False"
|
||||||
Stroke="{DynamicResource DataGridCellFocusVisualSecondaryBrush}"
|
Stroke="{DynamicResource DataGridCellFocusVisualSecondaryBrush}"
|
||||||
StrokeThickness="1" />
|
StrokeThickness="1" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
<Rectangle Name="VerticalSeparator"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="1"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
Fill="{DynamicResource DataGridGridLinesBrush}" />
|
||||||
|
|
||||||
<ContentPresenter Margin="{TemplateBinding Padding}"
|
<ContentPresenter Margin="{TemplateBinding Padding}"
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Content="{TemplateBinding Content}"
|
Content="{TemplateBinding Content}"
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
ContentTemplate="{TemplateBinding ContentTemplate}"/>
|
||||||
/>
|
|
||||||
|
|
||||||
<Rectangle x:Name="InvalidVisualElement"
|
<Rectangle x:Name="InvalidVisualElement"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
@ -256,8 +263,8 @@
|
|||||||
<ControlTemplate>
|
<ControlTemplate>
|
||||||
<Border x:Name="RowBorder"
|
<Border x:Name="RowBorder"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{DynamicResource DataGridGridLinesBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="0.5"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}">
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
<DataGridFrozenGrid Name="PART_Root"
|
<DataGridFrozenGrid Name="PART_Root"
|
||||||
ColumnDefinitions="Auto,*"
|
ColumnDefinitions="Auto,*"
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using ApplicationServices;
|
using ApplicationServices;
|
||||||
|
using Avalonia.Controls;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
using DataLayer;
|
using DataLayer;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
@ -27,6 +28,60 @@ namespace LibationWinForms.AvaloniaUI.ViewModels
|
|||||||
Queue.QueuededCountChanged += Queue_QueuededCountChanged;
|
Queue.QueuededCountChanged += Queue_QueuededCountChanged;
|
||||||
Queue.CompletedCountChanged += Queue_CompletedCountChanged;
|
Queue.CompletedCountChanged += Queue_CompletedCountChanged;
|
||||||
Logger = ProcessQueue.LogMe.RegisterForm(this);
|
Logger = ProcessQueue.LogMe.RegisterForm(this);
|
||||||
|
|
||||||
|
#region Design Mode Testing
|
||||||
|
if (Design.IsDesignMode)
|
||||||
|
{
|
||||||
|
using var context = DbContexts.GetContext();
|
||||||
|
var book = context.GetLibraryBook_Flat_NoTracking("B017V4IM1G");
|
||||||
|
List<ProcessBook2> testList = new()
|
||||||
|
{
|
||||||
|
new ProcessBook2(book, Logger)
|
||||||
|
{
|
||||||
|
Result = ProcessBookResult.FailedAbort,
|
||||||
|
Status = ProcessBookStatus.Failed,
|
||||||
|
},
|
||||||
|
new ProcessBook2(book, Logger)
|
||||||
|
{
|
||||||
|
Result = ProcessBookResult.FailedSkip,
|
||||||
|
Status = ProcessBookStatus.Failed,
|
||||||
|
},
|
||||||
|
new ProcessBook2(book, Logger)
|
||||||
|
{
|
||||||
|
Result = ProcessBookResult.FailedRetry,
|
||||||
|
Status = ProcessBookStatus.Failed,
|
||||||
|
},
|
||||||
|
new ProcessBook2(book, Logger)
|
||||||
|
{
|
||||||
|
Result = ProcessBookResult.ValidationFail,
|
||||||
|
Status = ProcessBookStatus.Failed,
|
||||||
|
},
|
||||||
|
new ProcessBook2(book, Logger)
|
||||||
|
{
|
||||||
|
Result = ProcessBookResult.Cancelled,
|
||||||
|
Status = ProcessBookStatus.Cancelled,
|
||||||
|
},
|
||||||
|
new ProcessBook2(book, Logger)
|
||||||
|
{
|
||||||
|
Result = ProcessBookResult.Success,
|
||||||
|
Status = ProcessBookStatus.Completed,
|
||||||
|
},
|
||||||
|
new ProcessBook2(book, Logger)
|
||||||
|
{
|
||||||
|
Result = ProcessBookResult.None,
|
||||||
|
Status = ProcessBookStatus.Working,
|
||||||
|
},
|
||||||
|
new ProcessBook2(book, Logger)
|
||||||
|
{
|
||||||
|
Result = ProcessBookResult.None,
|
||||||
|
Status = ProcessBookStatus.Queued,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
Items.Enqueue(testList);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
private int _completedCount;
|
private int _completedCount;
|
||||||
|
|||||||
@ -45,8 +45,17 @@ namespace LibationWinForms.AvaloniaUI.ViewModels
|
|||||||
if (Design.IsDesignMode)
|
if (Design.IsDesignMode)
|
||||||
{
|
{
|
||||||
using var context = DbContexts.GetContext();
|
using var context = DbContexts.GetContext();
|
||||||
var book = context.GetLibraryBook_Flat_NoTracking("B017V4IM1G");
|
List<LibraryBook> sampleEntries = new()
|
||||||
GridEntries = new GridEntryBindingList2(CreateGridEntries(new List<LibraryBook> { book }));
|
{
|
||||||
|
context.GetLibraryBook_Flat_NoTracking("B017V4IM1G"),
|
||||||
|
context.GetLibraryBook_Flat_NoTracking("B017V4IWVG"),
|
||||||
|
context.GetLibraryBook_Flat_NoTracking("B017V4JA2Q"),
|
||||||
|
context.GetLibraryBook_Flat_NoTracking("B017V4NUPO"),
|
||||||
|
context.GetLibraryBook_Flat_NoTracking("B017V4NMX4"),
|
||||||
|
context.GetLibraryBook_Flat_NoTracking("B017V4NOZ0"),
|
||||||
|
context.GetLibraryBook_Flat_NoTracking("B017WJ5ZK6"),
|
||||||
|
};
|
||||||
|
GridEntries = new GridEntryBindingList2(CreateGridEntries(sampleEntries));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
using ApplicationServices;
|
using ApplicationServices;
|
||||||
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Input;
|
|
||||||
using Avalonia.Markup.Xaml;
|
using Avalonia.Markup.Xaml;
|
||||||
using DataLayer;
|
|
||||||
using LibationWinForms.AvaloniaUI.ViewModels;
|
using LibationWinForms.AvaloniaUI.ViewModels;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -20,63 +19,7 @@ namespace LibationWinForms.AvaloniaUI.Views
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
ProcessBookControl2.PositionButtonClicked += ProcessBookControl2_ButtonClicked;
|
ProcessBookControl2.PositionButtonClicked += ProcessBookControl2_ButtonClicked;
|
||||||
ProcessBookControl2.CancelButtonClicked += ProcessBookControl2_CancelButtonClicked;
|
ProcessBookControl2.CancelButtonClicked += ProcessBookControl2_CancelButtonClicked;
|
||||||
|
|
||||||
#region Design Mode Testing
|
|
||||||
/*
|
|
||||||
if (Design.IsDesignMode)
|
|
||||||
{
|
|
||||||
using var context = DbContexts.GetContext();
|
|
||||||
var book = context.GetLibraryBook_Flat_NoTracking("B017V4IM1G");
|
|
||||||
List<ProcessBook2> testList = new()
|
|
||||||
{
|
|
||||||
new ProcessBook2(book, Logger)
|
|
||||||
{
|
|
||||||
Result = ProcessBookResult.FailedAbort,
|
|
||||||
Status = ProcessBookStatus.Failed,
|
|
||||||
},
|
|
||||||
new ProcessBook2(book, Logger)
|
|
||||||
{
|
|
||||||
Result = ProcessBookResult.FailedSkip,
|
|
||||||
Status = ProcessBookStatus.Failed,
|
|
||||||
},
|
|
||||||
new ProcessBook2(book, Logger)
|
|
||||||
{
|
|
||||||
Result = ProcessBookResult.FailedRetry,
|
|
||||||
Status = ProcessBookStatus.Failed,
|
|
||||||
},
|
|
||||||
new ProcessBook2(book, Logger)
|
|
||||||
{
|
|
||||||
Result = ProcessBookResult.ValidationFail,
|
|
||||||
Status = ProcessBookStatus.Failed,
|
|
||||||
},
|
|
||||||
new ProcessBook2(book, Logger)
|
|
||||||
{
|
|
||||||
Result = ProcessBookResult.Cancelled,
|
|
||||||
Status = ProcessBookStatus.Cancelled,
|
|
||||||
},
|
|
||||||
new ProcessBook2(book, Logger)
|
|
||||||
{
|
|
||||||
Result = ProcessBookResult.Success,
|
|
||||||
Status = ProcessBookStatus.Completed,
|
|
||||||
},
|
|
||||||
new ProcessBook2(book, Logger)
|
|
||||||
{
|
|
||||||
Result = ProcessBookResult.None,
|
|
||||||
Status = ProcessBookStatus.Working,
|
|
||||||
},
|
|
||||||
new ProcessBook2(book, Logger)
|
|
||||||
{
|
|
||||||
Result = ProcessBookResult.None,
|
|
||||||
Status = ProcessBookStatus.Queued,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
_viewModel.Items.Enqueue(testList);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
@ -118,10 +61,10 @@ namespace LibationWinForms.AvaloniaUI.Views
|
|||||||
_viewModel.LogEntries.Clear();
|
_viewModel.LogEntries.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LogCopyBtn_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
|
private async void LogCopyBtn_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
string logText = string.Join("\r\n", _viewModel.LogEntries.Select(r => $"{r.LogDate.ToShortDateString()} {r.LogDate.ToShortTimeString()}\t{r.LogMessage}"));
|
string logText = string.Join("\r\n", _viewModel.LogEntries.Select(r => $"{r.LogDate.ToShortDateString()} {r.LogDate.ToShortTimeString()}\t{r.LogMessage}"));
|
||||||
System.Windows.Forms.Clipboard.SetDataObject(logText, false, 5, 150);
|
await Application.Current.Clipboard.SetTextAsync(logText);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void cancelAllBtn_Click(object sender, EventArgs e)
|
private async void cancelAllBtn_Click(object sender, EventArgs e)
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
<Grid>
|
<Grid>
|
||||||
|
|
||||||
<DataGrid
|
<DataGrid
|
||||||
|
CopyingRowClipboardContent="DataGrid_CopyToClipboard"
|
||||||
Name="productsGrid"
|
Name="productsGrid"
|
||||||
AutoGenerateColumns="False"
|
AutoGenerateColumns="False"
|
||||||
Items="{Binding GridEntries}"
|
Items="{Binding GridEntries}"
|
||||||
|
|||||||
@ -43,6 +43,11 @@ namespace LibationWinForms.AvaloniaUI.Views
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DataGrid_CopyToClipboard(object sender, DataGridRowClipboardEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
AvaloniaXamlLoader.Load(this);
|
AvaloniaXamlLoader.Load(this);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user