public Spectrum() { this.InitializeComponent(); this.Timer = new Timer(); this.Timer.Interval = UPDATE_INTERVAL; this.Timer.AutoReset = false; this.Timer.Elapsed += this.OnElapsed; if (Enabled != null) { Enabled.ConnectValue(value => { if (value) { this.Visibility = Visibility.Visible; this.Timer.Start(); } else { this.Visibility = Visibility.Collapsed; this.Timer.Stop(); } }); } if (Bars != null) { Bars.ConnectValue(value => this.Configure( SpectrumBehaviourConfiguration.GetBars(value), SpectrumBehaviourConfiguration.GetWidth(value) ) ); } }
public Rating() { //TODO: I can't work out how to make the star paths size to fit their parent. //TODO: This is a common size and will look OK in most cases. this.MaxHeight = 30; Popularimeter.ConnectValue(value => { var task = Windows.Invoke(() => { if (value) { this.Enable(); } else { this.Disable(); } }); }); }