locked
Acessibilidade nos controles RRS feed

  • Pergunta

  • Olá galera, como posso habilitar e desabilitar através de um comando o texto dos controles da minha interface.
    Os botões da interface é formado por Imagem e texto sendo que o texto só é exibido quando usuário optar pela escolha.
    Me ajudem por favor!!!

    <Window
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     x:Class="acessibilidade.Window1"
     x:Name="Window"
     Title="Window1"
     Width="300" Height="200" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
    
    
    
     <Window.Resources>
     <LinearGradientBrush x:Key="BgControl" EndPoint="0.5,-0.099" StartPoint="0.5,0.984">
      <GradientStop Color="#FFCACACA" Offset="0"/>
      <GradientStop Color="#FF313131" Offset="0.948"/>
      <GradientStop Color="#FFC1C1C1" Offset="0.504"/>
     </LinearGradientBrush>
     <LinearGradientBrush x:Key="BgControlOff" EndPoint="0.5,-0.099" StartPoint="0.5,0.984">
      <GradientStop Color="#FF313131" Offset="1"/>
      <GradientStop Color="#FF9D9D9D" Offset="0"/>
     </LinearGradientBrush>
     <LinearGradientBrush x:Key="BgBtn" EndPoint="0.5,-0.202" StartPoint="0.5,1">
      <GradientStop Color="#FF929292" Offset="0"/>
      <GradientStop Color="#FFFFFFFF" Offset="1"/>
      <GradientStop Color="#FFD9D9D9" Offset="0.467"/>
     </LinearGradientBrush>
     <SolidColorBrush x:Key="bgBorder" Color="#FF143577"/>
     <SolidColorBrush x:Key="bgController" Color="#FFC1C1C1"/>
     <LinearGradientBrush x:Key="BgBtnPAD" EndPoint="0.5,-0.202" StartPoint="0.5,1">
      <GradientStop Color="#FFC8C6C6" Offset="0"/>
      <GradientStop Color="#FFFFFFFF" Offset="1"/>
     </LinearGradientBrush>
     <SolidColorBrush x:Key="bgControle" Color="#99757575"/>
     <SolidColorBrush x:Key="bgDisableButton" Color="#FF9B9B9B"/>
      <ControlTemplate x:Key="buttonControlador" TargetType="{x:Type Button}">
       <Border x:Name="border1" BorderBrush="#00FEFEFE" BorderThickness="1,1,1,1" CornerRadius="11,11,11,11" Width="70" Height="65" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="1,1,1,1">
        <Border x:Name="border" BorderThickness="1,1,1,1" CornerRadius="10,10,10,10" Width="67" Height="62" Cursor="Hand" Background="{DynamicResource BgBtnPAD}" BorderBrush="{DynamicResource bgController}">
         <Grid>
          <ContentPresenter Content="{TemplateBinding Content}"/>
          <Path Stretch="Fill" Data="M 301.595,472.42L 301.595,459.097C 301.595,453.769 308.268,449.771 312.272,449.771L 381.674,449.771C 385.678,449.771 392.351,452.435 392.351,459.097L 392.351,472.42C 368.328,483.078 316.276,479.081 301.595,472.42 Z " Width="Auto" HorizontalAlignment="Stretch" x:Name="Brilho" VerticalAlignment="Stretch" Margin="0,-0.197,1,28.261">
           <Path.Fill>
            <LinearGradientBrush EndPoint="0.481,1.2" StartPoint="0.483,-0.17">
             <GradientStop Color="#66FFFFFF" Offset="0"/>
             <GradientStop Color="#00FFFFFF" Offset="1"/>
            </LinearGradientBrush>
           </Path.Fill>
          </Path>
         </Grid>
        </Border>
       </Border>
       <ControlTemplate.Triggers>
        <Trigger Property="IsPressed" Value="true">
         <Setter Property="Background" TargetName="border" Value="{DynamicResource BgBtn}"/>
         <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource bgBorder}"/>
         <Setter Property="BorderThickness" TargetName="border" Value="2,2,2,2"/>
        </Trigger>
        <Trigger Property="IsEnabled" Value="false">
         <Setter Property="Background" TargetName="border" Value="{DynamicResource bgDisableButton}"/>
         <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource bgControle}"/>
        </Trigger>
       </ControlTemplate.Triggers>
      </ControlTemplate>
     </Window.Resources>
    
    
    
     <Grid x:Name="LayoutRoot">
      <Button Template="{DynamicResource buttonControlador}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="8,8,0,0">
        <Grid Width="Auto" Height="Auto">
         <Grid.RowDefinitions>
          <RowDefinition Height="Auto" MinHeight="41.52"/>
          <RowDefinition Height="Auto" MinHeight="0"/>
         </Grid.RowDefinitions>
        <Image Width="Auto" Source="img\icoEsteira.png" Stretch="Uniform" Margin="0,0,0,0" Grid.RowSpan="1"/>
        <TextBlock Text="Configuração" TextWrapping="Wrap" Margin="0,0,0,0" VerticalAlignment="Stretch" Height="Auto" Grid.Row="1"/>    
       </Grid>
          </Button>  
      <Button  Template="{DynamicResource buttonControlador}" Content="Modo Texto" Margin="0,0,8,8" d:LayoutOverrides="Width, Height" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
     </Grid>
    </Window>
    
    
    
    
    quarta-feira, 1 de julho de 2009 16:47