-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathScriptLibraryPage.xaml
More file actions
83 lines (76 loc) · 5.13 KB
/
ScriptLibraryPage.xaml
File metadata and controls
83 lines (76 loc) · 5.13 KB
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
<Page
x:Class="FluentTaskScheduler.ScriptLibraryPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodels="using:FluentTaskScheduler.ViewModels"
mc:Ignorable="d"
Background="Transparent"
Loaded="Page_Loaded">
<Grid>
<ScrollViewer x:Name="PageScrollViewer" Padding="24" IsScrollInertiaEnabled="False">
<StackPanel Spacing="16">
<!-- Header row -->
<StackPanel Orientation="Horizontal" Spacing="12">
<TextBlock x:Name="ScriptLibraryTitle" x:Uid="ScriptLibraryTitle" Style="{StaticResource SubtitleTextBlockStyle}" VerticalAlignment="Center"/>
<Button x:Name="CreateTemplateButton" x:Uid="ScriptLibraryCreateBtn" Click="CreateTemplateButton_Click"/>
</StackPanel>
<!-- Template cards grid -->
<GridView ItemsSource="{x:Bind ViewModel.Scripts}" SelectionMode="None">
<GridView.ItemTemplate>
<DataTemplate x:DataType="viewmodels:ScriptTemplateModel">
<Grid Width="300" Height="180" Background="{ThemeResource CardBackgroundFillColorDefaultBrush}" CornerRadius="8" Padding="16" BorderThickness="1" BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" Margin="0,0,12,12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8">
<FontIcon Glyph="" FontSize="16" Opacity="0.7"/>
<TextBlock Text="{x:Bind Name}" Style="{StaticResource BodyStrongTextBlockStyle}" TextTrimming="CharacterEllipsis"/>
</StackPanel>
<Rectangle Height="1" Fill="{ThemeResource DividerStrokeColorDefaultBrush}" Margin="0,8"/>
</StackPanel>
<!-- Delete button — only visible for user templates -->
<Button Grid.Column="1"
Visibility="{x:Bind DeleteVisibility}"
Click="DeleteTemplateButton_Click"
Tag="{x:Bind}"
Background="Transparent"
BorderThickness="0"
Padding="4"
VerticalAlignment="Top"
x:Uid="ScriptLibraryDeleteBtn">
<FontIcon Glyph="" FontSize="12" Foreground="{ThemeResource SystemFillColorCriticalBrush}"/>
</Button>
</Grid>
<TextBlock Grid.Row="1" Text="{x:Bind Description}" TextWrapping="Wrap" Style="{StaticResource CaptionTextBlockStyle}" Opacity="0.7"/>
<Button Grid.Row="2" x:Uid="ScriptLibraryUseTemplateBtn" HorizontalAlignment="Stretch" Click="ScheduleButton_Click" Tag="{x:Bind}"/>
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
</StackPanel>
</ScrollViewer>
<!-- Create Template Dialog -->
<ContentDialog x:Name="CreateTemplateDialog"
x:Uid="ScriptLibraryNewTemplateDialog"
DefaultButton="Primary"
PrimaryButtonClick="CreateTemplateDialog_PrimaryButtonClick">
<StackPanel Spacing="12" MinWidth="400">
<TextBox x:Name="TemplateName" x:Uid="ScriptLibraryNameHeader"/>
<TextBox x:Name="TemplateDesc" x:Uid="ScriptLibraryDescHeader" TextWrapping="Wrap" AcceptsReturn="True" Height="72"/>
<TextBox x:Name="TemplateCommand" x:Uid="ScriptLibraryCommandHeader"/>
<TextBox x:Name="TemplateArgs" x:Uid="ScriptLibraryArgsHeader"/>
<CheckBox x:Name="TemplateAdmin" x:Uid="ScriptLibraryAdminContent"/>
</StackPanel>
</ContentDialog>
</Grid>
</Page>