mirror of
https://github.com/ckaczor/Common.Wpf.git
synced 2026-01-19 17:23:28 -05:00
Initial commit
This commit is contained in:
12
LinkControl/LinkControl.xaml
Normal file
12
LinkControl/LinkControl.xaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<UserControl x:Class="Common.Wpf.LinkControl.LinkControl"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300"
|
||||
d:DesignWidth="300">
|
||||
<Hyperlink Name="HyperlinkControl">
|
||||
<TextBlock Name="ContentControl" />
|
||||
</Hyperlink>
|
||||
</UserControl>
|
||||
38
LinkControl/LinkControl.xaml.cs
Normal file
38
LinkControl/LinkControl.xaml.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace Common.Wpf.LinkControl
|
||||
{
|
||||
public partial class LinkControl
|
||||
{
|
||||
public event RoutedEventHandler Click;
|
||||
|
||||
public LinkControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
HyperlinkControl.Click += HandleHyperlinkControlClick;
|
||||
}
|
||||
|
||||
private void HandleHyperlinkControlClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (Click != null)
|
||||
Click.Invoke(sender, e);
|
||||
}
|
||||
|
||||
public string Text
|
||||
{
|
||||
get { return ContentControl.Text; }
|
||||
set { ContentControl.Text = value; }
|
||||
}
|
||||
|
||||
public new bool IsEnabled
|
||||
{
|
||||
get { return base.IsEnabled; }
|
||||
set
|
||||
{
|
||||
base.IsEnabled = value;
|
||||
HyperlinkControl.IsEnabled = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user