public BuildingEntryPage(PPMAppDB database) { InitializeComponent(); Title = "Add Building"; _database = database; this.dataForm.Source = bentry; this.dataForm.ValidationMode = ValidationMode.OnLostFocus; this.dataForm.CommitMode = CommitMode.Manual; this.dataForm.PropertyDataSourceProvider = new BuildingEntryDSP(); this.dataForm.RegisterEditor("ClientName", EditorType.PickerEditor); this.dataForm.RegisterEditor("Institution", EditorType.PickerEditor); this.dataForm.RegisterEditor("Building", EditorType.PickerEditor); this.dataForm.RegisterEditor("Job", EditorType.PickerEditor); this.dataForm.RegisterEditor("Status", EditorType.PickerEditor); this.dataForm.RegisterEditor("Photo", EditorType.TextEditor); this.dataForm.RegisterEditor("Detail", EditorType.TextEditor); var positive = "CCFF00"; var negative = "FF004C"; var style = new DataFormEditorStyle { Background = new Background { Fill = Color.Transparent, StrokeColor = Color.FromHex(positive), StrokeWidth = 1 //StrokeLocation = Location.Bottom }, HeaderFontSize = 15, HeaderForeground = Color.White, FeedbackFontSize = 10, //PositiveFeedbackImage = ImageSource.FromFile("success.png"), NegativeFeedbackForeground = Color.FromHex(negative), NegativeFeedbackBackground = new Background { Fill = Color.FromHex(50 + negative), StrokeColor = Color.FromHex(negative), StrokeWidth = 2 //StrokeLocation = Location.All }, Height = 60, FeedbackImageSize = new Size(10, 10), }; dataForm.EditorStyle = style; dataForm.BackgroundColor = Color.FromHex("3D6978"); var toolbarItem = new ToolbarItem { Name = "See All", Command = new Command(() => Navigation.PushAsync(new BuildingListPage())) }; ToolbarItems.Add(toolbarItem); NavigationPage.SetHasNavigationBar(this, true); }
public DataFormView() { this.InitializeComponent(); // The PageRenderer by default sets BackgroundColor for the NavigationPage to White: https://github.com/xamarin/Xamarin.Forms/blob/ec380e4e24b213500a01992b3e10c5e8a1af3b3a/Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs#L537 // Because of that a Background should be set in order to make the StatusBar in iOS be visible when the mode is either dark or light. this.SetAppThemeColor(ContentPage.BackgroundColorProperty, (Color)App.Current.Resources["DarkBackgroundColorLight"], (Color)App.Current.Resources["DarkBackgroundColorDark"]); this.dataForm.PropertyDataSourceProvider = new UserPropertyDataSourceProvider(); foreach (var property in typeof(Reservation).GetTypeInfo().DeclaredProperties) { this.dataForm.RegisterEditor(property.Name, EditorType.Custom); } this.dataForm.GroupHeaderStyle = new DataFormGroupHeaderStyle { IsCollapsible = false }; this.dataForm.GroupLayoutDefinition = new DataFormGroupGridLayoutDefinition(); var style = new DataFormEditorStyle { FeedbackFontSize = 10, PositiveFeedbackBackground = Color.Transparent, }; if (Device.RuntimePlatform == Device.Android) { style.HeaderFontSize = 12; } this.dataForm.EditorStyle = style; var cancelEditGesture = new TapGestureRecognizer(); cancelEditGesture.Tapped += this.CancelButton_Clicked; this.cancelButton.GestureRecognizers.Add(cancelEditGesture); var addReservationGesture = new TapGestureRecognizer(); addReservationGesture.Tapped += this.DoneButton_Clicked; this.doneButton.GestureRecognizers.Add(addReservationGesture); var cancelReservationGesture = new TapGestureRecognizer(); cancelReservationGesture.Tapped += CancelReservationClicked; this.cancelReservationButton.GestureRecognizers.Add(cancelReservationGesture); }
public DataFormView() { this.InitializeComponent(); this.dataForm.PropertyDataSourceProvider = new UserPropertyDataSourceProvider(); foreach (var property in typeof(Reservation).GetTypeInfo().DeclaredProperties) { this.dataForm.RegisterEditor(property.Name, EditorType.Custom); } this.dataForm.GroupHeaderStyle = new DataFormGroupHeaderStyle { IsCollapsible = false }; this.dataForm.GroupLayoutDefinition = new DataFormGroupGridLayoutDefinition(); var style = new DataFormEditorStyle { FeedbackFontSize = 10, PositiveFeedbackBackground = Color.Transparent, }; if (Device.RuntimePlatform == Device.Android) { style.HeaderFontSize = 12; } this.dataForm.EditorStyle = style; var cancelEditGesture = new TapGestureRecognizer(); cancelEditGesture.Tapped += this.CancelButton_Clicked; this.cancelButton.GestureRecognizers.Add(cancelEditGesture); var addReservationGesture = new TapGestureRecognizer(); addReservationGesture.Tapped += this.DoneButton_Clicked; this.doneButton.GestureRecognizers.Add(addReservationGesture); var cancelReservationGesture = new TapGestureRecognizer(); cancelReservationGesture.Tapped += CancelReservationClicked; this.cancelReservationButton.GestureRecognizers.Add(cancelReservationGesture); }
public DataFormStylingEditorsCSharp() { var dataForm = new RadDataForm(); dataForm.Source = new Customer(); // >> dataform-styling-editors var positive = "CCFF00"; var negative = "FF004C"; var style = new DataFormEditorStyle { Background = new Background { Fill = Color.FromHex("3D6978"), StrokeColor = Color.FromHex(positive), StrokeWidth = 2, StrokeLocation = Location.Bottom }, HeaderFontSize = 17, HeaderForeground = Color.White, FeedbackFontSize = 13, PositiveFeedbackImage = ImageSource.FromFile("success.png"), NegativeFeedbackImage = ImageSource.FromFile("fail.png"), NegativeFeedbackForeground = Color.FromHex(negative), NegativeFeedbackBackground = new Background { Fill = Color.FromHex(30 + negative), StrokeColor = Color.FromHex(negative), StrokeWidth = 2, StrokeLocation = Location.All }, Height = 70, FeedbackImageSize = new Size(10, 10), }; dataForm.EditorStyle = style; dataForm.BackgroundColor = Color.FromHex("345966"); // << dataform-styling-editors this.Content = dataForm; }