-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add avalonia RadioButton demo.
- Loading branch information
Showing
13 changed files
with
792 additions
and
21 deletions.
There are no files selected for viewing
344 changes: 344 additions & 0 deletions
344
src/Avalonia/HandyControlDemo_Avalonia/UserControl/Styles/RadioButtonDemoCtl.axaml
Large diffs are not rendered by default.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
src/Avalonia/HandyControlDemo_Avalonia/UserControl/Styles/RadioButtonDemoCtl.axaml.cs
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,10 @@ | ||
namespace HandyControlDemo.UserControl; | ||
|
||
public partial class RadioButtonDemoCtl : Avalonia.Controls.UserControl | ||
{ | ||
public RadioButtonDemoCtl() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
|
50 changes: 50 additions & 0 deletions
50
src/Avalonia/HandyControl_Avalonia/Controls/Attach/VisualElement.cs
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,50 @@ | ||
using Avalonia; | ||
using Avalonia.Media; | ||
|
||
namespace HandyControl.Controls; | ||
|
||
public class VisualElement | ||
{ | ||
public static readonly AttachedProperty<IBrush> HighlightBrushProperty = | ||
AvaloniaProperty.RegisterAttached<VisualElement, AvaloniaObject, IBrush>("HighlightBrush", inherits: true); | ||
|
||
public static void SetHighlightBrush(AvaloniaObject element, IBrush value) => | ||
element.SetValue(HighlightBrushProperty, value); | ||
|
||
public static IBrush GetHighlightBrush(AvaloniaObject element) => element.GetValue(HighlightBrushProperty); | ||
|
||
public static readonly AttachedProperty<IBrush> HighlightBackgroundProperty = | ||
AvaloniaProperty.RegisterAttached<VisualElement, AvaloniaObject, IBrush>("HighlightBackground", inherits: true); | ||
|
||
public static void SetHighlightBackground(AvaloniaObject element, IBrush value) => | ||
element.SetValue(HighlightBackgroundProperty, value); | ||
|
||
public static IBrush GetHighlightBackground(AvaloniaObject element) => | ||
element.GetValue(HighlightBackgroundProperty); | ||
|
||
public static readonly AttachedProperty<IBrush> HighlightBorderBrushProperty = | ||
AvaloniaProperty.RegisterAttached<VisualElement, AvaloniaObject, IBrush>("HighlightBorderBrush", | ||
inherits: true); | ||
|
||
public static void SetHighlightBorderBrush(AvaloniaObject element, IBrush value) => | ||
element.SetValue(HighlightBorderBrushProperty, value); | ||
|
||
public static IBrush GetHighlightBorderBrush(AvaloniaObject element) => | ||
element.GetValue(HighlightBorderBrushProperty); | ||
|
||
public static readonly AttachedProperty<IBrush> HighlightForegroundProperty = | ||
AvaloniaProperty.RegisterAttached<VisualElement, AvaloniaObject, IBrush>("HighlightForeground", inherits: true); | ||
|
||
public static void SetHighlightForeground(AvaloniaObject element, IBrush value) => | ||
element.SetValue(HighlightForegroundProperty, value); | ||
|
||
public static IBrush GetHighlightForeground(AvaloniaObject element) => | ||
element.GetValue(HighlightForegroundProperty); | ||
|
||
public static readonly AttachedProperty<string> TextProperty = | ||
AvaloniaProperty.RegisterAttached<VisualElement, AvaloniaObject, string>("Text"); | ||
|
||
public static void SetText(AvaloniaObject element, string value) => element.SetValue(TextProperty, value); | ||
|
||
public static string GetText(AvaloniaObject element) => element.GetValue(TextProperty); | ||
} |
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.