This is a migrated thread and some comments may be shown as answers.

Theme Office_Blue on button

1 Answer 59 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
shirley wang
Top achievements
Rank 1
shirley wang asked on 05 Aug 2010, 12:36 PM
Dear People,

I have a sample programme.

<UserControl x:Class="ButtonSample.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">
        <StackPanel Orientation="Vertical">
            <Button Name="btnTest" Width="100" Height="80" Content="Test" Margin="20" telerik:Theming.Theme="Office_Blue"/>
            <Button Name="btnClickMe" Width="100" Height="80" Content="Click me" Margin="20" Click="btnClickMe_Click" telerik:Theming.Theme="Office_Blue"/>
        </StackPanel>
    </Grid>
</UserControl>

public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void btnClickMe_Click(object sender, RoutedEventArgs e)
        {
            this.btnTest.IsEnabled = !btnTest.IsEnabled;
        }
    }

And i noticed that when the button IsEnabled state is changed from false to true. The button is clickable, but the text on button
is not so clear. How can i solve this problem?

1 Answer, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 10 Aug 2010, 12:29 PM
Hi shirley wang,

I tried your example and the "Click" event of the btnTest button will not be raised once it is disabled. Is it another event that you are referring to as "Clickable" ?

When the button is disabled its contents are grayed-out, this is part of the design. You can change this by editing the Button's ControlTemplate, namely the "Disabled" VisualState.

I have attached the xaml for the Office_Blue buttons, you may find this useful if you are not using Blend.

All the best,
Miroslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Buttons
Asked by
shirley wang
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Share this question
or