예제 #1
1
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            Body = GetTemplateChild(BodyName) as Grid;
            Slider = GetTemplateChild(SliderName) as SuperSlider;

            if (Thumb == null)
                Thumb = new ColorSliderThumb();

            SelectedColor = GetTemplateChild(SelectedColorName) as Rectangle;
            
            SizeChanged += UserControl_SizeChanged;

            if (Slider != null)
            {
                Slider.ValueChanged += Slider_ValueChanged;

                if (Color.A == 0 && Color.R == 0 && Color.G == 0 && Color.B == 0)
                    Color = System.Windows.Media.Color.FromArgb(255, 6, 255, 0);
                else
                    UpdateLayoutBasedOnColor();
            }

			IsEnabledVisualStateUpdate();
        }
예제 #2
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            Body   = GetTemplateChild(BodyName) as Grid;
            Slider = GetTemplateChild(SliderName) as SuperSlider;

            if (Thumb == null)
            {
                Thumb = new ColorSliderThumb();
            }

            SelectedColor = GetTemplateChild(SelectedColorName) as Rectangle;

            SizeChanged += UserControl_SizeChanged;

            if (Slider != null)
            {
                Slider.ValueChanged += Slider_ValueChanged;

                if (Color.A == 0 && Color.R == 0 && Color.G == 0 && Color.B == 0)
                {
                    Color = System.Windows.Media.Color.FromArgb(255, 6, 255, 0);
                }
                else
                {
                    UpdateLayoutBasedOnColor();
                }
            }

            IsEnabledVisualStateUpdate();
        }
예제 #3
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/SplitTheBill;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.TitlePanel = ((System.Windows.Controls.StackPanel)(this.FindName("TitlePanel")));
     this.ApplicationTitle = ((System.Windows.Controls.TextBlock)(this.FindName("ApplicationTitle")));
     this.PageTitle = ((System.Windows.Controls.TextBlock)(this.FindName("PageTitle")));
     this.continueButton = ((Coding4Fun.Phone.Controls.RoundButton)(this.FindName("continueButton")));
     this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.LayoutGrid = ((System.Windows.Controls.Grid)(this.FindName("LayoutGrid")));
     this.peopleSlider = ((Coding4Fun.Phone.Controls.SuperSlider)(this.FindName("peopleSlider")));
     this.UpButton = ((System.Windows.Controls.Image)(this.FindName("UpButton")));
     this.sliderBlock = ((System.Windows.Controls.TextBlock)(this.FindName("sliderBlock")));
     this.DownButton = ((System.Windows.Controls.Image)(this.FindName("DownButton")));
 }