私は現在、作業環境としてXamarin Formsを使用している私のプロジェクトにContentPage.csを持っています。コードの最後にあるボタンにOnClickを追加できるかどうかは疑問でした。どんな助けもありがとうございます。ありがとうございました。XamarinフォームボタンOnClick
using System;
Xamarin.Formsを使用。
名前空間DebuggerTestAndroidIOS { パブリッククラスVSParameters:ContentPage { 公共VSParameters() { コンテンツは=新しいStackLayout { 子供= { 新しいStackLayout {BackgroundColorを= Color.FromHex( "0ADF80")、 子供= {
new Label { Text = PatientInformation.PatientName,
TextColor= Color.White,
FontSize = 25
}
}
},
//Patient Information Stack Layout
new StackLayout{ Orientation = StackOrientation.Horizontal,
Children = {
//Patient Image, sex and date of birth
new StackLayout{Orientation = StackOrientation.Vertical, Padding = new Thickness (30, 0, 0, 0),
Children = {
new Image {Source = "UserMale.png"},
new Label {Text = "Sex: " + PatientInformation.Sex , FontSize = 15, TextColor= Color.Black},
new Label{Text = "Date of Birth: " + (PatientInformation.DateOfBirth).ToString(), FontSize = 15, TextColor= Color.Black}
}
},
//other patient information
new StackLayout{Orientation = StackOrientation.Vertical,
Children = {
new Label {Text = "ID: " + PatientInformation.PatientID, FontSize = 15, TextColor= Color.Black},
new Label{Text = "Room: " + PatientInformation.RoomNumber, FontSize = 15, TextColor= Color.Black},
new Label {Text = "Bed: " + PatientInformation.BedID, FontSize = 15, TextColor= Color.Black},
new Label{Text = "Primary Doctor: " + PatientInformation.PrimaryDoctor, FontSize = 15, TextColor= Color.Black}
}
}
}
},
new StackLayout {Orientation = StackOrientation.Horizontal, Padding = new Thickness(30, 0, 0, 0),
Children = {
new StackLayout{Orientation = StackOrientation.Vertical,
Children = {
new Label {Text ="Heart Rate", FontSize= 20, TextColor = Color.FromHex("D95D65"), HorizontalOptions = LayoutOptions.StartAndExpand},
new Label{Text=""},
new Label {Text ="Temperature", FontSize= 20, TextColor = Color.FromHex("08CD78"), HorizontalOptions = LayoutOptions.StartAndExpand},
new Label{Text=""},
new Label {Text ="Respiration Rate", FontSize= 20, TextColor = Color.FromHex("08CD78"), HorizontalOptions = LayoutOptions.StartAndExpand},
new Label {Text ="Blood Pressure: ", FontSize= 20, TextColor = Color.FromHex("D95D65"), HorizontalOptions = LayoutOptions.StartAndExpand},
new Label{Text=""},
new Label{Text=""},
new Label {Text ="Systolic", FontSize= 18, TextColor = Color.FromHex("D95D65")},
new Label {Text ="Diastolic", FontSize= 18, TextColor = Color.FromHex("D95D65")}
}
},
new StackLayout{Orientation = StackOrientation.Vertical,
Children = {
new Entry {TextColor = Color.Black, BackgroundColor = Color.FromRgb(231, 231, 231), WidthRequest= 100},
new Entry {TextColor = Color.Black, BackgroundColor = Color.FromRgb(231, 231, 231), WidthRequest= 100},
new Entry {TextColor = Color.Black, BackgroundColor = Color.FromRgb(231, 231, 231), WidthRequest= 100},
new Label{Text=""},
new Label{Text=""},
new Label{Text=""},
new Entry {TextColor = Color.Black, BackgroundColor = Color.FromRgb(231, 231, 231), WidthRequest= 100},
new Entry {TextColor = Color.Black, BackgroundColor = Color.FromRgb(231, 231, 231), WidthRequest= 100},
}
},
}
},
new StackLayout{HorizontalOptions = LayoutOptions.Center,
Children = {
new Button{Text = "Add parameters"}
}
}
}
};
}
}
}
は見え –
はい、私がしました。あなたのコメントをありがとう! – Lala