public CardViewModel() { Data.Add(new CardViewData { Name = "Fabric White Sofa", Price = "$99", Offer = "35% Offer", ImagePath = ImagePathConverter.GetImageSource("SampleBrowser.Cards.Card_hall2.png"), }); Data.Add(new CardViewData { Name = "Dinning Chair", Price = "$80", Offer = "15% Offer", ImagePath = ImagePathConverter.GetImageSource("SampleBrowser.Cards.Card_chair.png"), }); Data.Add(new CardViewData { Name = "Semi Fabric Sofa", Price = "$99", Offer = "25% Offer", ImagePath = ImagePathConverter.GetImageSource("SampleBrowser.Cards.Card_sofa.png"), }); }
private void SetImages() { ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.sofa2.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.hall.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.sofa.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.chair.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.hall2.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.whiteshirt.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.shirt.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.tshirt.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.redcoat.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.silvercoat.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.canvas.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.graycanvas.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.boots.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.blackshoe.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.leather.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.orange.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.blueberry.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.apple.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.strawberry.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.banana.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.friends.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.robot.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.minion.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.train.png")); ImageCollection.Add(ImagePathConverter.GetImageSource("SampleBrowser.SfTabView.van.png")); }
/// <summary> /// Month inline appointment loaded event /// </summary> /// <param name="sender">return the object</param> /// <param name="e">Month Inline Appointment Loaded Event Args</param> private void BindableOnMonthInlineAppointmentLoadedEvent(object sender, MonthInlineAppointmentLoadedEventArgs e) { Button button = new Button(); button.TextColor = Color.White; button.VerticalOptions = LayoutOptions.FillAndExpand; button.HorizontalOptions = LayoutOptions.FillAndExpand; if (Device.RuntimePlatform == "UWP") { button.WidthRequest = 250; button.HeightRequest = 50; } if ((e.appointment as ScheduleAppointment).Subject == "Conference") { button.BackgroundColor = Color.FromHex("#FFD80073"); button.Text = "Conference"; button.Image = ImagePathConverter.GetImageSource("SampleBrowser.SfSchedule.conference_schedule.png"); } else if ((e.appointment as ScheduleAppointment).Subject == "Checkup") { button.BackgroundColor = Color.FromHex("#FFA2C139"); button.Text = "Checkup"; button.Image = ImagePathConverter.GetImageSource("SampleBrowser.SfSchedule.stethoscope_schedule.png"); } if (!(e.appointment as ScheduleAppointment).IsAllDay) { e.view = button; } }
/// <summary> /// Raised to set read only property and cancel the some properties. /// </summary> /// <param name="sender">Sender object</param> /// <param name="e">Contains arguments of auto generating data form event</param> private void OnAutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e) { if (e.DataFormItem != null) { if (!this.viewModel.RefreshLayout) { if (e.DataFormItem.Name.Equals("MiddleName") || e.DataFormItem.Name.Equals("LastName") || e.DataFormItem.Name.Equals("Notes")) { e.Cancel = true; } } if (e.DataFormItem.Name.Equals("ContactNumber")) { var dataFormMaskedItem = e.DataFormItem as DataFormMaskedEditTextItem; dataFormMaskedItem.KeyBoard = Keyboard.Telephone; dataFormMaskedItem.CutCopyMaskFormat = Syncfusion.XForms.MaskedEdit.MaskFormat.ExcludePromptAndLiterals; dataFormMaskedItem.SkipLiterals = true; dataFormMaskedItem.ValueMaskFormat = Syncfusion.XForms.MaskedEdit.MaskFormat.ExcludePromptAndLiterals; e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.DataForm_Phone.png"); } else if (e.DataFormItem.Name.Equals("Email")) { (e.DataFormItem as DataFormTextItem).KeyBoard = Keyboard.Email; e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Email.png"); } else if (e.DataFormItem.Name.Equals("ContactName")) { e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.LabelContactName.png"); } else if (e.DataFormItem.Name.Equals("ContactImage")) { e.Cancel = true; } else if (e.DataFormItem.Name.Equals("BirthDate")) { e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.BirthDate.png"); } else if (e.DataFormItem.Name.Equals("GroupName")) { e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Group.png"); } else if (e.DataFormItem.Name.Equals("Address")) { e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Address.png"); } else if (e.DataFormItem.Name.Equals("Notes")) { e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Notes.png"); } this.ChangeItemOrder(e.DataFormItem); } if (e.DataFormGroupItem != null) { e.DataFormGroupItem.AllowExpandCollapse = false; } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (Device.RuntimePlatform == "UWP") { return(ImagePathConverter.GetImageSource(("SampleBrowser.SfSchedule." + value.ToString() + ".png").ToString())); } return(value); }
/// <summary> /// Raised to set read only property and cancel the some properties. /// </summary> /// <param name="sender">Sender object</param> /// <param name="e">Contains arguments of auto generating data form event</param> private void OnAutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e) { if (e.DataFormItem != null) { if (!this.viewModel.RefreshLayout) { if (e.DataFormItem.Name.Equals("MiddleName") || e.DataFormItem.Name.Equals("LastName") || e.DataFormItem.Name.Equals("Notes")) { e.Cancel = true; } } if (e.DataFormItem.Name.Equals("ContactNumber")) { (e.DataFormItem as DataFormTextItem).KeyBoard = Keyboard.Numeric; e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.DataForm_Phone.png"); } else if (e.DataFormItem.Name.Equals("Email")) { (e.DataFormItem as DataFormTextItem).KeyBoard = Keyboard.Email; e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Email.png"); } else if (e.DataFormItem.Name.Equals("ContactName")) { e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.LabelContactName.png"); } else if (e.DataFormItem.Name.Equals("ContactImage")) { e.Cancel = true; } else if (e.DataFormItem.Name.Equals("BirthDate")) { e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.BirthDate.png"); } else if (e.DataFormItem.Name.Equals("GroupName")) { e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Group.png"); } else if (e.DataFormItem.Name.Equals("Address")) { e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Address.png"); } else if (e.DataFormItem.Name.Equals("Notes")) { e.DataFormItem.ImageSource = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Notes.png"); } } if (e.DataFormGroupItem != null) { e.DataFormGroupItem.AllowExpandCollapse = false; } }
/// <summary> /// Initializes and sets the initial value for the floating action button image. /// </summary> public void Initialize() { this.VerticalOptions = LayoutOptions.EndAndExpand; this.WidthRequest = 40; this.HeightRequest = 40; this.Source = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.Add.png"); this.HorizontalOptions = LayoutOptions.EndAndExpand; GestureRecognizers.Add(new TapGestureRecognizer { Command = this.TransitionCommand }); }
public Archive_Default(ObservableCollection <Message> items, string title) { InitializeComponent(); headerGradiant.WidthRequest = Core.SampleBrowser.ScreenWidth; headerLabel.Text = title; listView.ItemsSource = items; btn.BackgroundColor = Color.FromHex("#00a0e1"); btn.HeightRequest = 40; btn.WidthRequest = 40; btn.Text = "H"; btn.FontSize = 16; if (Device.RuntimePlatform == Device.iOS && Device.Idiom == TargetIdiom.Tablet) { headingGrid.Padding = new Thickness(10, 10, 0, 10); } if (Device.RuntimePlatform == Device.Android) { if (Device.Idiom == TargetIdiom.Tablet) { btn.WidthRequest = 60; } btn.FontFamily = "navigation.ttf#navigation"; recentButton.Text = "\uE823"; headerLabel.WidthRequest = ((Core.SampleBrowser.ScreenWidth * Core.SampleBrowser.Density) - (Core.SampleBrowser.Density * btn.WidthRequest)); recentButton.WidthRequest = 60; recentButton.FontFamily = "segoe-mdl2-assets.ttf#segoe-mdl2-assets"; } else if (Device.RuntimePlatform == Device.UWP) { btn.FontSize = 21; btn.Text = "\xE700"; btn.FontFamily = "Segoe MDL2 Assets"; btn.HeightRequest = 50; btn.WidthRequest = 50; recentButton.Image = (FileImageSource)ImageSource.FromFile(ImagePathConverter.GetImageSource("SampleBrowser.SfNavigationDrawer.recent.png")); recentButton.WidthRequest = 50; recentButton.HeightRequest = 50; } else { btn.Image = (FileImageSource)ImageSource.FromFile(ImagePathConverter.GetImageSource("SampleBrowser.SfNavigationDrawer.burgericon.png")); btn.WidthRequest = 50; btn.HeightRequest = 50; recentButton.Image = (FileImageSource)ImageSource.FromFile(ImagePathConverter.GetImageSource("SampleBrowser.SfNavigationDrawer.recent.png")); recentButton.WidthRequest = 50; recentButton.HeightRequest = 50; } btn.TextColor = Color.White; }
private void AddData() { Data.Add(new CardData { Name = "Leather Black Sofa", Price = 99.50, Rating = "4.9", Offer = "5% Offer", ImagePath = ImagePathConverter.GetImageSource("SampleBrowser.Cards.Card_sofa2.png"), Description = "Warranty covers up to 5 years. This frame’s special feature is its bookcase headboard." }); Data.Add(new CardData { Name = "Wooden Standing Drawer", Price = 199.50, Rating = "3.9", Offer = "50% Offer", ImagePath = ImagePathConverter.GetImageSource("SampleBrowser.Cards.Card_hall.png"), Description = "\"This versatile wardrobe strikes the perfect balance between style and functionality. Equipped with a mirror and multiple shelves." }); Data.Add(new CardData { Name = "Semi Fabric Sofa", Price = 299.50, Rating = "2.9", Offer = "25% Offer", ImagePath = ImagePathConverter.GetImageSource("SampleBrowser.Cards.Card_sofa.png"), Description = "This sofa’s frame is made of engineered wood, which is stable and climate-resistant. Protected with a scratch-resistant finish." }); Data.Add(new CardData { Name = "Dinning Chair", Price = 399.50, Rating = "4.9", Offer = "15% Offer", ImagePath = ImagePathConverter.GetImageSource("SampleBrowser.Cards.Card_chair.png"), Description = "Made of plywood to reduce weight and costs, these end tables still look like solid cherry." }); Data.Add(new CardData { Name = "Fabric White Sofa", Price = 99.50, Rating = "3.9", Offer = "35% Offer", ImagePath = ImagePathConverter.GetImageSource("SampleBrowser.Cards.Card_hall2.png"), Description = "Lightweight but sturdy, this nightstand is made of particleboard with a maple veneer or painted white." }); }
/// <summary> /// Occurs when new item is added in list view. /// </summary> /// <param name="listView">List view object.</param> private void OnAdd(object listView) { var sflistView = listView as Syncfusion.ListView.XForms.SfListView; var contactInfo = new ContactInfo() { ContactImage = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.LabelContactName.png") }; var viewModel = sflistView.BindingContext as ContactListViewModel; viewModel.SelectedItem = contactInfo as ContactInfo; this.refreshLayout = true; this.IsNewContact = true; sflistView.Navigation.PushAsync(new DataFormPage() { BindingContext = sflistView.BindingContext, Title = "Contact Form" }); }
public CircularCustomContent() { InitializeComponent(); this.CustomContentCircularProgressBar.AnimationDuration = 0; this.VideoPlayerProgressBar.AnimationDuration = 2000; this.SetCustomContentProgress(); string path; if (Device.OS == TargetPlatform.Windows) path = "SampleBrowser.SfProgressBar.Images/"; else path = "SampleBrowser.SfProgressBar."; this.PlayButton.Image = ImagePathConverter.GetImageSource(path + "SfProgressPlay.png"); this.PauseButton.Image = ImagePathConverter.GetImageSource(path + "SfProgressPause.png"); }
public ObservableCollection <ContactInfo> GetContactDetails(int count) { ObservableCollection <ContactInfo> customerDetails = new ObservableCollection <ContactInfo>(); for (int i = 0; i < 25; i++) { var details = new ContactInfo() { ContactType = ContactInfo.ContactsType.Business, ContactNumber = random.Next(100000, 400000).ToString(), ContactName = CustomerNames[i], ContactImage = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm." + "Contact" + (i % 9) + ".png"), }; customerDetails.Add(details); } return(customerDetails); }
protected async override void OnAttachedTo(SampleView bindable) { await Task.Delay(200); customView = bindable.FindByName <Grid>("gridLayout"); transparent = bindable.FindByName <Grid>("Illustrationgrid"); myGrid = new Grid(); myGrid.VerticalOptions = LayoutOptions.FillAndExpand; myGrid.HorizontalOptions = LayoutOptions.FillAndExpand; myGrid.RowDefinitions = new RowDefinitionCollection { new RowDefinition { Height = new GridLength(1.1, GridUnitType.Star) }, new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }, }; myGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }); myGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1.8, GridUnitType.Star) }); myGrid.Children.Add(new Image() { Opacity = 1.0, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Source = ImagePathConverter.GetImageSource("SampleBrowser.SfDataForm.TapEditIllustration.png") }, 1, 1); myGrid.BackgroundColor = Color.Transparent; myGrid.GestureRecognizers.Add(new TapGestureRecognizer() { Command = new Command(Collapse) }); customView.Children.Add(myGrid); base.OnAttachedTo(bindable); }
public KanbanCustomViewModel() { LastOrderID = 16365; string path = ""; Cards = new ObservableCollection <CustomKanbanModel>(); if (Device.RuntimePlatform == Device.UWP) { path = "SampleBrowser.SfKanban.Images/"; } else { path = "SampleBrowser.SfKanban."; } Cards.Add( new CustomKanbanModel() { ID = 1, Title = "Margherita", ImageURL = ImagePathConverter.GetImageSource(path + "margherita.png"), Category = "Menu", Rating = 4, Description = "The classic. Fresh tomatoes, garlic, olive oil, and basil. For pizza purists and minimalists only.", Tags = new string[] { "Cheese" } } ); Cards.Add( new CustomKanbanModel() { ID = 2, Title = "Double Cheese", ImageURL = ImagePathConverter.GetImageSource(path + "doublecheesemargherita.png"), Category = "Menu", Rating = 5, Description = "The minimalist classic with a double helping of cheese", Tags = new string[] { "Cheese" } } ); Cards.Add( new CustomKanbanModel() { ID = 3, Title = "Bucolic Pie", ImageURL = ImagePathConverter.GetImageSource(path + "bucolicpie.png"), Category = "Menu", Rating = 4.5f, Description = "The pizza you daydream about to escape city life. Onions, peppers, and tomatoes.", Tags = new string[] { "Onions", "Capsicum" } } ); Cards.Add( new CustomKanbanModel() { ID = 4, Title = "Bumper Crop", Rating = 3.25f, ImageURL = ImagePathConverter.GetImageSource(path + "bumpercrop.png"), Category = "Menu", Description = "Can’t get enough veggies? Eat this. Carrots, mushrooms, potatoes, and way more", Tags = new string[] { "Tomato", "Mushroom" } } ); Cards.Add( new CustomKanbanModel() { ID = 5, Title = "Spice of Life", ImageURL = ImagePathConverter.GetImageSource(path + "spiceoflife.png"), Category = "Menu", Rating = 4.75f, Description = "Thrill-seeking, heat-seeking pizza people only. It’s hot. Trust us.", Tags = new string[] { "Corn", "Gherkins" } } ); Cards.Add( new CustomKanbanModel() { ID = 6, Title = "Very Nicoise", ImageURL = ImagePathConverter.GetImageSource(path + "verynicoise.png"), Category = "Menu", Rating = 3.75f, Description = "Anchovies, Dijon vinaigrette, shallots, red peppers, and potatoes.", Tags = new string[] { "Red pepper", "Capsicum" } } ); Cards.Add( new CustomKanbanModel() { ID = 7, Title = "Salad Daze", ImageURL = ImagePathConverter.GetImageSource(path + "saladdaze.png"), Category = "Menu", Rating = 5, Description = "Pretty much salad on a pizza. Broccoli, olives, cherry tomatoes, red onion.", Tags = new string[] { "Onions", "Jalapeno" } } ); Cards.Add( new CustomKanbanModel() { ID = 4, Title = "Bumper Crop", ImageURL = ImagePathConverter.GetImageSource(path + "bumpercrop.png"), Category = "Ready to Serve", OrderID = "Order ID - #16362", Description = "Can’t get enough veggies? Eat this. Carrots, mushrooms, potatoes, and way more", Tags = new string[] { "Tomato", "Mushroom" } } ); Cards.Add( new CustomKanbanModel() { ID = 5, Title = "Spice of Life", ImageURL = ImagePathConverter.GetImageSource(path + "spiceoflife.png"), Category = "Ready to Serve", OrderID = "Order ID - #16363", Description = "Thrill-seeking, heat-seeking pizza people only. It’s hot. Trust us.", Tags = new string[] { "Corn", "Gherkins" } } ); Cards.Add( new CustomKanbanModel() { ID = 3, Title = "Bucolic Pie", ImageURL = ImagePathConverter.GetImageSource(path + "bucolicpie.png"), Category = "Door Delivery", OrderID = "Order ID - #16361", Description = "The pizza you daydream about to escape city life. Onions, peppers, and tomatoes.", Tags = new string[] { "Onions", "Capsicum" } } ); Cards.Add( new CustomKanbanModel() { ID = 6, Title = "Very Nicoise", ImageURL = ImagePathConverter.GetImageSource(path + "verynicoise.png"), Category = "Dining", OrderID = "Order ID - #16364", AnimationDuration = 60000, Description = "Anchovies, Dijon vinaigrette, shallots, red peppers, and potatoes.", Tags = new string[] { "Red pepper", "Capsicum" } } ); Cards.Add( new CustomKanbanModel() { ID = 2, Title = "Double Cheese", ImageURL = ImagePathConverter.GetImageSource(path + "doublecheesemargherita.png"), Category = "Delivery", OrderID = "Order ID - #16365", AnimationDuration = 60000, Description = "The minimalist classic with a double helping of cheese", Tags = new string[] { "Cheese" } } ); }
public Rating_Customization() { InitializeComponent(); if (Device.OS == TargetPlatform.Android) { rating.ItemSize = 55; rating.ItemSpacing = 5; description.FontSize = 12; mButton.HeightRequest = 40; bottomStack.Margin = new Thickness(0, 5, 0, 0); } else if (Device.OS == TargetPlatform.iOS) { rating.ItemSize = 50; bottomStack.Padding = new Thickness(0, 0, 0, 0); rating.HeightRequest = 50; } Votes.Add(1); Votes.Add(2); Votes.Add(2); Votes.Add(3); Votes.Add(4); Votes.Add(3); Votes.Add(5); Votes.Add(5); Votes.Add(5); Votes.Add(5); rating.ValueChanged += Rating_ValueChanged; ObservableCollection <SfRatingItem> customItems = new ObservableCollection <SfRatingItem>(); customItems.Add(new SfRatingItem() { SelectedView = new CustomRatingView(ImagePathConverter.GetImageSource("SampleBrowser.SfRating.Angry_selected.png"), "10%", "Angry", this), UnSelectedView = new CustomRatingView(ImagePathConverter.GetImageSource("SampleBrowser.SfRating.Angry_Unselected.png"), "10%", "Angry", this) }); customItems.Add(new SfRatingItem() { SelectedView = new CustomRatingView(ImagePathConverter.GetImageSource("SampleBrowser.SfRating.UnHappy_selected.png"), "20%", "Unhappy", this), UnSelectedView = new CustomRatingView(ImagePathConverter.GetImageSource("SampleBrowser.SfRating.UnHappy_Unselected.png"), "20%", "Unhappy", this) }); customItems.Add(new SfRatingItem() { SelectedView = new CustomRatingView(ImagePathConverter.GetImageSource("SampleBrowser.SfRating.Neutral_selected.png"), "20%", "Neutral", this), UnSelectedView = new CustomRatingView(ImagePathConverter.GetImageSource("SampleBrowser.SfRating.Neutral_Unselected.png"), "20%", "Neutral", this) }); customItems.Add(new SfRatingItem() { SelectedView = new CustomRatingView(ImagePathConverter.GetImageSource("SampleBrowser.SfRating.Happy_selected.png"), "10%", "Happy", this), UnSelectedView = new CustomRatingView(ImagePathConverter.GetImageSource("SampleBrowser.SfRating.Happy_Unselected.png"), "10%", "Happy", this) }); customItems.Add(new SfRatingItem() { SelectedView = new CustomRatingView(ImagePathConverter.GetImageSource("SampleBrowser.SfRating.Excited_selected.png"), "40%", "Excited", this), UnSelectedView = new CustomRatingView(ImagePathConverter.GetImageSource("SampleBrowser.SfRating.Excited_Unselected.png"), "40%", "Excited", this) }); rating.Items = customItems; //headLineText.Text = "Linda, USA Sports . Wednesday ," + DateTime.Now.ToString("M") + ", " + DateTime.Now.Year.ToString(); if (Device.OS == TargetPlatform.Windows) { rating.ItemSize = 55; rating.ItemSpacing = 5; //countButton.BackgroundColor = Color.FromHex("#FF5500"); //maincontent.Height = 180; } if (Device.OS == TargetPlatform.Windows && Device.Idiom == TargetIdiom.Phone) { description.FontSize = 11; // maincontent.Height = 100; } mButton.BackgroundColor = Color.White; mButton.TextColor = Color.Black; }
public Rotator_Default() { InitializeComponent(); width = Core.SampleBrowser.ScreenWidth; sfRotator.BindingContext = new RotatorViewModel(); SettingsWindow(); sfRotator.SelectedIndex = 1; ratingImage.Margin = new Thickness(10, 0, 2, 0); if (Device.OS == TargetPlatform.Windows) { List <SfRotatorItem> rotatoritems = new List <SfRotatorItem>(); rotatoritems.Add(new SfRotatorItem() { Image = ImagePathConverter.GetImageSource("SampleBrowser.SfRotator.movie1.png") }); rotatoritems.Add(new SfRotatorItem() { Image = ImagePathConverter.GetImageSource("SampleBrowser.SfRotator.movie2.png") }); rotatoritems.Add(new SfRotatorItem() { Image = ImagePathConverter.GetImageSource("SampleBrowser.SfRotator.movie3.png") }); rotatoritems.Add(new SfRotatorItem() { Image = ImagePathConverter.GetImageSource("SampleBrowser.SfRotator.movie6.png") }); rotatoritems.Add(new SfRotatorItem() { Image = ImagePathConverter.GetImageSource("SampleBrowser.SfRotator.movie4.png") }); rotatoritems.Add(new SfRotatorItem() { Image = ImagePathConverter.GetImageSource("SampleBrowser.SfRotator.movie5.png") }); sfRotator.ItemsSource = null; sfRotator.ItemTemplate = null; sfRotator.DataSource = rotatoritems; mButton.FontSize = 22; xLButton.FontSize = 22; sButton.FontSize = 22; xButton.FontSize = 22; if (Device.Idiom != TargetIdiom.Phone) { maingrid.HorizontalOptions = LayoutOptions.Center; grid.HorizontalOptions = LayoutOptions.Start; grid.Margin = new Thickness(10); header.HorizontalOptions = LayoutOptions.Start; header.Margin = new Thickness(10, 0, 10, 0); header.WidthRequest = 550; grid.WidthRequest = 550; controlsize.Height = 315; sfRotator.HeightRequest = 250; } else { controlsize.Height = 270; sfRotator.HeightRequest = 270; sfRotator.WidthRequest = 260; } } else if (Device.OS == TargetPlatform.Android) { root.HorizontalOptions = LayoutOptions.Center; } if (Device.OS == TargetPlatform.iOS) { sfRotator.NavigationStripPosition = NavigationStripPosition.Bottom; } sfRotator.HeightRequest = sfRotator.WidthRequest; mButton.BackgroundColor = sButton.BackgroundColor = xButton.BackgroundColor = xLButton.BackgroundColor = Color.White; mButton.TextColor = sButton.TextColor = xButton.TextColor = xLButton.TextColor = Color.Black; }
public ThemesViewModel() { string path = ""; if (Device.RuntimePlatform == Device.UWP) { path = "SampleBrowser.SfKanban.Images/"; } else { path = "SampleBrowser.SfKanban."; } Cards = new ObservableCollection <KanbanModel>(); Cards.Add( new KanbanModel() { ID = 1, Title = "iOS - 1", ImageURL = ImagePathConverter.GetImageSource(path + "Image8.png"), Category = "Open", Description = "Analyze customer requirements", Tags = new string[] { "Bug", "Customer", "Release Bug" } } ); Cards.Add( new KanbanModel() { ID = 6, Title = "Xamarin - 6", ImageURL = ImagePathConverter.GetImageSource(path + "Image9.png"), Category = "Open", Description = "Show the retrived data from the server in grid control", Tags = new string[] { "Bug", "Customer", "Breaking Issue" } } ); Cards.Add( new KanbanModel() { ID = 3, Title = "iOS - 3", ImageURL = ImagePathConverter.GetImageSource(path + "Image10.png"), Category = "Open", Description = "Fix the filtering issues reported in safari", Tags = new string[] { "Bug", "Customer", "Breaking Issue" } } ); Cards.Add( new KanbanModel() { ID = 11, Title = "iOS - 11", ImageURL = ImagePathConverter.GetImageSource(path + "Image11.png"), Category = "Open", Description = "Add input validation for editing", Tags = new string[] { "Bug", "Customer", "Breaking Issue" } } ); Cards.Add( new KanbanModel() { ID = 15, Title = "Android - 15", Category = "Open", ImageURL = ImagePathConverter.GetImageSource(path + "Image12.png"), Description = "Arrange web meeting for cutomer requirement", Tags = new string[] { "Story", "Kanban" } }); Cards.Add( new KanbanModel() { ID = 3, Title = "Android - 3", Category = "Code Review", ImageURL = ImagePathConverter.GetImageSource(path + "Image13.png"), Description = "API Improvements", Tags = new string[] { "Bug", "Customer" } }); Cards.Add( new KanbanModel() { ID = 4, Title = "UWP - 4", ImageURL = ImagePathConverter.GetImageSource(path + "Image14.png"), Category = "Code Review", Description = "Enhance editing functionality", Tags = new string[] { "Story", "Kanban" } }); Cards.Add( new KanbanModel() { ID = 9, Title = "Xamarin - 9", ImageURL = ImagePathConverter.GetImageSource(path + "Image15.png"), Category = "Code Review", Description = "Improve application performance", Tags = new string[] { "Story", "Kanban" } } ); Cards.Add( new KanbanModel() { ID = 13, Title = "UWP - 13", ImageURL = ImagePathConverter.GetImageSource(path + "Image16.png"), Category = "In Progress", Description = "Add responsive support to applicaton", Tags = new string[] { "Story", "Kanban" } } ); Cards.Add( new KanbanModel() { ID = 17, Title = "Xamarin - 17", Category = "In Progress", ImageURL = ImagePathConverter.GetImageSource(path + "Image17.png"), Description = "Fix the issues reported in IE browser", Tags = new string[] { "Bug", "Customer" } } ); Cards.Add( new KanbanModel() { ID = 21, Title = "Xamarin - 21", Category = "In Progress", ImageURL = ImagePathConverter.GetImageSource(path + "Image18.png"), Description = "Improve performance of editing functionality", Tags = new string[] { "Bug", "Customer" } } ); Cards.Add( new KanbanModel() { ID = 19, Title = "iOS - 19", Category = "In Progress", ImageURL = ImagePathConverter.GetImageSource(path + "Image19.png"), Description = "Fix the issues reported by the customer", Tags = new string[] { "Bug" } } ); Cards.Add( new KanbanModel() { ID = 8, Title = "Android", Category = "Code Review", ImageURL = ImagePathConverter.GetImageSource(path + "Image20.png"), Description = "Check login page validation", Tags = new string[] { "Feature" } } ); Cards.Add( new KanbanModel() { ID = 24, Title = "UWP - 24", ImageURL = ImagePathConverter.GetImageSource(path + "Image21.png"), Category = "In Progress", Description = "Test editing functionality", Tags = new string[] { "Feature", "Customer", "Release" } } ); Cards.Add( new KanbanModel() { ID = 20, Title = "iOS - 20", Category = "In Progress", ImageURL = ImagePathConverter.GetImageSource(path + "Image22.png"), Description = "Fix the issues reported in data binding", Tags = new string[] { "Feature", "Release", } } ); Cards.Add( new KanbanModel() { ID = 12, Title = "Xamarin - 12", Category = "In Progress", ImageURL = ImagePathConverter.GetImageSource(path + "Image23.png"), Description = "Test editing functionality", Tags = new string[] { "Feature", "Release", } } ); Cards.Add( new KanbanModel() { ID = 11, Title = "iOS - 11", Category = "In Progress", ImageURL = ImagePathConverter.GetImageSource(path + "Image24.png"), Description = "Check filtering validation", Tags = new string[] { "Feature", "Release", } } ); Cards.Add( new KanbanModel() { ID = 13, Title = "UWP - 13", ImageURL = ImagePathConverter.GetImageSource(path + "Image25.png"), Category = "Closed", Description = "Fix cannot open user's default database sql error", Tags = new string[] { "Bug", "Internal", "Release" } }); Cards.Add( new KanbanModel() { ID = 14, Title = "Android - 14", Category = "Closed", ImageURL = ImagePathConverter.GetImageSource(path + "Image26.png"), Description = "Arrange web meeting with customer to get login page requirement", Tags = new string[] { "Feature" } } ); Cards.Add( new KanbanModel() { ID = 15, Title = "Xamarin - 15", Category = "Closed", ImageURL = ImagePathConverter.GetImageSource(path + "Image27.png"), Description = "Login page validation", Tags = new string[] { "Bug" } } ); Cards.Add( new KanbanModel() { ID = 16, Title = "Xamarin - 16", ImageURL = ImagePathConverter.GetImageSource(path + "Image28.png"), Category = "Closed", Description = "Test the application in IE browser", Tags = new string[] { "Bug" } } ); Cards.Add( new KanbanModel() { ID = 20, Title = "UWP - 20", ImageURL = ImagePathConverter.GetImageSource(path + "Image29.png"), Category = "Closed", Description = "Analyze stored procedure", Tags = new string[] { "CustomSample", "Customer", "Incident" } } ); Cards.Add( new KanbanModel() { ID = 21, Title = "Android - 21", Category = "Closed", ImageURL = ImagePathConverter.GetImageSource(path + "Image30.png"), Description = "Arrange web meeting with customer to get editing requirements", Tags = new string[] { "Story", "Improvement" } } ); }
private void UpdateTemplate(Node node, string state) { if (Device.RuntimePlatform == Device.UWP) { node.Width = 150; node.Height = 50; } node.Style.StrokeWidth = 1; StackLayout root; var NodeTemplate = new DataTemplate(() => { root = new StackLayout() { Orientation = StackOrientation.Horizontal, BackgroundColor = Color.Transparent }; Image image = new Image(); image.WidthRequest = 35; image.HeightRequest = 35; image.Margin = new Thickness(8); if (Device.RuntimePlatform == Device.UWP) { image.Source = ImagePathConverter.GetImageSource((node.Content as DiagramEmployee).ImageUrl); } else { image.Source = (node.Content as DiagramEmployee).ImageUrl; } root.Children.Add(image); StackLayout content = new StackLayout() { WidthRequest = 100, HeightRequest = 40, Orientation = StackOrientation.Vertical }; Label name = new Label() { TextColor = Color.FromRgb(255, 255, 255), Margin = new Thickness(0, 8, 0, 0), Text = (node.Content as DiagramEmployee).Name, FontSize = 10, HorizontalOptions = LayoutOptions.StartAndExpand }; // name.SetBinding(Label.TextProperty, new Binding((node.Content as Employee).Name)); Label designation = new Label() { Text = (node.Content as DiagramEmployee).Designation, TextColor = Color.FromRgb(255, 255, 255), FontSize = 10, HorizontalOptions = LayoutOptions.StartAndExpand }; // designation.SetBinding(Label.TextProperty, new Binding((node.Content as Employee).Designation)); content.Children.Add(name); content.Children.Add(designation); root.Children.Add(content); if (Device.RuntimePlatform != Device.UWP) { if ((node.Content as DiagramEmployee).HasChild) { root.WidthRequest = 180; Label Expand = new Label() { TextColor = Color.White, Text = state, FontSize = 35, VerticalOptions = LayoutOptions.Center }; Expand.Margin = new Thickness(0, 0, 5, 3); root.Children.Add(Expand); } } if (Device.RuntimePlatform == Device.Android) { return(root); } else { Frame style = new Frame(); style.Content = root; style.Padding = new Thickness(0); style.CornerRadius = 5; style.BackgroundColor = FillColor[(node.Content as DiagramEmployee).Designation]; style.BorderColor = StrokeColor[((node.Content as DiagramEmployee).Designation)]; style.HasShadow = false; return(style); } }); if (Device.RuntimePlatform == Device.Android) { node.Style.Brush = new SolidBrush(FillColor[(node.Content as DiagramEmployee).Designation]); node.Style.StrokeBrush = new SolidBrush(StrokeColor[((node.Content as DiagramEmployee).Designation)]); } node.Template = NodeTemplate; }
public Cascading() { InitializeComponent(); frompicker.Parent = tempGrid; topicker.Parent = tempGrid; arrivepicker.Parent = tempGrid; departpicker.Parent = tempGrid; submit.Clicked += Submit_Clicked; flags.Add("UK", ImagePathConverter.GetImageSource("SampleBrowser.SfPicker.uk.png")); flags.Add("USA", ImagePathConverter.GetImageSource("SampleBrowser.SfPicker.usa.png")); flags.Add("UAE", ImagePathConverter.GetImageSource("SampleBrowser.SfPicker.uae.png")); flags.Add("India", ImagePathConverter.GetImageSource("SampleBrowser.SfPicker.india.png")); flags.Add("Germany", ImagePathConverter.GetImageSource("SampleBrowser.SfPicker.germany.png")); ObservableCollection <object> column2Source = new ObservableCollection <object>(); column1Source.Add("UK"); column1Source.Add("USA"); column1Source.Add("India"); column1Source.Add("UAE"); column1Source.Add("Germany"); column2Source = GetCity("India"); Source = new ObservableCollection <object>(); Source2 = new ObservableCollection <object>(); Source.Add(column1Source); Source.Add(column2Source); Source2.Add(column1Source); Source2.Add(GetCity2("USA")); frompicker.SelectionChanged += Picker_SelectionChanged; frompicker.ItemsSource = Source; frompicker.Opened += Frompicker_OnPopUpOpened; frompicker.OnColumnLoaded += Frompicker_OnColumnLoaded; if (Device.OS != TargetPlatform.Android) { frompicker.OnPickerItemLoaded += Frompicker_OnPickerItemLoaded; } frompicker.ShowColumnHeader = true; ObservableCollection <string> columnHeaderCollection = new ObservableCollection <string>(); if (Device.OS == TargetPlatform.Android) { columnHeaderCollection.Add("COUNTRY"); columnHeaderCollection.Add("CITY"); frompicker.PickerWidth = 300; topicker.PickerWidth = 300; departpicker.PickerWidth = 300; arrivepicker.PickerWidth = 300; departpicker.ColumnHeaderFontSize = 15; arrivepicker.ColumnHeaderFontSize = 15; btn1.WidthRequest = 30; btn2.WidthRequest = 30; btn3.WidthRequest = 30; btn4.WidthRequest = 30; } else { columnHeaderCollection.Add("Country"); columnHeaderCollection.Add("City"); } frompicker.ColumnHeaderText = columnHeaderCollection; frompicker.OkButtonClicked += Frompicker_OkButtonClicked; frompicker.CancelButtonClicked += Frompicker_CancelButtonClicked; topicker.SelectionChanged += Picker_SelectionChanged1; topicker.ItemsSource = Source2; topicker.ShowColumnHeader = true; topicker.ColumnHeaderText = columnHeaderCollection; topicker.CancelButtonClicked += Topicker_CancelButtonClicked; topicker.OkButtonClicked += Topicker_OkButtonClicked; topicker.Opened += Topicker_OnPopUpOpened; topicker.OnColumnLoaded += Topicker_OnColumnLoaded; if (Device.OS != TargetPlatform.Android) { topicker.OnPickerItemLoaded += Topicker_OnPickerItemLoaded; } frompicker.Parent = tempGrid; topicker.Parent = tempGrid; departpicker.OnColumnLoaded += Departpicker_OnColumnLoaded; arrivepicker.OnColumnLoaded += Arrivepicker_OnColumnLoaded; str = DateTime.Now.Day.ToString(); if (str.Length == 1) { str = "0" + str; } startdate.Text = DateTime.Now.Year.ToString() + " " + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.Date.Month).Substring(0, 3) + " " + str + " " + DateTime.Now.ToString("hh") + ":" + DateTime.Now.ToString("mm"); enddate.Text = DateTime.Now.Year.ToString() + " " + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.Date.Month).Substring(0, 3) + " " + str + " " + " " + DateTime.Now.ToString("hh") + ":" + DateTime.Now.ToString("mm"); todaycollection.Add(CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.Date.Month)); if (DateTime.Now.Date.Day < 10) { todaycollection.Add("0" + DateTime.Now.Date.Day); } else { todaycollection.Add(DateTime.Now.Date.Day.ToString()); } todaycollection.Add(DateTime.Now.Date.Year.ToString()); todaycollection.Add(DateTime.Now.ToString("hh")); todaycollection.Add(DateTime.Now.ToString("mm")); fromPlace.Focused += FromPlace_Focused; toplace.Focused += Toplace_Focused; startdate.Focused += Startdate_Focused; enddate.Focused += Enddate_Focused; fromPlace.Text = "Chennai, India"; toplace.Text = "Boston, USA"; this.BindingContext = new CascadingViewModel(); if (Device.OS == TargetPlatform.Android) { submit.BackgroundColor = Color.FromHex("#009688"); submit.TextColor = Color.White; submit.Text = "SEARCH"; frompicker.HeaderText = "FROM"; topicker.HeaderText = "TO"; arrivepicker.HeaderText = "SELECT A DATE & TIME"; departpicker.HeaderText = "SELECT A DATE & TIME"; submit.FontFamily = "sans-serif-medium"; submit.WidthRequest = 100; submit.HeightRequest = 35; tempGrid.Margin = new Thickness(15, 0, 0, 0); } if (Device.OS == TargetPlatform.iOS) { frompicker.SelectedItemFontSize = 25; topicker.SelectedItemFontSize = 25; departpicker.SelectedItemFontSize = 25; arrivepicker.SelectedItemFontSize = 25; //frame.OutlineColor = Color.White; submit.WidthRequest = 250; submit.HeightRequest = 25; submit.BorderWidth = 1; arrivepicker.HeaderText = "Select a Date & Time"; departpicker.HeaderText = "Select a Date & Time"; fromLayout.HeightRequest = 30; toLayout.HeightRequest = 30; departLayout.HeightRequest = 30; arrivelayout.HeightRequest = 30; fromlabel.TextColor = Color.FromRgba(0, 0, 0, 0.5); tolabel.TextColor = Color.FromRgba(0, 0, 0, 0.5); departlabel.TextColor = Color.FromRgba(0, 0, 0, 0.5); arrivelabel.TextColor = Color.FromRgba(0, 0, 0, 0.5); fromlabel.FontFamily = "HelveticaNeue-Thin"; tolabel.FontFamily = "HelveticaNeue-Thin"; fromPlace.FontFamily = "HelveticaNeue-Thin"; toplace.FontFamily = "HelveticaNeue-Thin"; frompicker.SelectedItemFontFamily = "HelveticaNeue-Thin"; frompicker.UnSelectedItemFontFamily = "HelveticaNeue-Thin"; topicker.SelectedItemFontFamily = "HelveticaNeue-Thin"; topicker.UnSelectedItemFontFamily = "HelveticaNeue-Thin"; departpicker.SelectedItemFontFamily = "HelveticaNeue-Thin"; departpicker.UnSelectedItemFontFamily = "HelveticaNeue-Thin"; arrivepicker.SelectedItemFontFamily = "HelveticaNeue-Thin"; arrivepicker.UnSelectedItemFontFamily = "HelveticaNeue-Thin"; departlabel.FontFamily = "HelveticaNeue-Thin"; startdate.FontFamily = "HelveticaNeue-Thin"; arrivelabel.FontFamily = "HelveticaNeue-Thin"; enddate.FontFamily = "HelveticaNeue-Thin"; submit.FontFamily = "HelveticaNeue-Thin"; submit.BorderColor = Color.FromHex("#cdcdcd"); submit.FontSize = 14; submit.FontAttributes = FontAttributes.Italic; frompicker.PickerWidth = 300; topicker.PickerWidth = 300; arrivepicker.PickerWidth = 360; departpicker.PickerWidth = 360; } else if (Device.OS == TargetPlatform.Windows) { if (Device.Idiom != TargetIdiom.Phone) { innerGrid.HorizontalOptions = LayoutOptions.Start; innerGrid.WidthRequest = 500; innerGrid.VerticalOptions = LayoutOptions.Start; } topicker.HeaderText = "TO"; frompicker.HeaderText = "FROM"; departpicker.HeaderText = "SELECT A DATE & TIME"; arrivepicker.HeaderText = "SELECT A DATE & TIME"; startdate.IsEnabled = true; startdate.HeightRequest = 40; arrivepicker.HeaderText = "PICK A DATE TIME"; departpicker.HeaderText = "PICK A DATE TIME"; enddate.IsEnabled = true; enddate.HeightRequest = 40; fromPlace.IsEnabled = true; fromPlace.HeightRequest = 40; toplace.IsEnabled = true; toplace.HeightRequest = 40; fromPlace.VerticalOptions = LayoutOptions.Center; toplace.VerticalOptions = LayoutOptions.Center; startdate.FontSize = 15; startdate.VerticalOptions = LayoutOptions.Center; enddate.FontSize = 15; enddate.VerticalOptions = LayoutOptions.Center; frompicker.PickerWidth = 300; topicker.PickerWidth = 300; departpicker.PickerWidth = 310; arrivepicker.PickerWidth = 310; submit.HorizontalOptions = LayoutOptions.Start; submit.HeightRequest = 40; submit.Margin = new Thickness(0, 15, 0, 0); if (Device.Idiom == TargetIdiom.Phone) { fromPlace.WidthRequest = 220; toplace.WidthRequest = 220; startdate.WidthRequest = 220; enddate.WidthRequest = 220; submit.WidthRequest = 270; } else { submit.WidthRequest = 300; } submit.BackgroundColor = Color.FromHex("#cdcdcd"); submit.TextColor = Color.Black; interlabel.Margin = new Thickness(10, 0, 0, 0); interlabel.FontAttributes = FontAttributes.Bold; fromlabel.TextColor = Color.Gray; tolabel.TextColor = Color.Gray; departlabel.TextColor = Color.Gray; arrivelabel.TextColor = Color.Gray; journeylabel.FontAttributes = FontAttributes.Bold; } var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += (s, e) => { if (Device.OS == TargetPlatform.Android && Device.OS == TargetPlatform.iOS) { departpicker.IsOpen = true; } }; startdate.GestureRecognizers.Add(tapGestureRecognizer); var tapGestureRecognizer2 = new TapGestureRecognizer(); tapGestureRecognizer2.Tapped += (s, e) => { if (Device.OS == TargetPlatform.Android && Device.OS == TargetPlatform.iOS) { arrivepicker.IsOpen = true; } }; enddate.GestureRecognizers.Add(tapGestureRecognizer2); var tapGestureRecognizer3 = new TapGestureRecognizer(); tapGestureRecognizer3.Tapped += (s, e) => { if (Device.OS == TargetPlatform.Android && Device.OS == TargetPlatform.iOS) { frompicker.IsOpen = true; } }; fromPlace.GestureRecognizers.Add(tapGestureRecognizer); var tapGestureRecognizer4 = new TapGestureRecognizer(); tapGestureRecognizer4.Tapped += (s, e) => { if (Device.OS == TargetPlatform.Android && Device.OS == TargetPlatform.iOS) { topicker.IsOpen = true; } }; toplace.GestureRecognizers.Add(tapGestureRecognizer2); if (Device.OS == TargetPlatform.Android) { frompicker.BackgroundColor = Color.White; topicker.BackgroundColor = Color.White; } }
void RangeChangeEvent() { departureImage.Source = ImagePathConverter.GetImageSource("SampleBrowser.SfRangeSlider.departure.png"); arrivalImage.Source = ImagePathConverter.GetImageSource("SampleBrowser.SfRangeSlider.arrival.png"); sfRangeSlider1.RangeChanging += (object sender, RangeEventArgs e) => { if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS) { if (Math.Round(e.Start) < 1) { if (Math.Round(e.End) == 12) { timeLabel3.Text = "12 AM - " + Math.Round(e.End) + " PM"; } else { timeLabel3.Text = "12 AM - " + Math.Round(e.End) + " AM"; } } else { if (Math.Round(e.End) == 12) { timeLabel3.Text = Math.Round(e.Start) + " AM - " + Math.Round(e.End) + " PM"; } else { timeLabel3.Text = Math.Round(e.Start) + " AM - " + Math.Round(e.End) + " AM"; } } if (Math.Round(e.Start) == Math.Round(e.End)) { if (Math.Round(e.Start) < 1) { timeLabel3.Text = "12 AM"; } else if (Math.Round(e.Start) == 12) { timeLabel3.Text = "12 PM"; } else { timeLabel3.Text = Math.Round(e.Start) + " AM"; } } } if (Device.RuntimePlatform == Device.UWP && Device.Idiom == TargetIdiom.Phone) { if (Math.Round(sfRangeSlider1.RangeStart) < 1) { if (Math.Round(sfRangeSlider1.RangeEnd) == 12) { timeLabel3.Text = "12 AM - " + Math.Round(sfRangeSlider1.RangeEnd) + " PM"; } else { timeLabel3.Text = "12 AM - " + Math.Round(sfRangeSlider1.RangeEnd) + " AM"; } } else { if (Math.Round(sfRangeSlider1.RangeEnd) == 12) { timeLabel3.Text = Math.Round(sfRangeSlider1.RangeStart) + " AM - " + Math.Round(sfRangeSlider1.RangeEnd) + " PM"; } else { timeLabel3.Text = Math.Round(sfRangeSlider1.RangeStart) + " AM - " + Math.Round(sfRangeSlider1.RangeEnd) + " AM"; } } if (Math.Round(sfRangeSlider1.RangeStart) == Math.Round(sfRangeSlider1.RangeEnd)) { if (Math.Round(sfRangeSlider1.RangeStart) < 1) { timeLabel3.Text = "12 AM"; } else if (Math.Round(sfRangeSlider1.RangeStart) == 12) { timeLabel3.Text = "12 PM"; } else { timeLabel3.Text = Math.Round(sfRangeSlider1.RangeStart) + " AM"; } } } }; sfRangeSlider2.RangeChanging += (object sender, RangeEventArgs e) => { if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS) { if (Math.Round(e.Start) < 1) { if (Math.Round(e.End) == 12) { timeLabel4.Text = "12 AM - " + Math.Round(e.End) + " PM"; } else { timeLabel4.Text = "12 AM - " + Math.Round(e.End) + " AM"; } } else { if (Math.Round(e.End) == 12) { timeLabel4.Text = Math.Round(e.Start) + " AM - " + Math.Round(e.End) + " PM"; } else { timeLabel4.Text = Math.Round(e.Start) + " AM - " + Math.Round(e.End) + " AM"; } } if (Math.Round(e.Start) == Math.Round(e.End)) { if (Math.Round(e.Start) < 1) { timeLabel4.Text = "12 AM"; } else if (Math.Round(e.Start) == 12) { timeLabel4.Text = "12 PM"; } else { timeLabel4.Text = Math.Round(e.Start) + " AM"; } } } if (Device.RuntimePlatform == Device.UWP && Device.Idiom == TargetIdiom.Phone) { if (Math.Round(sfRangeSlider2.RangeStart) < 1) { if (Math.Round(sfRangeSlider2.RangeEnd) == 12) { timeLabel4.Text = "12 AM - " + Math.Round(sfRangeSlider2.RangeEnd) + " PM"; } else { timeLabel4.Text = "12 AM - " + Math.Round(sfRangeSlider2.RangeEnd) + " AM"; } } else { if (Math.Round(sfRangeSlider2.RangeEnd) == 12) { timeLabel4.Text = Math.Round(sfRangeSlider2.RangeStart) + " AM - " + Math.Round(sfRangeSlider2.RangeEnd) + " PM"; } else { timeLabel4.Text = Math.Round(sfRangeSlider2.RangeStart) + " AM - " + Math.Round(sfRangeSlider2.RangeEnd) + " AM"; } } if (Math.Round(sfRangeSlider2.RangeStart) == Math.Round(sfRangeSlider2.RangeEnd)) { if (Math.Round(sfRangeSlider2.RangeStart) < 1) { timeLabel4.Text = "12 AM"; } else if (Math.Round(sfRangeSlider2.RangeStart) == 12) { timeLabel4.Text = "12 PM"; } else { timeLabel4.Text = Math.Round(sfRangeSlider2.RangeStart) + " AM"; } } } }; }
public SelectionIndicatorViewModel() { appCollection = new ObservableCollection <Applicationlist>(); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.Calculator.png"), AppName = "Calculator", Date = "Updated 2 days ago" }); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.Camera.png"), AppName = "Camera", Date = "Updated 4 days ago" }); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.CDMusic.png"), AppName = "CD Music", Date = "Updated 9 days ago" }); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.Excel.png"), AppName = "Excel", Date = "Updated 2 hours ago" }); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.GMail.png"), AppName = "Gmail", Date = "Updated 9 days ago" }); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.GoogleChrome.png"), AppName = "Google Chrome", Date = "Updated 2 hours ago" }); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.Instagram.png"), AppName = "Instagram", Date = "Updated 8 days ago" }); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.Maps.png"), AppName = "Maps", Date = "Updated 11 days ago" }); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.MicrosoftPowerPoint.png"), AppName = "Microsoft Power Point", Date = "Updated 9 days ago" }); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.MicrosoftWord.png"), AppName = "Microsoft Word", Date = "Updated 7 days ago" }); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.Skype.png"), AppName = "Skype", Date = "Updated 1 day ago" }); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.Talk.png"), AppName = "Talk", Date = "Updated 4 days ago" }); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.Twitter.png"), AppName = "Twitter", Date = "Updated 6 weeks ago" }); appCollection.Add(new Applicationlist() { AppImage = ImagePathConverter.GetImageSource("SampleBrowser.SfComboBox.yahoo.png"), AppName = "Yahoo", Date = "Updated 2 days ago" }); }
public MenuCollectionModel getItem(string item, string icon) { int randomValue = 0; MenuCollectionModel mCollection = new MenuCollectionModel(); mCollection.MessageContent = new ObservableCollection <Message>(); for (int i = 0; i < 10; i++) { if (item == "Follow up") { if (i % 4 != 0) { continue; } } if (item == "Sent mail") { if (i % 4 != 0) { continue; } } if (item == "Trash ") { if (i % 3 == 0) { continue; } } randomValue = random.Next(0, 9); Message message = new Message(); message.Sender = sender[randomValue]; message.Date = MonthArray[i] + " " + (i + 7).ToString(); if (item != "Inbox") { randomValue = random.Next(0, 29); message.Subject = subject[randomValue]; message.Content = textContent[randomValue]; } else { randomValue = i; message.Subject = subject[randomValue]; message.Content = textContent[randomValue]; } if (item == "Inbox" && i < 7) { message.SubjectColor = Color.FromHex("#006bcd"); message.FontAttribute = FontAttributes.Bold; message.ContactImage = ImagePathConverter.GetImageSource("SampleBrowser.SfNavigationDrawer.a" + i.ToString() + ".png"); message.ContactType = contactType[i]; } else { message.SubjectColor = Color.FromHex("#545659"); message.FontAttribute = FontAttributes.None; } mCollection.MessageContent.Add(message); } mCollection.MenuItem = item; mCollection.Icon = icon; return(mCollection); }
/// <summary> /// Begins when the behavior attached to the view /// </summary> /// <param name="bindable">bindable value</param> protected override void OnAttachedTo(StackLayout bindable) { base.OnAttachedTo(bindable); var button = bindable.FindByName <Image>("Image"); var label = bindable.FindByName <Label>("label"); if (CustomizationViewModel.MonthCellItem != null) { if (CustomizationViewModel.MonthCellItem.IsLeadingDay || CustomizationViewModel.MonthCellItem.IsTrailingDay) { label.TextColor = Color.Gray; } else { label.TextColor = Color.Black; } } if (CustomizationViewModel.ScheduleAppointment != null) { if (CustomizationViewModel.ScheduleAppointment.Subject == "Conference") { if (Device.RuntimePlatform == "UWP" && Device.Idiom == TargetIdiom.Desktop) { button.Source = ImagePathConverter.GetImageSource("SampleBrowser.SfSchedule.conference_schedule.png"); } else { button.Source = "conference_schedule.png"; } } else if (CustomizationViewModel.ScheduleAppointment.Subject == "System Troubleshoot") { if (Device.RuntimePlatform == "UWP" && Device.Idiom == TargetIdiom.Desktop) { button.Source = ImagePathConverter.GetImageSource("SampleBrowser.SfSchedule.troubleshoot_schedule.png"); } else { button.Source = "troubleshoot_schedule.png"; } } else if (CustomizationViewModel.ScheduleAppointment.Subject == "Checkup") { if (Device.RuntimePlatform == "UWP" && Device.Idiom == TargetIdiom.Desktop) { button.Source = ImagePathConverter.GetImageSource("SampleBrowser.SfSchedule.stethoscope_schedule.png"); } else { button.Source = "stethoscope_schedule.png"; } } else if (CustomizationViewModel.ScheduleAppointment.Subject == "Jeni's Birthday") { if (Device.RuntimePlatform == "UWP" && Device.Idiom == TargetIdiom.Desktop) { button.Source = ImagePathConverter.GetImageSource("SampleBrowser.SfSchedule.cake_schedule.png"); } else { button.Source = "cake_schedule.png"; } } } }