Advertisement
Fhernd

ElipseControl.xaml.cs

Mar 7th, 2018
1,531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. using System.Windows.Controls;
  2. using System.Windows.Media;
  3.  
  4. namespace R722ControlWPFEnWinForms
  5. {
  6.     /// <summary>
  7.     /// Interaction logic for ElipseControl.xaml
  8.     /// </summary>
  9.     public partial class ElipseControl : UserControl
  10.     {
  11.         public ElipseControl()
  12.         {
  13.             InitializeComponent();
  14.         }
  15.  
  16.         public string Color
  17.         {
  18.             get
  19.             {
  20.                 if (Elipse.Fill == (Brush)grdPrincipal.Resources["Rojo"])
  21.                 {
  22.                     return "Red";
  23.                 }
  24.                 else
  25.                 {
  26.                     return "Blue";
  27.                 }
  28.             }
  29.         }
  30.  
  31.         public void CambiarColor()
  32.         {
  33.             if (Elipse.Fill == (Brush)grdPrincipal.Resources["Rojo"])
  34.             {
  35.                 Elipse.Fill = (Brush)grdPrincipal.Resources["Azul"];
  36.             }
  37.             else
  38.             {
  39.                 Elipse.Fill = (Brush)grdPrincipal.Resources["Rojo"];
  40.             }
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement