|
| 1 | +<UserControl x:Class="LiveWriterPluginManager.Controls.CreatePackageControl" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 5 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 6 | + xmlns:viewModel="clr-namespace:LiveWriterPluginManager.ViewModel" |
| 7 | + mc:Ignorable="d" |
| 8 | + d:DesignHeight="300" |
| 9 | + d:DesignWidth="300" |
| 10 | + DataContext="{Binding CreatePackage, Source={StaticResource Locator}}"> |
| 11 | + |
| 12 | + <UserControl.Resources> |
| 13 | + <DataTemplate DataType="{x:Type viewModel:FileViewModel}"> |
| 14 | + <Border BorderBrush="{StaticResource LiveWriterPurpleBrush}" |
| 15 | + BorderThickness="0,0,0,1" |
| 16 | + Padding="10"> |
| 17 | + <Grid> |
| 18 | + <Grid.ColumnDefinitions> |
| 19 | + <ColumnDefinition Width="*" /> |
| 20 | + <ColumnDefinition Width="Auto" /> |
| 21 | + <ColumnDefinition Width="Auto" /> |
| 22 | + </Grid.ColumnDefinitions> |
| 23 | + |
| 24 | + <TextBlock Text="{Binding Name}" |
| 25 | + VerticalAlignment="Center" /> |
| 26 | + |
| 27 | + <Button Content="This is the plugin" |
| 28 | + Grid.Column="1" |
| 29 | + Command="{Binding SetPluginFileCommand}" |
| 30 | + Margin="10,0"> |
| 31 | + <Button.Style> |
| 32 | + <Style TargetType="{x:Type Button}" |
| 33 | + BasedOn="{StaticResource {x:Type Button}}"> |
| 34 | + <!-- This would be the default visibility --> |
| 35 | + <Setter Property="Visibility" |
| 36 | + Value="Visible" /> |
| 37 | + <Style.Triggers> |
| 38 | + <DataTrigger Binding="{Binding IsPluginFile, UpdateSourceTrigger=PropertyChanged}" |
| 39 | + Value="True"> |
| 40 | + <Setter Property="Visibility" |
| 41 | + Value="Hidden" /> |
| 42 | + </DataTrigger> |
| 43 | + </Style.Triggers> |
| 44 | + </Style> |
| 45 | + </Button.Style> |
| 46 | + </Button> |
| 47 | + |
| 48 | + <Button Grid.Column="2" |
| 49 | + Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" |
| 50 | + Height="30" |
| 51 | + Width="30" |
| 52 | + Command="{Binding RemoveFileCommand}"> |
| 53 | + <Viewbox Stretch="Uniform" |
| 54 | + StretchDirection="DownOnly" |
| 55 | + Width="20" |
| 56 | + Height="20" |
| 57 | + HorizontalAlignment="Center" |
| 58 | + VerticalAlignment="Center"> |
| 59 | + <Path Height="15" |
| 60 | + Width="10" |
| 61 | + Stretch="Fill" |
| 62 | + Fill="White" |
| 63 | + Data="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z" /> |
| 64 | + </Viewbox> |
| 65 | + </Button> |
| 66 | + </Grid> |
| 67 | + </Border> |
| 68 | + </DataTemplate> |
| 69 | + </UserControl.Resources> |
| 70 | + <Border Background="Transparent" |
| 71 | + AllowDrop="True" |
| 72 | + Drop="UIElement_OnDrop"> |
| 73 | + <Grid> |
| 74 | + <Grid.RowDefinitions> |
| 75 | + <RowDefinition Height="Auto" /> |
| 76 | + <RowDefinition Height="*" /> |
| 77 | + <RowDefinition Height="Auto" /> |
| 78 | + </Grid.RowDefinitions> |
| 79 | + |
| 80 | + <StackPanel> |
| 81 | + <TextBlock Text="Please choose the files that you would like to add to your package." |
| 82 | + TextWrapping="WrapWithOverflow" |
| 83 | + Margin="10" /> |
| 84 | + <StackPanel Orientation="Horizontal"> |
| 85 | + <Button Content="Add files" |
| 86 | + HorizontalAlignment="Left" |
| 87 | + Margin="10,0,10,10" |
| 88 | + Command="{Binding AddFilesCommand}" /> |
| 89 | + <Button Content="Edit metadata" |
| 90 | + Margin="10,0,10,10" |
| 91 | + Command="{Binding EditMetadataCommand}" /> |
| 92 | + <Button Content="Open package" |
| 93 | + Margin="10,0,10,10" |
| 94 | + Command="{Binding OpenPackageCommand}" /> |
| 95 | + </StackPanel> |
| 96 | + </StackPanel> |
| 97 | + |
| 98 | + <ListView ItemsSource="{Binding Files}" |
| 99 | + Grid.Row="1" /> |
| 100 | + |
| 101 | + <Button Content="Create package" |
| 102 | + Grid.Row="2" |
| 103 | + HorizontalAlignment="Right" |
| 104 | + Margin="10" |
| 105 | + IsEnabled="{Binding IsValidPackage}" |
| 106 | + Command="{Binding CreatePackageCommand}" |
| 107 | + AllowDrop="True" |
| 108 | + Drop="UIElement_OnDrop" /> |
| 109 | + |
| 110 | + |
| 111 | + </Grid> |
| 112 | + </Border> |
| 113 | +</UserControl> |
0 commit comments