feat: WPF控件-11-Expander2

This commit is contained in:
Bunny 2025-01-07 23:41:39 +08:00
parent 3219b91b59
commit 328110112b
8 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,9 @@
<Application x:Class="WPF控件_11_Expander2.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WPF控件_11_Expander2"
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控件_11_Expander2;
/// <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,25 @@
<Window x:Class="WPF控件_11_Expander2.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="clr-namespace:WPF控件_11_Expander2"
Icon="public/003540AH4M72.jpg"
mc:Ignorable="d"
Title="WPF控件_11_Expander2" Height="450" Width="800">
<StackPanel>
<Expander Margin="3" Padding="5" Header="Region One" ExpandDirection="Left" Collapsed="Expander_OnCollapsed">
<Button Padding="3">Hidden Button One </Button>
</Expander>
<Expander Margin="5" Padding="5" Header="Region Two" ExpandDirection="Right">
<TextBlock TextWrapping="Wrap">
Lorem ipsum dolor sit amet, consectetur adipiscing elit...
</TextBlock>
</Expander>
<Expander Margin="5" Padding="5" Header="Region Three" ExpandDirection="Up">
<Button Padding="3">Hidden Button Two </Button>
</Expander>
</StackPanel>
</Window>

View File

@ -0,0 +1,28 @@
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控件_11_Expander2;
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Expander_OnCollapsed(object sender, RoutedEventArgs e)
{
Console.WriteLine("关闭?");
}
}

View File

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<RootNamespace>WPF控件_11_Expander2</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

@ -24,6 +24,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-10-TabItem-1", "W
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-11-Expander", "WPF控件-11-Expander\WPF控件-11-Expander.csproj", "{D6659E10-D875-48FC-983F-8F2FF62FF0EB}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-11-Expander", "WPF控件-11-Expander\WPF控件-11-Expander.csproj", "{D6659E10-D875-48FC-983F-8F2FF62FF0EB}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-11-Expander2", "WPF控件-11-Expander2\WPF控件-11-Expander2.csproj", "{0D2CEE95-6B52-4D7D-B001-ED6AB4262875}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -78,5 +80,9 @@ Global
{D6659E10-D875-48FC-983F-8F2FF62FF0EB}.Debug|Any CPU.Build.0 = Debug|Any CPU {D6659E10-D875-48FC-983F-8F2FF62FF0EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D6659E10-D875-48FC-983F-8F2FF62FF0EB}.Release|Any CPU.ActiveCfg = Release|Any CPU {D6659E10-D875-48FC-983F-8F2FF62FF0EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D6659E10-D875-48FC-983F-8F2FF62FF0EB}.Release|Any CPU.Build.0 = Release|Any CPU {D6659E10-D875-48FC-983F-8F2FF62FF0EB}.Release|Any CPU.Build.0 = Release|Any CPU
{0D2CEE95-6B52-4D7D-B001-ED6AB4262875}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D2CEE95-6B52-4D7D-B001-ED6AB4262875}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D2CEE95-6B52-4D7D-B001-ED6AB4262875}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D2CEE95-6B52-4D7D-B001-ED6AB4262875}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal