Style data grid with danger buttons, other UI tweaks
This commit is contained in:
@@ -71,6 +71,18 @@
|
||||
</BehaviorCollectionTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="Button.Danger">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="Background" Value="#d90202"/>
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="Background" Value="#b70000"/>
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="Background" Value="#9a0000"/>
|
||||
</Style>
|
||||
</Style>
|
||||
</Application.Styles>
|
||||
<Application.DataTemplates>
|
||||
<DataTemplate DataType="{x:Type viewModels:MainViewModel}">
|
||||
|
||||
@@ -106,7 +106,6 @@ class MainViewModel : BaseViewModel, IFontResolver
|
||||
public void MoveItemUp(ReportFile file)
|
||||
{
|
||||
var idx = ReportFiles.IndexOf(file);
|
||||
Console.WriteLine("{0} at idx {1}", file.Title, idx);
|
||||
if (idx != 0)
|
||||
{
|
||||
// .Move() is not observed -_-
|
||||
|
||||
+4
-17
@@ -68,24 +68,10 @@
|
||||
Binding="{Binding Title}"
|
||||
IsReadOnly="True"
|
||||
Width="*"/>
|
||||
<DataGridTemplateColumn Header="Receipt Date"
|
||||
<DataGridTextColumn Header="Receipt Date"
|
||||
Binding="{Binding Date}"
|
||||
IsReadOnly="True"
|
||||
Width="*">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Date}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate DataType="models:ReportFile">
|
||||
<!-- <DatePicker DayFormat="ddd dd"
|
||||
SelectedDate="{Binding DateTime}"/> -->
|
||||
<Calendar SelectionMode="SingleDate"
|
||||
SelectedDate="{Binding DateTime}"
|
||||
DisplayDate="{Binding DateTime}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
Width="*"/>
|
||||
<DataGridTextColumn Header="File Name"
|
||||
Binding="{Binding FileName}"
|
||||
IsReadOnly="True"
|
||||
@@ -99,6 +85,7 @@
|
||||
Spacing="4">
|
||||
<Button Command="{Binding $parent[DataGrid].((vm:MainViewModel)DataContext).RemoveFile}"
|
||||
CommandParameter="{Binding}"
|
||||
Classes="Danger"
|
||||
Margin="2"
|
||||
IsEnabled="True">
|
||||
<Button.Content>
|
||||
|
||||
@@ -8,14 +8,22 @@
|
||||
xmlns:vm="clr-namespace:ReceiptPDFBuilder.ViewModels"
|
||||
xmlns:dialogHost="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia"
|
||||
x:DataType="vm:WarningDeleteItemModel">
|
||||
<StackPanel>
|
||||
<StackPanel HorizontalAlignment="Center"
|
||||
Margin="6"
|
||||
Spacing="8">
|
||||
<TextBlock TextAlignment="Center"
|
||||
FontWeight="Bold">Are you sure you want to remove this item?</TextBlock>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Command="{Binding KeepItem}">
|
||||
FontWeight="Bold"
|
||||
TextWrapping="Wrap"
|
||||
MaxWidth="350">Are you sure you want to remove the item "<Run Text="{Binding File.Title}"/>"?</TextBlock>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
Spacing="8">
|
||||
<Button Command="{Binding KeepItem}"
|
||||
Classes="accent">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Keep Item</TextBlock>
|
||||
</Button>
|
||||
<Button Command="{Binding RemoveItem}">
|
||||
<Button Command="{Binding RemoveItem}"
|
||||
Classes="Danger">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Remove Item</TextBlock>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
Reference in New Issue
Block a user