mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 09:06:04 +02:00
31 lines
847 B
C#
31 lines
847 B
C#
using System.Windows;
|
|
|
|
namespace CodeSampleCsharp
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for MainWindow.xaml.
|
|
/// </summary>
|
|
public partial class MainWindow : Window
|
|
{
|
|
public MainWindow() => InitializeComponent();
|
|
}
|
|
|
|
// <DefineDependencyProperty>
|
|
public class Aquarium : DependencyObject
|
|
{
|
|
public static readonly DependencyProperty HasFishProperty =
|
|
DependencyProperty.Register(
|
|
name: "HasFish",
|
|
propertyType: typeof(bool),
|
|
ownerType: typeof(Aquarium),
|
|
typeMetadata: new FrameworkPropertyMetadata(defaultValue: false));
|
|
|
|
public bool HasFish
|
|
{
|
|
get => (bool)GetValue(HasFishProperty);
|
|
set => SetValue(HasFishProperty, value);
|
|
}
|
|
}
|
|
// </DefineDependencyProperty>
|
|
}
|