mirror of
https://gitee.com/csharpui/CPF.git
synced 2026-02-27 06:03:10 +08:00
初始化
This commit is contained in:
66
ClassLibrary1/MainView.cs
Normal file
66
ClassLibrary1/MainView.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using CPF;
|
||||
using CPF.Controls;
|
||||
using System;
|
||||
|
||||
namespace ClassLibrary1
|
||||
{
|
||||
public class MainView : Control
|
||||
{
|
||||
protected override void InitializeComponent()
|
||||
{
|
||||
//Root.LoadStyleFile("res://ClassLibrary1/Stylesheet1.css");
|
||||
Background = "#FFFFFF";
|
||||
Width = 387;
|
||||
Height = 464;
|
||||
Children.Add(new Button
|
||||
{
|
||||
MarginTop = 42,
|
||||
Commands =
|
||||
{
|
||||
{
|
||||
nameof(Button.Click),
|
||||
nameof(ClickTest),
|
||||
this,
|
||||
CommandParameter.EventSender,
|
||||
CommandParameter.EventArgs
|
||||
},
|
||||
},
|
||||
Height = 31,
|
||||
Width = 72,
|
||||
Content = "Button",
|
||||
});
|
||||
Children.Add(new ListBox
|
||||
{
|
||||
Height = 189,
|
||||
Width = 148,
|
||||
Items =
|
||||
{
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20
|
||||
}
|
||||
});
|
||||
}
|
||||
void ClickTest(CpfObject obj, RoutedEventArgs eventArgs)
|
||||
{
|
||||
new Window1().Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user