| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Xamarin.Forms;
- using Xamarin.Forms.Xaml;
- namespace comal.timesheets
- {
- public delegate void FrameButtonClicked();
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class FrameButton : ContentView
- {
- public event FrameButtonClicked OnFrameButtonClicked;
- public string Data { get; set; }
- public string ExtraData { get; set; }
- public FrameButton()
- {
- InitializeComponent();
- }
- void Button_Clicked(object sender, EventArgs e)
- {
- OnFrameButtonClicked?.Invoke();
- }
- public void SetButtonText(string text)
- {
- button.Text = text;
- }
- public void SetImage(ImageSource src)
- {
- row1.Height = 300;
- Image image = new Image();
- if (GlobalVariables.DeviceString == "I" || GlobalVariables.DeviceString == "A")
- {
- image.HeightRequest = 600;
- image.WidthRequest = 600;
- }
- else
- {
- image.HeightRequest = 300;
- image.WidthRequest = 300;
- }
- image.HorizontalOptions = LayoutOptions.CenterAndExpand;
- image.VerticalOptions = LayoutOptions.CenterAndExpand;
- image.Source = src;
- image.SetValue(Grid.RowProperty, 1);
- grid.Children.Add(image);
- }
- }
- }
|