-
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.
Showing
11 changed files
with
461 additions
and
14 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,23 @@ | ||
<UserControl x:Class="Daybreak.Controls.Buttons.GWToolboxButton" | ||
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.Buttons" | ||
xmlns:glyphs="clr-namespace:Daybreak.Controls.Glyphs" | ||
x:Name="_this" | ||
mc:Ignorable="d" | ||
d:DesignHeight="450" d:DesignWidth="800"> | ||
<Grid> | ||
<local:CircularButton Foreground="{StaticResource MahApps.Brushes.ThemeForeground}" | ||
Highlight="{StaticResource MahApps.Brushes.Accent}" | ||
Clicked="HighlightButton_Clicked"> | ||
<local:CircularButton.Content> | ||
<Viewbox Stretch="Fill" Width="60" Height="60"> | ||
<glyphs:GWToolboxGlyph Foreground="{StaticResource MahApps.Brushes.ThemeForeground}" Margin="10" | ||
IsEnabled="{Binding ElementName=_this, Path=IsEnabled, Mode=OneWay}" /> | ||
</Viewbox> | ||
</local:CircularButton.Content> | ||
</local:CircularButton> | ||
</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,30 @@ | ||
using System; | ||
using System.Windows.Controls; | ||
using System.Windows.Extensions; | ||
using System.Windows.Input; | ||
|
||
namespace Daybreak.Controls.Buttons; | ||
/// <summary> | ||
/// Interaction logic for GWToolboxButton.xaml | ||
/// </summary> | ||
public partial class GWToolboxButton : UserControl | ||
{ | ||
public event EventHandler? Clicked; | ||
|
||
[GenerateDependencyProperty] | ||
private ICommand click = default!; | ||
|
||
public GWToolboxButton() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void HighlightButton_Clicked(object sender, EventArgs e) | ||
{ | ||
this.Clicked?.Invoke(this, e); | ||
if (this.Click?.CanExecute(e) is true) | ||
{ | ||
this.Click?.Execute(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
Oops, something went wrong.