AffdexMe.MainWindow.changeButtonStyle C# (CSharp) Method

changeButtonStyle() private method

Changes the button style based on the specified flag.
private changeButtonStyle ( System.Windows.Controls.Button button, bool isOn ) : void
button System.Windows.Controls.Button The button.
isOn bool if set to true [is on].
return void
        private void changeButtonStyle(Button button, bool isOn)
        {
            Style style;
            String buttonText = String.Empty;

            if (isOn)
            {
                style = this.FindResource("PointsOnButtonStyle") as Style;
                buttonText = "Hide " + button.Name;
            }
            else
            {
                style = this.FindResource("CustomButtonStyle") as Style;
                buttonText = "Show " + button.Name;
            }
            button.Style = style;
            button.Content = buttonText;
        }