Udostępnij za pośrednictwem


Omówienie narzędzia Sizer

Kontrolki Sizer składają się z następujących elementów:

  • GridSplitter
  • ContentSizer
  • WłaściwośćSizer

Każda z nich zapewnia użytkownikom możliwość manipulowania różnymi częściami środowiska interfejsu użytkownika.

Ten dokument zawiera informacje o typowych ustawieniach, które można ustawić na dowolnej z tych kontrolek.

Niestandardowy kursor myszy

Możesz zmienić kursor wyświetlany podczas umieszczania wskaźnika myszy na elemecie w następujący sposób:

<!--  Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information.  -->
<Page x:Class="SizersExperiment.Samples.SizerCursorPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:controls="using:CommunityToolkit.WinUI.Controls"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d">

    <Grid MinWidth="400"
          MinHeight="300">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Border x:Name="SomeContent"
                MinWidth="200"
                MaxWidth="600"
                Background="{ThemeResource AccentFillColorDefaultBrush}" />
        <controls:ContentSizer Grid.Column="1"
                               Cursor="Hand"
                               TargetControl="{x:Bind SomeContent}" />
    </Grid>
</Page>
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace SizersExperiment.Samples;

[ToolkitSample(id: nameof(SizerCursorPage), "Custom Mouse Cursor", description: "Shows how to change the cursor of a Sizer control.")]
public sealed partial class SizerCursorPage : Page
{
    public SizerCursorPage()
    {
        this.InitializeComponent();
    }
}