XMAL语法基础
创建一个wpf项目 查看下哪些文件 以vs2022 net8 创建

默认情况是代码在下 窗口展示在上 可以点击图片的箭头调整位置

- App.xmal
作用:定义了应用程序的基本结构,包括资源、主题等
<Application x:Class="WpfApp1.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApp1"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
- App.xaml.cs
作用:定义了应用程序的行为,包括启动事件等
namespace WpfApp1
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
- MainWindow.xmal
作用:前端文件,定义了窗口的基本结构,包括窗口的大小、位置、标题、背景色等
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local

最低0.47元/天 解锁文章
835

被折叠的 条评论
为什么被折叠?



