English 中文(简体)
利用视觉国家感化器转换成视觉状态
原标题:Switching to a visual state from code using the VisualStateManager

一位设计师给了我一个银灯儿童窗口,该窗口是用言语Blend设计的,并使用一个视觉国家管理员在两种模式之间盘旋。 简言之,在儿童窗口上出现了一个扩展的纽芬兰语,在被点击时,用详细信息击退了另一个格里德的控制权。

这种互动完全在XAML中发生。 然而,我需要加以改进,以便如果满足某些条件,即如果使用者选择某种选择,“途径显示扩大的细节”,当儿童窗口打开时,扩展的视觉状态将有效。

I thought this was as simple as calling:

VisualStateManager.GoToState(this, "VisualStateDetails", false);

但是,这并不奏效。 我失踪了什么? (我抱歉,如果我看一看一些显而易见的事情,那么我就对银星来说是比较新的,而不是对目视国家管理人员熟知。)

Here is the XAML that has a bit removed for brevity.

<Grid x:Name="LayoutRoot" Margin="2" DataContext="{Binding ProjectNode, Mode=TwoWay}">
    <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="EditorWindowStates">
            <VisualStateGroup.Transitions>
                <VisualTransition GeneratedDuration="0:0:0.5">
                    <VisualTransition.GeneratedEasingFunction>
                        <CubicEase EasingMode="EaseInOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                </VisualTransition>
            </VisualStateGroup.Transitions>
            <VisualState x:Name="VisualStateNormal"/>
            <VisualState x:Name="VisualStateDetails">
                <Storyboard>
                    <!-- snip -->
                </Storyboard>
            </VisualState>
        </VisualStateGroup>
    </VisualStateManager.VisualStateGroups>
    <VisualStateManager.CustomVisualStateManager>
        <ei:ExtendedVisualStateManager/>
    </VisualStateManager.CustomVisualStateManager>

    <!-- snip -->

这里是一顿,在点击时,可扩大细节:

<Button ...>
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Click">
            <ei:GoToStateAction StateName="VisualStateDetails"/>
        </i:EventTrigger>
    </i:Interaction.Triggers>
</Button>

感谢!

最佳回答

问题似乎是,视觉国家管理人员在儿童窗口中没有做冰。

这一博客条目描述了这一问题,提供了两个工作领域。 第一部分(使用<代码>) 扩大的VisualStateManager category对我来说是trick:

Using Visual State Manager with Silverlight Toolkit’s Child Windows control

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签