Created
May 3, 2017 08:54
-
-
Save atzimler/0a049ae722dec744f0594c16d61d97b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CreateResultStars | |
| { | |
| private readonly MultiplyByTwo _multiplier; | |
| public string Stars { get; private set; } | |
| public CreateResultStars(MultiplyByTwo multiplier) | |
| { | |
| _multiplier = multiplier; | |
| var dpd = DependencyPropertyDescriptor.FromProperty(MultiplyByTwo.ResultProperty, typeof(MultiplyByTwo)); | |
| dpd.AddValueChanged(_multiplier, (o, e) => RecalculateStars()); | |
| RecalculateStars(); | |
| } | |
| private void RecalculateStars() | |
| { | |
| Stars = new string('*', _multiplier.Result); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment