-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Top Buttons into own User Control
- Loading branch information
Showing
4 changed files
with
143 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<UserControl x:Class="NotEnoughAV1Encodes.Controls.MainWindowTopButtons" | ||
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:lex="http://wpflocalizeextension.codeplex.com" | ||
mc:Ignorable="d" | ||
d:DesignHeight="65" d:DesignWidth="1085"> | ||
<Grid> | ||
<Button x:Name="ButtonOpenSource" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="130" Height="45" Background="{Binding Path=Background}" Click="ButtonOpenSource_Click"> | ||
<Canvas Height="30" Width="114"> | ||
<Image Height="44" Canvas.Left="-6" Canvas.Top="-7" Width="45" Source="/resources/img/video.png"/> | ||
<Label x:Name="LabelSource" Content="{lex:Loc}" Canvas.Left="38" Width="76" Height="30" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="14"/> | ||
</Canvas> | ||
</Button> | ||
<Button x:Name="ButtonSetDestination" HorizontalAlignment="Left" Margin="145,10,0,0" VerticalAlignment="Top" Width="130" Height="45" Background="{Binding Path=Background}" Click="ButtonSetDestination_Click"> | ||
<Canvas Height="30" Width="120"> | ||
<Image Height="44" Canvas.Left="-6" Canvas.Top="-7" Width="45" Source="/resources/img/save.png"/> | ||
<Label x:Name="LabelDestination" Content="{lex:Loc}" Canvas.Left="32" Width="88" Height="30" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="14"/> | ||
</Canvas> | ||
</Button> | ||
<Button x:Name="ButtonAddToQueue" Margin="280,10,0,0" VerticalAlignment="Top" Height="45" HorizontalAlignment="Left" Width="180" Background="{Binding Path=Background}" Click="ButtonAddToQueue_Click"> | ||
<Canvas Height="30" Width="120"> | ||
<Image x:Name="ImageStartStop2" Height="44" Canvas.Left="-23" Canvas.Top="-7" Width="44" Source="/resources/img/queue.png"/> | ||
<Label x:Name="LabelAddToQueue" Content="{lex:Loc}" Canvas.Left="26" Width="122" Height="30" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="14"/> | ||
</Canvas> | ||
</Button> | ||
<Button x:Name="ButtonStartStop" Margin="0,10,189,0" VerticalAlignment="Top" Height="45" HorizontalAlignment="Right" Width="118" Background="{Binding Path=Background}" Click="ButtonStartStop_Click"> | ||
<Canvas Height="30" Width="120"> | ||
<Image x:Name="ImageStartStop" Height="44" Canvas.Left="-6" Canvas.Top="-7" Width="45" Source="/resources/img/start.png"/> | ||
<Label x:Name="LabelStartPauseButton" Content="{lex:Loc}" Canvas.Left="32" Width="78" Height="30" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="14"/> | ||
</Canvas> | ||
</Button> | ||
<Button x:Name="ButtonProgramSettings" Margin="0,10,10,0" VerticalAlignment="Top" Height="45" HorizontalAlignment="Right" Width="45" Background="{Binding Path=Background}" Click="ButtonProgramSettings_Click"> | ||
<Canvas Height="30" Width="120"> | ||
<Image x:Name="ImageStartStop1" Height="44" Canvas.Left="-6" Canvas.Top="-7" Width="45" Source="/resources/img/settings.png"/> | ||
</Canvas> | ||
</Button> | ||
<Button x:Name="ButtonCancelEncode" Margin="0,10,60,0" VerticalAlignment="Top" Height="45" HorizontalAlignment="Right" Width="124" Background="{Binding Path=Background}" Click="ButtonCancelEncode_Click"> | ||
<Canvas Height="30" Width="102"> | ||
<Label x:Name="LabelCancel" Content="{lex:Loc}" Canvas.Left="30" Width="81" Height="30" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="14"/> | ||
<Image Height="44" Canvas.Left="-10" Canvas.Top="-7" Width="44" Source="/resources/img/stop.png"/> | ||
</Canvas> | ||
</Button> | ||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Media; | ||
|
||
namespace NotEnoughAV1Encodes.Controls | ||
{ | ||
public partial class MainWindowTopButtons : UserControl | ||
{ | ||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
// Button Event Handlers | ||
public event EventHandler OpenSource; | ||
public event EventHandler SetDestination; | ||
public event EventHandler AddToQueue; | ||
public event EventHandler OpenSettings; | ||
public event EventHandler Start; | ||
public event EventHandler Cancel; | ||
|
||
// Background for Buttons | ||
public new SolidColorBrush Background { get; set; } | ||
|
||
public MainWindowTopButtons() | ||
{ | ||
InitializeComponent(); | ||
DataContext = this; | ||
} | ||
|
||
private void ButtonOpenSource_Click(object sender, RoutedEventArgs e) | ||
{ | ||
OpenSource?.Invoke(this, e); | ||
} | ||
|
||
private void ButtonSetDestination_Click(object sender, RoutedEventArgs e) | ||
{ | ||
SetDestination?.Invoke(this, e); | ||
} | ||
|
||
private void ButtonAddToQueue_Click(object sender, RoutedEventArgs e) | ||
{ | ||
AddToQueue?.Invoke(this, e); | ||
} | ||
|
||
private void ButtonProgramSettings_Click(object sender, RoutedEventArgs e) | ||
{ | ||
OpenSettings?.Invoke(this, e); | ||
} | ||
|
||
private void ButtonStartStop_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Start?.Invoke(this, e); | ||
} | ||
|
||
private void ButtonCancelEncode_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Cancel?.Invoke(this, e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters