private void star_StateChanged(object sender, StarStateChangedEventArgs e) { Star star = (Star)sender; int current = (int)star.Tag; bool reset = (current < Value); int value; foreach (Star str in this.stackPanelStars.Children) { value = (int)str.Tag; DisableStateChange(str); if (value < current) { str.State = StarState.On; } else if (value > current) { str.State = StarState.Off; } else if (value == current && reset) { str.State = StarState.On; } EnableStateChange(str); } this.Value = current; }
private void OnStateChanged(StarStateChangedEventArgs e) { if (StateChanged != null) { StateChanged(this, e); } }