1
0
mirror of https://github.com/chylex/Backup-Essentials.git synced 2025-07-30 00:59:08 +02:00

Initial commit - basic window and main menu design

This commit is contained in:
chylex 2015-04-03 01:48:26 +02:00
parent 118e3d9bb7
commit b273ca0f8d
16 changed files with 1968 additions and 0 deletions

22
BackupEssentials.sln Normal file
View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackupEssentials", "BackupEssentials\BackupEssentials.csproj", "{AC2547A3-2ED8-4B76-88D7-5C72AE840EE2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AC2547A3-2ED8-4B76-88D7-5C72AE840EE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC2547A3-2ED8-4B76-88D7-5C72AE840EE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC2547A3-2ED8-4B76-88D7-5C72AE840EE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC2547A3-2ED8-4B76-88D7-5C72AE840EE2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

13
BackupEssentials/App.xaml Normal file
View File

@ -0,0 +1,13 @@
<Application x:Class="BackupEssentials.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Startup="StartApp"
DispatcherUnhandledException="HandleException">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Simple Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@ -0,0 +1,16 @@
using System.Windows;
using System.Windows.Threading;
namespace BackupEssentials{
public partial class App : Application{
private void StartApp(object sender, StartupEventArgs args){
MainWindow window = new MainWindow();
// TODO handle args
window.Show();
}
private void HandleException(object sender, DispatcherUnhandledExceptionEventArgs e){
// TODO
}
}
}

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AC2547A3-2ED8-4B76-88D7-5C72AE840EE2}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BackupEssentials</RootNamespace>
<AssemblyName>BackupEssentials</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<ExpressionBlendVersion>12.0.51020.0</ExpressionBlendVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationFramework.Aero" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Controls\ButtonMainMenu.cs" />
<Compile Include="TestingWindow.xaml.cs">
<DependentUpon>TestingWindow.xaml</DependentUpon>
</Compile>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Controls\ButtonTitleBar.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Simple Styles.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="TestingWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Folder Include="Fonts\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Expression\Blend\.NETFramework\v4.5\Microsoft.Expression.Blend.WPF.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,24 @@
using System;
using System.Windows;
using System.Windows.Controls;
namespace BackupEssentials.Controls{
public class ButtonMainMenu:Button{
private bool IsCheckedVar;
public bool IsChecked {
get { return IsCheckedVar; }
set { IsCheckedVar = value; VisualStateManager.GoToState(this,IsCheckedVar ? "Pressed" : "Normal",true); }
}
public ButtonMainMenu(){
MouseEnter += ResetCheckedState;
MouseLeave += ResetCheckedState;
SizeChanged += ResetCheckedState;
}
private void ResetCheckedState(object sender, EventArgs args){
if (IsChecked)VisualStateManager.GoToState(this,"Pressed",false);
}
}
}

View File

@ -0,0 +1,37 @@
using System.Windows;
using System.Windows.Controls;
namespace BackupEssentials.Controls{
public class ButtonTitleBar:Button{
public static DependencyProperty PathDataProperty = DependencyProperty.Register("CXPathData",typeof(string),typeof(ButtonTitleBar));
public static DependencyProperty PathWidthProperty = DependencyProperty.Register("CXPathWidth",typeof(string),typeof(ButtonTitleBar));
public static DependencyProperty PathHeightProperty = DependencyProperty.Register("CXPathHeight",typeof(string),typeof(ButtonTitleBar));
public static DependencyProperty PathMarginProperty = DependencyProperty.Register("CXPathMargin",typeof(string),typeof(ButtonTitleBar));
public static DependencyProperty PathRotationProperty = DependencyProperty.Register("CXPathRotation",typeof(string),typeof(ButtonTitleBar));
public string CXPathData{
get { return (string)base.GetValue(PathDataProperty); }
set { base.SetValue(PathDataProperty,(string)value); }
}
public string CXPathWidth{
get { return (string)base.GetValue(PathWidthProperty); }
set { base.SetValue(PathWidthProperty,(string)value); }
}
public string CXPathHeight{
get { return (string)base.GetValue(PathHeightProperty); }
set { base.SetValue(PathHeightProperty,(string)value); }
}
public string CXPathMargin{
get { return (string)base.GetValue(PathMarginProperty); }
set { base.SetValue(PathMarginProperty,(string)value); }
}
public string CXPathRotation{
get { return (string)base.GetValue(PathRotationProperty); }
set { base.SetValue(PathRotationProperty,(string)value); }
}
}
}

View File

@ -0,0 +1,246 @@
<Window
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:sys="clr-namespace:System;assembly=mscorlib"
xmlns:custom="clr-namespace:BackupEssentials.Controls"
xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
mc:Ignorable="d" x:Class="BackupEssentials.MainWindow"
Title="Backup" Height="600" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="None" ResizeMode="CanResizeWithGrip" Background="#FF000000" AllowsTransparency="True" MinWidth="540" MinHeight="240">
<Window.Resources>
<sys:String x:Key="PathButtonClose">M7,0 L9,0 9,7 16,7 16,9 9,9 9,16 7,16 7,9 0,9 0,7 7,7 z</sys:String>
<sys:String x:Key="PathButtonMaximized">M1,2 L1,9 13,9 13,2 z M0,0 L14,0 14,10 0,10 z</sys:String>
<sys:String x:Key="PathButtonWindowed">M2.5,3.75 L2.5,8.75 10.5,8.75 10.5,3.75 z M1.5,1.75 L11.5,1.75 11.5,9.75 1.5,9.75 z M0,0 L10,0 10,1.25 1,1.25 1,2 1,7 1,8 0,8 z</sys:String>
<sys:String x:Key="PathButtonMinimize">M0,0 L20,0 L20,3 L0,3 z</sys:String>
</Window.Resources>
<Grid Background="#FF2E2E2E">
<Grid.RowDefinitions>
<RowDefinition Height="36"/>
<RowDefinition Height="2"/>
<RowDefinition Height="60"/>
<RowDefinition Height="2"/>
<RowDefinition Height="*"/>
<RowDefinition Height="2"/>
<RowDefinition Height="16"/>
</Grid.RowDefinitions>
<DockPanel x:Name="TitleBar" LastChildFill="False" VerticalAlignment="Top" Width="Auto" Height="36" MouseLeftButtonDown="TitleBarLeftButtonDown">
<DockPanel.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF171717" Offset="0"/>
<GradientStop Color="#FF1D1D1D" Offset="1"/>
</LinearGradientBrush>
</DockPanel.Background>
<WrapPanel Height="36" VerticalAlignment="Top" Width="120" Orientation="Horizontal" DockPanel.Dock="Top" HorizontalAlignment="Right" FlowDirection="RightToLeft">
<WrapPanel.Resources>
<Style x:Key="ButtonStyleTitleBar" TargetType="{x:Type Button}">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Width" Value="36"/>
<Setter Property="Height" Value="36"/>
<Setter Property="Padding" Value="3"/>
<Setter Property="RenderOptions.EdgeMode" Value="Aliased"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid HorizontalAlignment="Left" Height="36" VerticalAlignment="Top" Width="36">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver">
<Storyboard>
<PointAnimation Duration="0:0:0.12" To="36,0" Storyboard.TargetProperty="(UIElement.Clip).(PathGeometry.Figures)[0].(PathFigure.Segments)[1].(LineSegment.Point)" Storyboard.TargetName="GridHover"/>
<PointAnimation Duration="0:0:0.12" To="0,36" Storyboard.TargetProperty="(UIElement.Clip).(PathGeometry.Figures)[0].(PathFigure.StartPoint)" Storyboard.TargetName="GridHover"/>
<PointAnimation Duration="0:0:0.12" To="36,36" Storyboard.TargetProperty="(UIElement.Clip).(PathGeometry.Figures)[0].(PathFigure.Segments)[0].(LineSegment.Point)" Storyboard.TargetName="GridHover"/>
<PointAnimation Duration="0:0:0.12" To="0,0" Storyboard.TargetProperty="(UIElement.Clip).(PathGeometry.Figures)[0].(PathFigure.Segments)[2].(LineSegment.Point)" Storyboard.TargetName="GridHover"/>
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Clip).(PathGeometry.Figures)[0].(PathFigure.StartPoint)" Storyboard.TargetName="GridHover">
<EasingPointKeyFrame KeyTime="0" Value="0,36"/>
</PointAnimationUsingKeyFrames>
<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Clip).(PathGeometry.Figures)[0].(PathFigure.Segments)[0].(LineSegment.Point)" Storyboard.TargetName="GridHover">
<EasingPointKeyFrame KeyTime="0" Value="36,36"/>
</PointAnimationUsingKeyFrames>
<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Clip).(PathGeometry.Figures)[0].(PathFigure.Segments)[1].(LineSegment.Point)" Storyboard.TargetName="GridHover">
<EasingPointKeyFrame KeyTime="0" Value="36,0"/>
</PointAnimationUsingKeyFrames>
<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Clip).(PathGeometry.Figures)[0].(PathFigure.Segments)[2].(LineSegment.Point)" Storyboard.TargetName="GridHover">
<EasingPointKeyFrame KeyTime="0" Value="0,0"/>
</PointAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed"/>
<VisualState x:Name="Disabled"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="CollisionBackground" Fill="#FFFFFFFF" HorizontalAlignment="Stretch" Height="36" VerticalAlignment="Stretch" Width="36" Visibility="Visible" Opacity="0"/>
<Grid x:Name="GridDefault">
<Rectangle x:Name="ButtonBackground" Fill="#FFC3C3C3" HorizontalAlignment="Stretch" Height="0" VerticalAlignment="Bottom" Width="36" Visibility="Visible" StrokeThickness="0"/>
<Path x:Name="ButtonForeground" Fill="#FFC3C3C3" HorizontalAlignment="Center" VerticalAlignment="Center" Width="{Binding CXPathWidth, RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding CXPathHeight, RelativeSource={RelativeSource TemplatedParent}}" Margin="{Binding CXPathMargin, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="0" Data="{Binding CXPathData, RelativeSource={RelativeSource TemplatedParent}}" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
<Path.RenderTransform>
<TransformGroup>
<RotateTransform Angle="{Binding CXPathRotation, RelativeSource={RelativeSource TemplatedParent}}"/>
</TransformGroup>
</Path.RenderTransform>
</Path>
</Grid>
<Grid x:Name="GridHover">
<Grid.Clip>
<PathGeometry>
<PathFigure IsClosed="True" StartPoint="0,36">
<LineSegment Point="36,36"/>
<LineSegment Point="36,36"/>
<LineSegment Point="0,36"/>
</PathFigure>
</PathGeometry>
</Grid.Clip>
<Rectangle x:Name="ButtonBackgroundHover" HorizontalAlignment="Stretch" Height="36" VerticalAlignment="Bottom" Width="36" Visibility="Visible" StrokeThickness="0">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF2C2C2C" Offset="0"/>
<GradientStop Color="#FF252525" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Path x:Name="ButtonForegroundHover" Fill="#FF38B6FD" HorizontalAlignment="Center" VerticalAlignment="Center" Width="{Binding CXPathWidth, RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding CXPathHeight, RelativeSource={RelativeSource TemplatedParent}}" Margin="{Binding CXPathMargin, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="0" Data="{Binding CXPathData, RelativeSource={RelativeSource TemplatedParent}}" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Stroke="{x:Null}">
<Path.RenderTransform>
<TransformGroup>
<RotateTransform Angle="{Binding CXPathRotation, RelativeSource={RelativeSource TemplatedParent}}"/>
</TransformGroup>
</Path.RenderTransform>
</Path>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="true"/>
<Trigger Property="ToggleButton.IsChecked" Value="true"/>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="#ADADAD"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</WrapPanel.Resources>
<custom:ButtonTitleBar x:Name="ButtonWindowClose" CXPathData="{StaticResource PathButtonClose}" CXPathWidth="16" CXPathHeight="16" CXPathMargin="0,2,0,0" CXPathRotation="-45" HorizontalContentAlignment="Center" Style="{DynamicResource ButtonStyleTitleBar}" Click="ButtonWindowCloseClick"/>
<custom:ButtonTitleBar x:Name="ButtonWindowToggle" CXPathData="{StaticResource PathButtonMaximized}" CXPathWidth="14" CXPathHeight="14" CXPathMargin="0,3,0,0" HorizontalContentAlignment="Center" Style="{DynamicResource ButtonStyleTitleBar}" Click="ButtonWindowToggleClick"/>
<custom:ButtonTitleBar x:Name="ButtonWindowMinimize" CXPathData="{StaticResource PathButtonMinimize}" CXPathWidth="12" CXPathHeight="2" CXPathMargin="0,12,0,0" HorizontalContentAlignment="Center" Style="{DynamicResource ButtonStyleTitleBar}" Click="ButtonWindowMinimizeClick"/>
</WrapPanel>
</DockPanel>
<Rectangle StrokeThickness="0" VerticalAlignment="Center" Grid.Row="1" Height="2">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF060606" Offset="0"/>
<GradientStop Color="#FF6C6C6C" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle StrokeThickness="0" VerticalAlignment="Center" Grid.Row="3" Height="1">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF6C6C6C" Offset="0"/>
<GradientStop Color="#FF060606" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Grid Height="60" Margin="0" Grid.Row="2" VerticalAlignment="Top" Background="#FF1D1D1D">
<Grid.Resources>
<Style x:Key="ButtonStyleMainMenu" TargetType="{x:Type Button}">
<Setter Property="Foreground" Value="#FFFFFFFF"/>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FFAEAEAE" Offset="0"/>
<GradientStop Color="#FF666666" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ButtonBase}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition From="Normal" GeneratedDuration="0:0:0.15" To="MouseOver"/>
<VisualTransition From="MouseOver" GeneratedDuration="0:0:0.05" To="Pressed"/>
<VisualTransition From="Pressed" GeneratedDuration="0:0:0.1" To="Normal"/>
<VisualTransition From="MouseOver" GeneratedDuration="0:0:0.1" To="Normal"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="GridBackground">
<EasingColorKeyFrame KeyTime="0" Value="#FF3C3C3C"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="GridBackground">
<EasingColorKeyFrame KeyTime="0" Value="#FF4B4B4B"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="label">
<EasingColorKeyFrame KeyTime="0" Value="#FFAEAEAE"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="GridBackground">
<EasingColorKeyFrame KeyTime="0" Value="#D842B9F0"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="GridBackground">
<EasingColorKeyFrame KeyTime="0" Value="#D81D6C8F"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="label">
<EasingColorKeyFrame KeyTime="0" Value="#FFDADADA"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="GridBackground" Height="Auto" Width="Auto">
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF42B9F0"/>
<GradientStop Color="#FF1D6C8F" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<Label x:Name="label" Content="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="24" FontWeight="Bold" FontFamily="Segoe UI">
<Label.Effect>
<DropShadowEffect BlurRadius="2" Direction="270" ShadowDepth="0.5" Color="#FF072B3C"/>
</Label.Effect>
</Label>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="ToggleButton.IsChecked" Value="True"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<custom:ButtonMainMenu Content="Home" Click="ButtonMainMenuClick" Style="{DynamicResource ButtonStyleMainMenu}"/>
<custom:ButtonMainMenu Content="Backup" Click="ButtonMainMenuClick" Grid.Column="2" Style="{DynamicResource ButtonStyleMainMenu}"/>
<custom:ButtonMainMenu Content="History" Click="ButtonMainMenuClick" Grid.Column="4" Style="{DynamicResource ButtonStyleMainMenu}"/>
<custom:ButtonMainMenu Content="Settings" Click="ButtonMainMenuClick" Grid.Column="6" Style="{DynamicResource ButtonStyleMainMenu}"/>
<custom:ButtonMainMenu Content="About" Click="ButtonMainMenuClick" Grid.Column="8" Style="{DynamicResource ButtonStyleMainMenu}"/>
</Grid>
</Grid>
</Window>

View File

@ -0,0 +1,72 @@
using BackupEssentials.Controls;
using System;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
namespace BackupEssentials{
public partial class MainWindow : Window{
private new Rect RestoreBounds = new Rect();
private bool IsMaximized = false;
public MainWindow(){
InitializeComponent();
}
private void ButtonWindowCloseClick(object sender, RoutedEventArgs e){
Close();
}
private void ButtonWindowToggleClick(object sender, RoutedEventArgs e){
if (IsMaximized){
Left = RestoreBounds.X;
Top = RestoreBounds.Y;
Width = RestoreBounds.Width;
Height = RestoreBounds.Height;
ResizeMode = ResizeMode.CanResizeWithGrip;
IsMaximized = false;
ButtonWindowToggle.CXPathData = (string)FindResource("PathButtonMaximized");
}
else{
RestoreBounds.X = Left;
RestoreBounds.Y = Top;
RestoreBounds.Width = Width;
RestoreBounds.Height = Height;
Screen screen = Screen.FromPoint(new System.Drawing.Point((int)Math.Round(Left+Width/2),(int)Math.Round(Top+Height/2)));
Left = screen.WorkingArea.X;
Top = screen.WorkingArea.Y;
Width = screen.WorkingArea.Width;
Height = screen.WorkingArea.Height;
ResizeMode = ResizeMode.CanResize;
IsMaximized = true;
ButtonWindowToggle.CXPathData = (string)FindResource("PathButtonWindowed");
}
VisualStateManager.GoToState(ButtonWindowToggle,"Normal",false);
}
private void ButtonWindowMinimizeClick(object sender, RoutedEventArgs e){
WindowState = WindowState.Minimized;
}
private void TitleBarLeftButtonDown(object sender, MouseButtonEventArgs e){
if (e.ClickCount == 2)ButtonWindowToggleClick(sender,e);
else if (!IsMaximized)DragMove();
}
private void ButtonMainMenuClick(object sender, RoutedEventArgs e){
ButtonMainMenu btn = (ButtonMainMenu)sender;
for(int child = 0; child < VisualTreeHelper.GetChildrenCount(btn.Parent); child++){
ButtonMainMenu childBtn = VisualTreeHelper.GetChild(btn.Parent,child) as ButtonMainMenu;
if (childBtn != null)childBtn.IsChecked = false;
}
btn.IsChecked = true;
}
}
}

View File

@ -0,0 +1,59 @@
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Backup Essentials")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Backup Essentials")]
[assembly: AssemblyCopyright("Copyright © chylex 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: CLSCompliant(true)]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View File

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BackupEssentials.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BackupEssentials.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BackupEssentials.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
<Window
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" mc:Ignorable="d" x:Class="BackupEssentials.TestingWindow"
xmlns:custom="clr-namespace:BackupEssentials.Controls"
Title="Backup" Height="480" Width="640" WindowStartupLocation="CenterScreen" WindowStyle="None" ResizeMode="CanResizeWithGrip" Background="#FF2E2E2E" AllowsTransparency="True">
<Grid>
</Grid>
</Window>

View File

@ -0,0 +1,9 @@
using System.Windows;
namespace BackupEssentials{
public partial class TestingWindow : Window{
public TestingWindow(){
InitializeComponent();
}
}
}