Пример #1
0
 /// <summary>
 /// 清空并重新加载月份Panel。
 /// </summary>
 private void LoadMonthPanel()
 {
     ClearMonthPanel();
     for (int i = 1; i <= 12; i++)
     {
         var radio = new PURadioButton
         {
             RadioButtonStyle           = PURadioButton.RadioButtonStyles.Button,
             Content                    = i + "月",
             Height                     = 35,
             HorizontalAlignment        = HorizontalAlignment.Stretch,
             HorizontalContentAlignment = HorizontalAlignment.Center,
             Padding                    = new Thickness(0),
             Tag = i,
         };
         Grid.SetRow(radio, (i - 1) / 4);
         Grid.SetColumn(radio, (i - 1) % 4);
         var cover = new Binding {
             Path = new PropertyPath("CoverBrush"), Source = this, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
         };
         BindingOperations.SetBinding(radio, PURadioButton.CoverBrushProperty, cover);
         radio.Click += MonthRadioButton_Click;
         GrdMonthPanel.Children.Add(radio);
     }
 }
Пример #2
0
        private PURadioButton GetRadioButton(int content)
        {
            var radio = new PURadioButton()
            {
                RadioButtonStyle = RadioButtonStyles.Button,
                Content = content,
                HorizontalAlignment = HorizontalAlignment.Left,
                HorizontalContentAlignment = HorizontalAlignment.Center,
                Padding = new Thickness(5,0,5,0),
                Margin = new Thickness(6, 0, 0, 0),
            };
            var back = new Binding() { Source = this, Path = new PropertyPath("ButtonBrush"), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged };
            BindingOperations.SetBinding(radio, PURadioButton.BackgroundProperty, back);
            var cover = new Binding() { Source = this, Path = new PropertyPath("SelectedBrush"), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged };
            BindingOperations.SetBinding(radio, PURadioButton.CoverBrushProperty, cover);
            var fore = new Binding() { Source = this, Path = new PropertyPath("Foreground"), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged };
            BindingOperations.SetBinding(radio, PURadioButton.ForegroundProperty, fore);
            var height = new Binding() { Source = this, Path = new PropertyPath("ActualHeight"), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged };
            BindingOperations.SetBinding(radio, PURadioButton.HeightProperty, height);
            var radius = new Binding() { Source = this, Path = new PropertyPath("ButtonCornerRadius"), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged };
            BindingOperations.SetBinding(radio, PURadioButton.BorderCornerRadiusProperty, radius);

            radio.Click += delegate
            {
                CurrentPage = content;
            };
            return radio;
        }
Пример #3
0
 /// <summary>
 /// 清空并重新加载年份Panel。
 /// </summary>
 private void LoadYearPanel()
 {
     ClearYearPanel();
     for (int i = 0; i < 15; i++)
     {
         var radio = new PURadioButton
         {
             RadioButtonStyle           = RadioButtonStyles.Button,
             Content                    = i.ToString("00"),
             Height                     = 35,
             HorizontalAlignment        = HorizontalAlignment.Stretch,
             HorizontalContentAlignment = HorizontalAlignment.Center,
             Padding                    = new Thickness(0),
             Tag = i,
         };
         Grid.SetRow(radio, i / 3);
         Grid.SetColumn(radio, i % 3);
         var fore = new Binding {
             Path = new PropertyPath("Foreground"), Source = this, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
         };
         BindingOperations.SetBinding(radio, PURadioButton.ForegroundProperty, fore); var cover = new Binding {
             Path = new PropertyPath("CoverBrush"), Source = this, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
         };
         BindingOperations.SetBinding(radio, PURadioButton.CoverBrushProperty, cover);
         radio.Click += YearRadioButton_Click;
         GrdYearPanel.Children.Add(radio);
     }
 }
Пример #4
0
 /// <summary>
 /// 清空并重新加载日期Panel。
 /// </summary>
 private void LoadDatePanel()
 {
     ClearDatePanel();
     for (int i = 0; i < 42; i++)
     {
         var radio = new PURadioButton
         {
             RadioButtonStyle           = PURadioButton.RadioButtonStyles.Button,
             Content                    = i.ToString("00"),
             VerticalAlignment          = VerticalAlignment.Stretch,
             HorizontalAlignment        = HorizontalAlignment.Stretch,
             HorizontalContentAlignment = HorizontalAlignment.Center,
             Padding                    = new Thickness(0),
         };
         Grid.SetRow(radio, (int)(i / 7));
         Grid.SetColumn(radio, i % 7);
         var cover = new Binding {
             Path = new PropertyPath("CoverBrush"), Source = this, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
         };
         BindingOperations.SetBinding(radio, PURadioButton.CoverBrushProperty, cover);
         radio.Click += DateRadioButton_Click;
         GrdDatePanel.Children.Add(radio);
     }
 }
Пример #5
0
 /// <summary>
 /// 清空并重新加载时间Panel。
 /// </summary>
 private void LoadTimePanel()
 {
     ClearTimePanel();
     for (int i = 0; i < 24; i++)
     {
         var radio = new PURadioButton
         {
             RadioButtonStyle           = PURadioButton.RadioButtonStyles.Button,
             Content                    = i.ToString("00"),
             Height                     = 30,
             HorizontalAlignment        = HorizontalAlignment.Stretch,
             HorizontalContentAlignment = HorizontalAlignment.Center,
             Padding                    = new Thickness(0),
             Tag = i,
         };
         Grid.SetRow(radio, i / 7);
         Grid.SetColumn(radio, i % 7);
         var cover = new Binding {
             Path = new PropertyPath("CoverBrush"), Source = this, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
         };
         BindingOperations.SetBinding(radio, PURadioButton.CoverBrushProperty, cover);
         radio.Click += HourRadioButton_Click;
         StkHour.Children.Add(radio);
     }
     for (int i = 0; i < 60; i++)
     {
         var radio = new PURadioButton
         {
             RadioButtonStyle           = PURadioButton.RadioButtonStyles.Button,
             Height                     = 30,
             HorizontalAlignment        = HorizontalAlignment.Stretch,
             HorizontalContentAlignment = HorizontalAlignment.Center,
             Padding                    = new Thickness(0),
             Content                    = i.ToString("00"),
             Tag = i,
         };
         Grid.SetRow(radio, i / 7);
         Grid.SetColumn(radio, i % 7);
         var cover = new Binding {
             Path = new PropertyPath("CoverBrush"), Source = this, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
         };
         BindingOperations.SetBinding(radio, PURadioButton.CoverBrushProperty, cover);
         radio.Click += MinuteRadioButton_Click;
         StkMinute.Children.Add(radio);
     }
     for (int i = 0; i < 60; i++)
     {
         var radio = new PURadioButton
         {
             RadioButtonStyle           = PURadioButton.RadioButtonStyles.Button,
             Height                     = 30,
             HorizontalAlignment        = HorizontalAlignment.Stretch,
             HorizontalContentAlignment = HorizontalAlignment.Center,
             Padding                    = new Thickness(0),
             Content                    = i.ToString("00"),
             Tag = i,
         };
         Grid.SetRow(radio, i / 7);
         Grid.SetColumn(radio, i % 7);
         var cover = new Binding {
             Path = new PropertyPath("CoverBrush"), Source = this, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
         };
         BindingOperations.SetBinding(radio, PURadioButton.CoverBrushProperty, cover);
         radio.Click += SecondRadioButton_Click;
         StkSecond.Children.Add(radio);
     }
 }
Пример #6
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.titlebar = ((System.Windows.Controls.Border)(target));
                return;

            case 2:
                this.TitleText = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.closeicongrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 4:
                this.closeicon = ((System.Windows.Controls.Image)(target));
                return;

            case 5:
                this.booktip = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.roomname = ((Panuon.UI.PUTextBox)(target));
                return;

            case 7:
                this.roomtype = ((Panuon.UI.PUBubble)(target));
                return;

            case 8:
                this.customname = ((Panuon.UI.PUTextBox)(target));
                return;

            case 9:
                this.customsex = ((Panuon.UI.PUComboBox)(target));
                return;

            case 10:
                this.customIdentify = ((Panuon.UI.PUTextBox)(target));
                return;

            case 11:
                this.normaltype = ((Panuon.UI.PURadioButton)(target));
                return;

            case 12:
                this.hourtype = ((Panuon.UI.PURadioButton)(target));
                return;

            case 13:
                this.morningtype = ((Panuon.UI.PURadioButton)(target));
                return;

            case 14:
                this.halfdaytype = ((Panuon.UI.PURadioButton)(target));
                return;

            case 15:
                this.InTime = ((Panuon.UI.PUTextBox)(target));
                return;

            case 16:

            #line 79 "..\..\..\..\Views\FunctionWindow\OpenRoomWindow.xaml"
                ((Panuon.UI.PUButton)(target)).Click += new System.Windows.RoutedEventHandler(this.SetInTime);

            #line default
            #line hidden
                return;

            case 17:
                this.OutTime = ((Panuon.UI.PUTextBox)(target));
                return;

            case 18:

            #line 104 "..\..\..\..\Views\FunctionWindow\OpenRoomWindow.xaml"
                ((Panuon.UI.PUButton)(target)).Click += new System.Windows.RoutedEventHandler(this.SetOutTime);

            #line default
            #line hidden
                return;

            case 19:
                this.money = ((Panuon.UI.PUTextBox)(target));

            #line 113 "..\..\..\..\Views\FunctionWindow\OpenRoomWindow.xaml"
                this.money.PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.numbertextbox);

            #line default
            #line hidden
                return;

            case 20:
                this.alipay = ((Panuon.UI.PURadioButton)(target));
                return;

            case 21:
                this.wechat = ((Panuon.UI.PURadioButton)(target));
                return;

            case 22:
                this.chash = ((Panuon.UI.PURadioButton)(target));
                return;

            case 23:
                this.other = ((Panuon.UI.PURadioButton)(target));
                return;
            }
            this._contentLoaded = true;
        }