1
0
mirror of https://github.com/chylex/Backup-Essentials.git synced 2025-04-09 23:15:43 +02:00

Added a (currently non-functional) window for Drag&Drop

This commit is contained in:
chylex 2015-04-09 21:26:39 +02:00
parent f660b3c6df
commit 0d1ec9bd66
3 changed files with 103 additions and 0 deletions

View File

@ -90,6 +90,9 @@
<Compile Include="Pages\Backup.xaml.cs">
<DependentUpon>Backup.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\BackupDrop.xaml.cs">
<DependentUpon>BackupDrop.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\BackupEdit.xaml.cs">
<DependentUpon>BackupEdit.xaml</DependentUpon>
</Compile>
@ -138,6 +141,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\BackupDrop.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\BackupEdit.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

View File

@ -0,0 +1,75 @@
<Page x:Class="BackupEssentials.Pages.BackupDrop"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:sys="clr-namespace:System;assembly=mscorlib"
xmlns:backup="clr-namespace:BackupEssentials.Backup"
mc:Ignorable="d"
d:DesignWidth="{StaticResource PageWidth}" d:DesignHeight="{StaticResource PageHeight}" Background="{StaticResource PageBackground}"
Title="Backup">
<Page.Resources>
<sys:Double x:Key="LocationListItemHeight">46</sys:Double>
</Page.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="48"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<StackPanel.Resources>
<Style TargetType="Button">
<Setter Property="Margin" Value="8,8,0,0"/>
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Template" Value="{StaticResource ButtonStyleDefault}"/>
</Style>
</StackPanel.Resources>
<Button x:Name="ButtonBackup" Content="Backup" IsEnabled="False"/>
<Button x:Name="ButtoonCancel" Content="Cancel" Template="{StaticResource ButtonStyleRedDefault}"/>
</StackPanel>
<ListView Name="LocationsListView" Grid.Row="1" Margin="8" Style="{StaticResource ListViewStyleDefault}" SelectionChanged="ListViewSelectionChanged">
<ListView.Resources>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="Padding" Value="8,4,8,8"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver" Storyboard="{StaticResource ListViewItemStoryboardMouseOver}"/>
<VisualState x:Name="Selected" Storyboard="{StaticResource ListViewItemStoryboardSelected}"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid Width="740" Height="{StaticResource LocationListItemHeight}" SnapsToDevicePixels="True" HorizontalAlignment="Left">
<TextBlock Foreground="#FFDDDDDD" Text="{Binding Name}" VerticalAlignment="Top" FontSize="20"/>
<TextBlock Foreground="#FFCCCCCC" Text="{Binding Directory}" VerticalAlignment="Bottom" FontSize="16"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.Resources>
<ListView.Items>
<backup:BackupLocation Name="Test1" Directory="C:\Abc"/>
<backup:BackupLocation Name="Test2" Directory="C:\Abc"/>
<backup:BackupLocation Name="Test3" Directory="C:\Abc"/>
<backup:BackupLocation Name="Test4" Directory="C:\Abc"/>
<backup:BackupLocation Name="Test5" Directory="C:\Abc"/>
<backup:BackupLocation Name="Test6" Directory="C:\Abc"/>
<backup:BackupLocation Name="Test7" Directory="C:\Abc"/>
<backup:BackupLocation Name="Test8" Directory="C:\Abc"/>
</ListView.Items>
</ListView>
</Grid>
</Page>

View File

@ -0,0 +1,21 @@
using BackupEssentials.Backup;
using System.Windows.Controls;
namespace BackupEssentials.Pages{
public partial class BackupDrop : Page, IPageShowData{
public BackupDrop(){
InitializeComponent();
LocationsListView.Items.Clear();
LocationsListView.ItemsSource = DataStorage.BackupLocationList;
}
void IPageShowData.OnShow(object data){
string[] files = (string[])data;
}
private void ListViewSelectionChanged(object sender, SelectionChangedEventArgs e){
ButtonBackup.IsEnabled = LocationsListView.SelectedItems.Count == 1;
}
}
}