private void OnMouseLeaveStarOne(object sender, MouseEventArgs e) { if (!StarOne.IsChecked.HasValue || !StarOne.IsChecked.Value) { var star = Extensions.FindChild <Rectangle>(StarOne, "star"); var brush = star.OpacityMask as VisualBrush; var visual = brush.Visual as Canvas; var path = visual.Children[0] as Path; path.Fill = Brushes.White; path.Opacity = 1.0; } }
private void OnMouseEnterStarFive(object sender, MouseEventArgs e) { OnMouseEnterStarFour(null, null); if (!StarFive.IsChecked.HasValue || !StarFive.IsChecked.Value) { var star = Extensions.FindChild <Rectangle>(StarFive, "star"); var brush = star.OpacityMask as VisualBrush; var visual = brush.Visual as Canvas; var path = visual.Children[0] as Path; path.Fill = Brushes.DarkOrange; path.Opacity = 0.8; } }