Dreamine.UI.Maui
1.0.1
Windows(WinUI)의 네이티브 `CheckBox`는 `WidthRequest`로 줄일 수 없는 거대한 최소 너비를 가져서 라벨과의 간격이 벌어지는 문제가 있어, 처음부터 직접 그려서 만들었습니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
DreamineExpander.xaml.cs
이 파일의 문서화 페이지로 가기
1
namespace
Dreamine.UI.Maui
;
2
11
public
partial class
DreamineExpander
: ContentView
12
{
21
public
static
readonly BindableProperty
HeaderProperty
= BindableProperty.Create(
22
nameof(
Header
), typeof(
string
), typeof(
DreamineExpander
),
string
.Empty,
23
propertyChanged: (b, _, n) => ((
DreamineExpander
)b).HeaderLabel.Text = (
string
)n);
24
33
public
static
readonly BindableProperty
IsExpandedProperty
= BindableProperty.Create(
34
nameof(
IsExpanded
), typeof(
bool
), typeof(
DreamineExpander
),
true
,
35
defaultBindingMode: BindingMode.TwoWay,
36
propertyChanged: (b, _, n) => ((
DreamineExpander
)b).ApplyExpandedState());
37
46
public
static
readonly BindableProperty
ExpanderContentProperty
= BindableProperty.Create(
47
nameof(
ExpanderContent
), typeof(View), typeof(
DreamineExpander
),
null
,
48
propertyChanged: (b, _, n) => ((
DreamineExpander
)b).ContentHost.Content = (View?)n);
49
58
public
string
Header
59
{
60
get
=> (string)GetValue(
HeaderProperty
);
61
set
=> SetValue(
HeaderProperty
, value);
62
}
63
72
public
bool
IsExpanded
73
{
74
get
=> (bool)GetValue(
IsExpandedProperty
);
75
set
=> SetValue(
IsExpandedProperty
, value);
76
}
77
86
public
View?
ExpanderContent
87
{
88
get
=> (View?)GetValue(
ExpanderContentProperty
);
89
set
=> SetValue(
ExpanderContentProperty
, value);
90
}
91
100
public
event
EventHandler?
ExpandedChanged
;
101
110
public
DreamineExpander
()
111
{
112
InitializeComponent();
113
ApplyExpandedState
();
114
}
115
140
private
void
OnHeaderTapped
(
object
? sender, TappedEventArgs e)
141
{
142
IsExpanded
= !
IsExpanded
;
143
ExpandedChanged
?.Invoke(
this
, EventArgs.Empty);
144
}
145
154
private
void
ApplyExpandedState
()
155
{
156
ContentHost.IsVisible =
IsExpanded
;
157
ArrowLabel.Text =
IsExpanded
?
"▼"
:
"▶"
;
158
}
159
}
Dreamine.UI.Maui
Definition
DreamineCheckBox.xaml.cs:1
Dreamine.UI.Maui.DreamineExpander.ExpanderContent
View? ExpanderContent
Definition
DreamineExpander.xaml.cs:87
Dreamine.UI.Maui.DreamineExpander.IsExpanded
bool IsExpanded
Definition
DreamineExpander.xaml.cs:73
Dreamine.UI.Maui.DreamineExpander.IsExpandedProperty
static readonly BindableProperty IsExpandedProperty
Definition
DreamineExpander.xaml.cs:33
Dreamine.UI.Maui.DreamineExpander.ExpanderContentProperty
static readonly BindableProperty ExpanderContentProperty
Definition
DreamineExpander.xaml.cs:46
Dreamine.UI.Maui.DreamineExpander.HeaderProperty
static readonly BindableProperty HeaderProperty
Definition
DreamineExpander.xaml.cs:21
Dreamine.UI.Maui.DreamineExpander.ApplyExpandedState
void ApplyExpandedState()
Definition
DreamineExpander.xaml.cs:154
Dreamine.UI.Maui.DreamineExpander.DreamineExpander
DreamineExpander()
Definition
DreamineExpander.xaml.cs:110
Dreamine.UI.Maui.DreamineExpander.Header
string Header
Definition
DreamineExpander.xaml.cs:59
Dreamine.UI.Maui.DreamineExpander.OnHeaderTapped
void OnHeaderTapped(object? sender, TappedEventArgs e)
Definition
DreamineExpander.xaml.cs:140
Dreamine.UI.Maui.DreamineExpander.ExpandedChanged
EventHandler? ExpandedChanged
Definition
DreamineExpander.xaml.cs:100
DreamineExpander.xaml.cs
다음에 의해 생성됨 :
1.17.0