Untitled
using System; using System.Runtime.CompilerServices; using Microsoft.Maui.Controls; namespace Module01Activity02 { public partial class MainPage : ContentPage { public string Firstname { get; set; } public Color ColorRed { get; set; } public MainPage() { InitializeComponent(); Firstname = "Hello, MAUI!"; ColorRed = Colors.Blue; this.BindingContext = this; } private void OnChangedLabelName(object sender, EventArgs e) { this.Resources["StaticUsername"] = "Peter Butter"; } private void OnChangeLabelNameDynamic(object sender, EventArgs e) { this.Resources["DynamicUsername"] = "Mr. Juan Dela Cruz"; } private void OnChangeBackgroundColor(object sender, EventArgs e) { this.Resources["LocalBackgroundColor"] = Colors.Beige; } private void OnChangeBoxViewColor(object sender, EventArgs e) { this.Resources["DynamicBoxColor"] = Colors.Red; } } }
Leave a Comment