2013年4月23日 星期二

[Windows 8] How to show or hide the components with windows store app by C#

Example

private void PlayMedia(object sender, MouseButtonEventArgs args)
{
    pauseBTN.Visibility = Visibility.Visible;
    playBTN.Visibility = Visibility.Collapsed;

    media.SpeedRatio = 1.0;
    media.Play();
}

XAML Attribute Usage

<uiElement Visibility="Visible" .../>
or
<uiElement Visibility="Collapsed" .../>
The default value is Visible

UIElement.Visibility Property

Member name
Description
Visible Display the element.
Collapsed Do not display the element

reference:

沒有留言:

張貼留言