コード例 #1
0
 private void ResetSliderHeight()
 {
     if (this.ZoomSlider != null)
     {
         this.ZoomLevelCount = ((int) (this.ZoomMaxLevel - this.ZoomMinLevel)) + 1;
         this.SliderStick.set_Height((this.ThumbHeight * this.ZoomLevelCount) + (this.SpanHeight * (this.ZoomLevelCount - 1)));
         for (int i = 1; i < (this.ZoomLevelCount - 1); i++)
         {
             Rectangle rectangle = new Rectangle();
             rectangle.set_Width(10.0);
             rectangle.set_Height(2.0);
             rectangle.set_Fill(new SolidColorBrush(SystemColors.get_ControlDarkDarkColor()));
             rectangle.set_HorizontalAlignment(1);
             rectangle.set_VerticalAlignment(0);
             rectangle.set_Margin(new Thickness(0.0, ((this.SliderStick.get_Height() / ((double) (this.ZoomLevelCount - 1))) * i) - 1.0, 0.0, 0.0));
             ToolTip tip = new ToolTip();
             tip.set_Content(((this.ZoomMaxLevel - i)).ToString() + "级");
             ToolTipService.SetToolTip(rectangle, tip);
             this.ZoomSlider.get_Children().Add(rectangle);
         }
         this.SetThumbPosition();
     }
 }