feat: WPF基础-6-Grid10共享尺寸组
This commit is contained in:
parent
b97b01ec5a
commit
9843d4a95e
|
@ -0,0 +1,9 @@
|
|||
<Application x:Class="WPF基础_6_Grid10共享尺寸组.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:WPF基础_6_Grid10共享尺寸组"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,12 @@
|
|||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Windows;
|
||||
|
||||
namespace WPF基础_6_Grid10共享尺寸组;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
|
@ -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)
|
||||
)]
|
|
@ -0,0 +1,52 @@
|
|||
<Window x:Class="WPF基础_6_Grid10共享尺寸组.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"
|
||||
Icon="public/images/1.png"
|
||||
mc:Ignorable="d"
|
||||
Title="WPF基础_6_Grid10共享尺寸组" Height="450" Width="800">
|
||||
<Grid IsSharedSizeScope="True">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Margin="3" Background="LightYellow">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="TextLabel" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Grid.Column="0" Margin="5">需要一个很长的文字,再长一点.....</Label>
|
||||
<GridSplitter Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Width="5"
|
||||
Background="Coral" />
|
||||
<Label Grid.Column="2" Margin="5">更多的文字</Label>
|
||||
<TextBox Grid.Column="3" Margin="5">
|
||||
一个文字盒子
|
||||
</TextBox>
|
||||
</Grid>
|
||||
|
||||
<Label Grid.Row="1" Margin="5">
|
||||
....................看这里.......................
|
||||
....................看这里.......................
|
||||
....................看这里.......................
|
||||
....................看这里.......................
|
||||
</Label>
|
||||
|
||||
<Grid Grid.Row="2" Margin="3" Background="LightYellow">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="TextLabel" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Margin="5">short</Label>
|
||||
<GridSplitter Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Width="5"
|
||||
Background="Coral" />
|
||||
<TextBox Grid.Column="2" Margin="5" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
|
@ -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基础_6_Grid10共享尺寸组;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<RootNamespace>WPF基础_6_Grid10共享尺寸组</RootNamespace>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWPF>true</UseWPF>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="public\images\1.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="public\images\1.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
Binary file not shown.
After Width: | Height: | Size: 9.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
|
@ -40,6 +40,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF基础-6-Grid8分隔窗
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF基础-6-Grid9分隔窗口2", "WPF基础-6-Grid9分隔窗口2\WPF基础-6-Grid9分隔窗口2.csproj", "{F98782B1-5834-4980-8F6B-6D689267AC5B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF基础-6-Grid10共享尺寸组", "WPF基础-6-Grid10共享尺寸组\WPF基础-6-Grid10共享尺寸组.csproj", "{D63D92A7-880F-4726-A5C9-B84B7E99103E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -126,5 +128,9 @@ Global
|
|||
{F98782B1-5834-4980-8F6B-6D689267AC5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F98782B1-5834-4980-8F6B-6D689267AC5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F98782B1-5834-4980-8F6B-6D689267AC5B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D63D92A7-880F-4726-A5C9-B84B7E99103E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D63D92A7-880F-4726-A5C9-B84B7E99103E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D63D92A7-880F-4726-A5C9-B84B7E99103E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D63D92A7-880F-4726-A5C9-B84B7E99103E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
Loading…
Reference in New Issue