ControlPair.cs 612 B

12345678910111213141516171819202122
  1. using System.Windows;
  2. namespace MuchInfo.Chart.Infrastructure.Utilities
  3. {
  4. public class ControlPair
  5. {
  6. public UIElement ControlLeft { get; set; }
  7. public UIElement ControlRight { get; set; }
  8. public void SetVisible(bool val)
  9. {
  10. if (this.ControlLeft != null)
  11. {
  12. this.ControlLeft.Visibility = val ? Visibility.Visible : Visibility.Hidden;
  13. }
  14. if (this.ControlRight != null)
  15. {
  16. this.ControlRight.Visibility = val ? Visibility.Visible : Visibility.Hidden;
  17. }
  18. }
  19. }
  20. }