コード例 #1
0
 private void InitializeViews()
 {
     //this.GestureRecognizers.Add(new Xamarin.Forms.TapGestureRecognizer
     //{
     //    NumberOfTapsRequired = 1,
     //    Command = new Xamarin.Forms.Command(async () => { await MyLogger.Alert("Tapped"); })
     //});
     this.ColumnDefinitions.Add(new Xamarin.Forms.ColumnDefinition {
         Width = new Xamarin.Forms.GridLength(0, Xamarin.Forms.GridUnitType.Absolute)
     });
     this.ColumnDefinitions.Add(new Xamarin.Forms.ColumnDefinition {
         Width = new Xamarin.Forms.GridLength(4, Xamarin.Forms.GridUnitType.Star)
     });
     this.ColumnDefinitions.Add(new Xamarin.Forms.ColumnDefinition {
         Width = new Xamarin.Forms.GridLength(4, Xamarin.Forms.GridUnitType.Star)
     });
     this.ColumnDefinitions.Add(new Xamarin.Forms.ColumnDefinition {
         Width = new Xamarin.Forms.GridLength(1, Xamarin.Forms.GridUnitType.Star)
     });
     this.ColumnDefinitions.Add(new Xamarin.Forms.ColumnDefinition {
         Width = new Xamarin.Forms.GridLength(50, Xamarin.Forms.GridUnitType.Absolute)
     });
     this.ColumnDefinitions.Add(new Xamarin.Forms.ColumnDefinition {
         Width = new Xamarin.Forms.GridLength(50, Xamarin.Forms.GridUnitType.Absolute)
     });
     this.RowDefinitions.Add(new Xamarin.Forms.RowDefinition {
         Height = new Xamarin.Forms.GridLength(25, Xamarin.Forms.GridUnitType.Absolute)
     });
     this.RowDefinitions.Add(new Xamarin.Forms.RowDefinition {
         Height = new Xamarin.Forms.GridLength(5, Xamarin.Forms.GridUnitType.Absolute)
     });
     {
         LBname = new MyLabel("");
         LBname.SetBinding(MyLabel.TextProperty, new Xamarin.Forms.Binding("LBname"));
         this.Children.Add(new MyScrollView(ScrollOrientation.Horizontal)
         {
             Content = LBname
         }, 1, 0);
     }
     {
         AIprogress = new MyActivityIndicator();
         AIprogress.SetBinding(MyActivityIndicator.IsVisibleProperty, new Xamarin.Forms.Binding("AIvisible"));
         AIprogress.SetBinding(MyActivityIndicator.IsRunningProperty, new Xamarin.Forms.Binding("AIvisible"));
         this.Children.Add(AIprogress, 0, 1);
         MyGrid.SetColumnSpan(AIprogress, this.ColumnDefinitions.Count - 2);
     }
     {
         PBprogress = new MyProgressBar();
         PBprogress.SetBinding(MyProgressBar.IsVisibleProperty, new Xamarin.Forms.Binding("PBvisible"));
         PBprogress.SetBinding(MyProgressBar.ProgressProperty, new Xamarin.Forms.Binding("Progress"));
         this.Children.Add(PBprogress, 0, 1);
         MyGrid.SetColumnSpan(PBprogress, this.ColumnDefinitions.Count - 2);
     }
     {
         LBstatus = new MyLabel("");
         LBstatus.SetBinding(MyLabel.TextProperty, new Xamarin.Forms.Binding("LBstatus"));
         this.Children.Add(LBstatus, 2, 0);
     }
     {
         LBspeed = new MyLabel("1.404 MB/s");
         LBspeed.SetBinding(MyLabel.TextProperty, new Xamarin.Forms.Binding("LBspeed"));
         this.Children.Add(LBspeed, 3, 0);
     }
     {
         BTNmessage = new MyButton("");
         BTNmessage.SetBinding(MyButton.TextProperty, new Xamarin.Forms.Binding("BTNmessage"));
         BTNmessage.SetBinding(MyButton.IsEnabledProperty, new Xamarin.Forms.Binding("BTNmessageEnabled"));
         BTNmessage.SetBinding(MyButton.CommandProperty, new Xamarin.Forms.Binding("BTNmessageClicked"));
         this.Children.Add(BTNmessage, 4, 0);
         MyGrid.SetRowSpan(BTNmessage, 2);
     }
     {
         BTNcontrol = new MyButton("");
         BTNcontrol.SetBinding(MyButton.TextProperty, new Xamarin.Forms.Binding("BTNcontrol"));
         BTNcontrol.SetBinding(MyButton.IsEnabledProperty, new Xamarin.Forms.Binding("BTNcontrolEnabled"));
         BTNcontrol.SetBinding(MyButton.CommandProperty, new Xamarin.Forms.Binding("BTNcontrolClicked"));
         this.Children.Add(BTNcontrol, 5, 0);
         MyGrid.SetRowSpan(BTNcontrol, 2);
     }
 }