WPF:为什么隐藏内容接受用户操作?

时间:2018-04-25 20:39:29

标签: c# xml wpf

我有一个项目我已经创建,以便用C#/ XML测试UI / UX FX。当用户选择"开始使用"时,会出现一系列动画。

尽管 GridLeft:LeftContent2 & GridLeft:LeftContent3 的不透明度为0.0,用户仍可在运行时访问它们。在WinForms中,我使用Visual Studio的文档大纲来创建层次结构 - 除非隐藏最上面的面板,否则无法访问层次结构顶部的WinForm面板下面的面板。我认为它对于网格来说是一样的,但事实并非如此。

image hierarchy

<!-- Reduces Left Content Opacity -->
        <DoubleAnimation Storyboard.TargetProperty="(Grid.Opacity)" Storyboard.TargetName="LeftContent1" From="1.0" To="0.0" Duration="0:0:0.375">
            <DoubleAnimation.EasingFunction>
                <CubicEase EasingMode="EaseInOut"/>
            </DoubleAnimation.EasingFunction>
        </DoubleAnimation>

        <!-- Displays New Left Content2 Opacity -->
        <DoubleAnimation Storyboard.TargetProperty="(Grid.Opacity)" Storyboard.TargetName="LeftContent2" From="0.0" To="1.0" Duration="0:0:0.375">
            <DoubleAnimation.EasingFunction>
                <CubicEase EasingMode="EaseInOut"/>
            </DoubleAnimation.EasingFunction>
        </DoubleAnimation>

        <!-- Displays New Left Content3 Opacity -->
        <DoubleAnimation Storyboard.TargetProperty="(Grid.Opacity)" Storyboard.TargetName="LeftContent3" From="0.0" To="1.0" Duration="0:0:0.75">
            <DoubleAnimation.EasingFunction>
                <CubicEase EasingMode="EaseInOut"/>
            </DoubleAnimation.EasingFunction>
        </DoubleAnimation>

当用户选择&#34;开始使用&#34;按钮,白色网格向左扩展,导致左网格从Opacity =&#34; 0.0&#34;到Opacity =&#34; 1.0&#34; (与LeftContent2和3相反)同时。这导致可以访问LeftContent2和LeftContent3。

无法选择按钮,因为LeftContent3位于其前面(0不透明度);尽管用户不可见,但用户可以与内容进行交互。是否有一种新的方法来修改Window元素的层次结构?

0 个答案:

没有答案
相关问题