mirror of
				https://gitee.com/csharpui/CPF.git
				synced 2025-11-01 00:46:56 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			67 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			67 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| 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();
 | |
|         }
 | |
|     }
 | |
| }
 | 
