-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexandru Macocian
committed
Apr 8, 2021
1 parent
1f3cd9d
commit eb5552b
Showing
8 changed files
with
177 additions
and
16 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<UserControl x:Class="Daybreak.Controls.MaximizeButton" | ||
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:local="clr-namespace:Daybreak.Controls" | ||
x:Name="_this" | ||
mc:Ignorable="d" | ||
d:DesignHeight="50" d:DesignWidth="50"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="0.3*" /> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="0.3*" /> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="0.3*" /> | ||
<RowDefinition Height="1*" /> | ||
<RowDefinition Height="0.3*" /> | ||
</Grid.RowDefinitions> | ||
<Ellipse x:Name="BackgroundEllipse" Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}" | ||
Opacity="0.6" Visibility="Hidden" Grid.RowSpan="3" Grid.ColumnSpan="3"></Ellipse> | ||
<Viewbox Grid.Row="1" Grid.Column="1"> | ||
<Grid> | ||
<Path Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}" | ||
Data="m30,0l-24,0a5.9966,5.9966 0 0 0 -6,6l0,24a6,6 0 0 0 12,0l0,-18l18,0a6,6 0 0 0 0,-12z"></Path> | ||
<Path Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}" | ||
Data="m90,0l-24,0a6,6 0 0 0 0,12l18,0l0,18a6,6 0 0 0 12,0l0,-24a5.9966,5.9966 0 0 0 -6,-6z"></Path> | ||
<Path Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}" | ||
Data="m30,84l-18,0l0,-18a6,6 0 0 0 -12,0l0,24a5.9966,5.9966 0 0 0 6,6l24,0a6,6 0 0 0 0,-12z"></Path> | ||
<Path Fill="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}" | ||
Data="m90,60a5.9966,5.9966 0 0 0 -6,6l0,18l-18,0a6,6 0 0 0 0,12l24,0a5.9966,5.9966 0 0 0 6,-6l0,-24a5.9966,5.9966 0 0 0 -6,-6z"></Path> | ||
</Grid> | ||
</Viewbox> | ||
<Ellipse Stroke="{Binding ElementName=_this, Path=Foreground, Mode=OneWay}" StrokeThickness="1" Fill="Transparent" | ||
MouseEnter="Ellipse_MouseEnter" MouseLeave="Ellipse_MouseLeave" MouseLeftButtonDown="Ellipse_MouseLeftButtonDown" | ||
Grid.RowSpan="3" Grid.ColumnSpan="3"></Ellipse> | ||
</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,37 @@ | ||
using System; | ||
using System.Windows.Controls; | ||
using System.Windows.Input; | ||
|
||
namespace Daybreak.Controls | ||
{ | ||
/// <summary> | ||
/// Interaction logic for SaveButton.xaml | ||
/// </summary> | ||
public partial class MaximizeButton : UserControl | ||
{ | ||
public event EventHandler Clicked; | ||
|
||
public MaximizeButton() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void Ellipse_MouseEnter(object sender, MouseEventArgs e) | ||
{ | ||
BackgroundEllipse.Visibility = System.Windows.Visibility.Visible; | ||
} | ||
|
||
private void Ellipse_MouseLeave(object sender, MouseEventArgs e) | ||
{ | ||
BackgroundEllipse.Visibility = System.Windows.Visibility.Hidden; | ||
} | ||
|
||
private void Ellipse_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) | ||
{ | ||
if (e.ChangedButton == MouseButton.Left) | ||
{ | ||
Clicked?.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
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