mirror of
https://github.com/ckaczor/ChrisKaczor.Wpf.Controls.Link.git
synced 2026-01-17 17:23:01 -05:00
Initial commit
This commit is contained in:
37
LinkControl.xaml.cs
Normal file
37
LinkControl.xaml.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace ChrisKaczor.Wpf.Controls
|
||||
{
|
||||
public partial class Link
|
||||
{
|
||||
public event RoutedEventHandler? Click;
|
||||
|
||||
public Link()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
HyperlinkControl.Click += HandleHyperlinkControlClick;
|
||||
}
|
||||
|
||||
private void HandleHyperlinkControlClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Click?.Invoke(sender, e);
|
||||
}
|
||||
|
||||
public string Text
|
||||
{
|
||||
get => ContentControl.Text;
|
||||
set => ContentControl.Text = value;
|
||||
}
|
||||
|
||||
public new bool IsEnabled
|
||||
{
|
||||
get => base.IsEnabled;
|
||||
set
|
||||
{
|
||||
base.IsEnabled = value;
|
||||
HyperlinkControl.IsEnabled = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user