public habit_data_modification(Recurring habit) { habit_data_ = null; InitializeComponent(); data_entry = new DataSubmissions.Base_Data_Entry(habit); maincontent.Content = data_entry.Content; }
public habit_data_modification(Habit_Data habit_data) { habit_data_ = habit_data; InitializeComponent(); data_entry = new DataSubmissions.Base_Data_Entry(habit_data); maincontent.Content = data_entry.Content; }
protected override async void OnAppearing() { base.OnAppearing(); data_entry = new DataSubmissions.Base_Data_Entry(combobox.Text, this); Example1.Content = data_entry.Content; this.refresh(); }
public Home() { InitializeComponent(); combobox = new SfComboBox(); combobox.DataSource = App.Database.GetStashesNames(); data_entry = new DataSubmissions.Base_Data_Entry(combobox.Text, this); Example1.Content = data_entry.Content; Add_stash = new Button(); Add_stash.Text = "+"; combobox.HorizontalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand; // combobox.WidthRequest = 260; Add_stash.HorizontalOptions = Xamarin.Forms.LayoutOptions.Start; combobox_holder = new StackLayout(); combobox_holder.Orientation = Xamarin.Forms.StackOrientation.Horizontal; combobox.MaximumDropDownHeight = 150; combobox_holder.Children.Add(combobox); combobox.ItemPadding = 0; Add_stash.Padding = 0; combobox_holder.Children.Add(Add_stash); combobox.SelectionChanged += comboBox1_SelectedItemChanged; Add_stash.BackgroundColor = Xamarin.Forms.Color.Transparent; combobox_holder.HorizontalOptions = Xamarin.Forms.LayoutOptions.Center; Add_stash.HorizontalOptions = Xamarin.Forms.LayoutOptions.Start; Add_stash.Clicked += Create_Stash; MainGrid.RowDefinitions.Insert(1, new RowDefinition { Height = new GridLength(5, GridUnitType.Auto) }); _query_selector = new query_attrs(DateTime.Today.AddDays(-7), DateTime.Today.AddDays(7), this); MainGrid.Children.Add(_query_selector, 1, 1); MainGrid.Children.Add(combobox, 1, 2); MainGrid.Children.Add(Add_stash, 2, 2); StackLayout hider = new StackLayout(); hider.BackgroundColor = Xamarin.Forms.Color.LightBlue; hider.Orientation = Xamarin.Forms.StackOrientation.Horizontal; hider.HorizontalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand; Label new_dec = new Label(); new_dec.Text = "New entry"; Switch switchControl = new Switch { IsToggled = true }; switchControl.Toggled += switch_OnToggled; switchControl.IsToggled = false; new_dec.TextColor = Xamarin.Forms.Color.White; new_dec.FontSize = 20; hider.Children.Add(new_dec); hider.Children.Add(switchControl); new_dec.HorizontalOptions = Xamarin.Forms.LayoutOptions.End; switchControl.HorizontalOptions = Xamarin.Forms.LayoutOptions.EndAndExpand; forecast = new Analytics.Forecast(); StackLayout forecast_hider = new StackLayout(); forecast_hider.BackgroundColor = Xamarin.Forms.Color.LightBlue; forecast_hider.Orientation = Xamarin.Forms.StackOrientation.Horizontal; forecast_hider.HorizontalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand; Label show_forecast = new Label(); show_forecast.TextColor = Xamarin.Forms.Color.White; show_forecast.FontSize = 20; show_forecast.Text = "Plot Data"; Switch forecast_switchControl = new Switch { IsToggled = true }; forecast_switchControl.Toggled += show_plot; forecast_switchControl.IsToggled = false; forecast_hider.Children.Add(show_forecast); forecast_hider.Children.Add(forecast_switchControl); show_forecast.HorizontalOptions = Xamarin.Forms.LayoutOptions.End; forecast_switchControl.HorizontalOptions = Xamarin.Forms.LayoutOptions.EndAndExpand; main_form.Children.Insert(1, hider); main_form.Children.Insert(3, forecast_hider); main_form.Children.Insert(4, forecast); forecast.HeightRequest = 300; forecast_hider.MinimumHeightRequest = hider.Height; this.nullcb(); OnAppearing(); }