feat: WPF控件-10-TabItem-1

This commit is contained in:
Bunny 2025-01-07 23:20:35 +08:00
parent e100e125bc
commit fc3447df12
9 changed files with 121 additions and 0 deletions

View File

@ -0,0 +1,9 @@
<Application x:Class="WPF控件_10_TabItem_1.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WPF控件_10_TabItem_1"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

View File

@ -0,0 +1,12 @@
using System.Configuration;
using System.Data;
using System.Windows;
namespace WPF控件_10_TabItem_1;
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}

View File

@ -0,0 +1,10 @@
using System.Windows;
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]

View File

@ -0,0 +1,32 @@
<Window x:Class="WPF控件_10_TabItem_1.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"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<TabControl Margin="5">
<TabItem>
<TabItem.Header>
<StackPanel>
<TextBlock Margin="3">Image and text Tab Title</TextBlock>
<Image Source="public/003540AH4M72.jpg" Width="50" />
</StackPanel>
</TabItem.Header>
<StackPanel Margin="3">
<CheckBox Margin="3">Tab Two One</CheckBox>
<CheckBox Margin="3">Tab Two Two</CheckBox>
<CheckBox Margin="3">Tab Two Three</CheckBox>
</StackPanel>
</TabItem>
<TabItem Header="Tab Two">
<StackPanel Margin="3">
<CheckBox Margin="3">Setting One</CheckBox>
<CheckBox Margin="3">Setting Two</CheckBox>
<CheckBox Margin="3">Setting Three</CheckBox>
</StackPanel>
</TabItem>
</TabControl>
</Window>

View File

@ -0,0 +1,23 @@
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace WPF控件_10_TabItem_1;
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}

View File

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<RootNamespace>WPF控件_10_TabItem_1</RootNamespace>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<Resource Include="public\003540AH4M72.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

View File

@ -22,5 +22,16 @@
<CheckBox Margin="3">Tab Two Three</CheckBox>
</StackPanel>
</TabItem>
<TabItem Header="Tab Three">
<TabItem>
<TabItem.Header>
<StackPanel>
<TextBlock Margin="3">Image and text Tab Title</TextBlock>
<Image Source="public/003540AH4M72.jpg" Width="50" />
</StackPanel>
</TabItem.Header>
</TabItem>
</TabItem>
</TabControl>
</Window>

View File

@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-9-GroupBox", "WPF
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-10-TabItem", "WPF控件-10-TabItem\WPF控件-10-TabItem.csproj", "{6796E20D-9385-475A-9DD2-9D0E30848F35}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-10-TabItem-1", "WPF控件-10-TabItem-1\WPF控件-10-TabItem-1.csproj", "{BCBBBA3B-A8B8-4DF6-B5AB-52CDE81C1CE5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -66,5 +68,9 @@ Global
{6796E20D-9385-475A-9DD2-9D0E30848F35}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6796E20D-9385-475A-9DD2-9D0E30848F35}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6796E20D-9385-475A-9DD2-9D0E30848F35}.Release|Any CPU.Build.0 = Release|Any CPU
{BCBBBA3B-A8B8-4DF6-B5AB-52CDE81C1CE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BCBBBA3B-A8B8-4DF6-B5AB-52CDE81C1CE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BCBBBA3B-A8B8-4DF6-B5AB-52CDE81C1CE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BCBBBA3B-A8B8-4DF6-B5AB-52CDE81C1CE5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal