// hepler function protected virtual void OnWindowButtonStateChange(WindowButtonState state, WindowButton button) { switch (state) { case WindowButtonState.Normal: button.Visibility = Visibility.Visible; button.IsEnabled = true; break; case WindowButtonState.Disabled: button.Visibility = Visibility.Visible; button.IsEnabled = false; break; case WindowButtonState.None: button.Visibility = Visibility.Collapsed; break; } }