CPF/CpfRazorSample/Test.razor

49 lines
1.3 KiB
Plaintext
Raw Normal View History

2024-01-09 00:39:58 +08:00
<WindowFrame MaximizeBox="true" Width='"100%"' Height="@("100%")">
2024-01-09 16:57:27 +08:00
<StackPanel Width='"100%"' Height="@("100%")">
<Button Width="80" Height="30" MouseDown="OnMouseDown" Content="test">
2024-01-09 00:39:58 +08:00
</Button>
<CheckBox Content="12"></CheckBox>
@if (visible)
{
<Panel Background="#0f0" Width="20" Height="30" MarginLeft="10"></Panel>
}
2024-01-09 16:57:27 +08:00
<TextBox @ref="textBox" Text="text" Width="100" Height="30" TextChanged="TextChanged"></TextBox>
<Button @ref="button"><CheckBox>@enable</CheckBox></Button>
<ListBox @ref="listBox" Width="200" Height="200" Items="list"></ListBox>
2024-01-09 00:39:58 +08:00
</StackPanel>
</WindowFrame>
2024-01-08 17:37:26 +08:00
@code
{
2024-01-09 16:57:27 +08:00
string key = "textBox";
TextBox textBox;
CPF.Controls.Button button;
2024-01-08 17:37:26 +08:00
bool visible = false;
2024-01-08 20:55:43 +08:00
string text = "test";
2024-01-09 16:57:27 +08:00
List<string> list = new List<string>()
{
"1","2","3"
};
ListBox listBox;
object test = "test";
bool enable;
2024-01-09 00:39:58 +08:00
void OnMouseDown(CPF.Input.MouseButtonEventArgs e)
2024-01-08 17:37:26 +08:00
{
2024-01-09 16:57:27 +08:00
//enable = visible;
button.IsEnabled = visible;
2024-01-08 20:55:43 +08:00
text = "test" + visible;
2024-01-08 17:37:26 +08:00
visible = !visible;
2024-01-09 16:57:27 +08:00
list.Add(list.Count.ToString());
test = list.Count;
}
void TextChanged()
{
}
protected override void OnInitialized()
{
base.OnInitialized();
2024-01-08 17:37:26 +08:00
}
}