public CustomDesktopEnvironment(KeyboardShortcutCollection keyboardShortcuts) { KeyboardShortcuts = keyboardShortcuts; KeyboardShortcuts.DesktopEnvironment = this; Attributes.Add(nameof(BackgroundColor), BackgroundColor.ToHex()); }
async void OnItemSelected(object sender, SelectedItemChangedEventArgs e) { var todoItem = e.SelectedItem as TodoItem; var todoPage = new TodoItemPage(BackgroundColor.ToHex()); todoPage.BindingContext = todoItem; await Navigation.PushAsync(todoPage); }
async void OnAddItemClicked(object sender, EventArgs e) { var todoItem = new TodoItem() { ID = Guid.NewGuid().ToString() }; var todoPage = new TodoItemPage(BackgroundColor.ToHex(), true); todoPage.BindingContext = todoItem; await Navigation.PushAsync(todoPage); }
public Spinner() { _canvasView = this; _colorIndex = 0; _isActive = false; Colors.Add((Color)Application.Current.Resources["Title"]); Colors.Add((Color)Application.Current.Resources["Primary"]); Debug.WriteLine($"Spinner...Original BackgroundColor:{BackgroundColor.ToHex()}"); _originalBackgroundColor = this.BackgroundColor; Colors.CollectionChanged += Colors_CollectionChanged; }
private void CustomButton_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "IsEnabled") { SetBackGroundColor(this); } else if (e.PropertyName == "Renderer") { originalBackgroundColor = Color.FromHex(BackgroundColor.ToHex()); SetBackGroundColor(this); } }
private void DrawRoundedShape() { using (var path = new SKPath()) { // Top left path.MoveTo(new SKPoint(0, Parameters.TopLeft)); path.QuadTo(new SKPoint(0, 0), new SKPoint(Parameters.TopLeft, 0)); // Top right path.LineTo(_canvasInfo.ImageInfo.Width - Parameters.TopRight, 0); path.QuadTo(new SKPoint(_canvasInfo.ImageInfo.Width, 0), new SKPoint(_canvasInfo.ImageInfo.Width, Parameters.TopRight)); // Bottom right path.LineTo(_canvasInfo.ImageInfo.Width, _canvasInfo.ImageInfo.Height - Parameters.BottomRight); path.QuadTo(new SKPoint(_canvasInfo.ImageInfo.Width, _canvasInfo.ImageInfo.Height), new SKPoint(_canvasInfo.ImageInfo.Width - Parameters.BottomRight, _canvasInfo.ImageInfo.Height)); // Bottom left path.LineTo(Parameters.BottomLeft, _canvasInfo.ImageInfo.Height); path.QuadTo(new SKPoint(0, _canvasInfo.ImageInfo.Height), new SKPoint(0, _canvasInfo.ImageInfo.Height - Parameters.BottomLeft)); // Gradient & Background color if (Gradient != null) { AddGradinet(); } else { _shapePaint.Color = SKColor.Parse(BackgroundColor.ToHex()); } // Draw _canvasInfo.Canvas.DrawPath(path, _shapePaint); } }
public string Get(string propertyName) { switch (propertyName) { //ELEMENT case nameof(ClassId): return(ClassId.ToString()); case nameof(AutomationId): return(AutomationId.ToString()); case nameof(Id): return(Id.ToString()); case nameof(StyleId): return(StyleId.ToString()); //VISUAL ELEMENT case nameof(AnchorX): return(AnchorX.ToString()); case nameof(AnchorY): return(AnchorY.ToString()); case nameof(BackgroundColor): return(BackgroundColor.ToHex()); case nameof(Width): return(this.Width.ToString()); case nameof(Height): return(this.Height.ToString()); case nameof(IsEnabled): return(IsEnabled.ToString()); case nameof(WidthRequest): return(this.WidthRequest.ToString()); case nameof(HeightRequest): return(this.HeightRequest.ToString()); case nameof(IsFocused): return(IsFocused.ToString()); case nameof(IsVisible): return(IsVisible.ToString()); case nameof(InputTransparent): return(InputTransparent.ToString()); case nameof(X): return(this.X.ToString()); case nameof(Y): return(this.Y.ToString()); case nameof(Opacity): return(this.Opacity.ToString()); case nameof(TranslationX): return(this.TranslationX.ToString()); case nameof(TranslationY): return(this.TranslationY.ToString()); case nameof(Rotation): return(this.Rotation.ToString()); case nameof(RotationX): return(this.RotationX.ToString()); case nameof(RotationY): return(this.RotationY.ToString()); case nameof(Scale): return(this.Scale.ToString()); //VIEW case nameof(Margin): return(this.Margin.ToString()); case nameof(VerticalOptions): return(this.VerticalOptions.ToString()); case nameof(HorizontalOptions): return(this.HorizontalOptions.ToString()); //INPUTVIEW case nameof(Keyboard): return(this.Keyboard.ToString()); //EDITOR case nameof(FontAttributes): return(this.FontAttributes.ToString()); case nameof(FontFamily): return(this.FontFamily); case nameof(FontSize): return(this.FontSize.ToString()); case nameof(Text): return(this.Text); case nameof(TextColor): return(this.TextColor.ToHex()); default: return(string.Empty); } }
StringBuilder PrepareFormattingString(StringBuilder _formattingString) { if (!ForegroundColor.IsDefault) { _formattingString.AppendFormat("color={0} ", ForegroundColor.ToHex()); } if (!BackgroundColor.IsDefault) { _formattingString.AppendFormat("backing_color={0} backing=on ", BackgroundColor.ToHex()); } if (!string.IsNullOrEmpty(FontFamily)) { _formattingString.AppendFormat("font={0} ", FontFamily); } if (FontSize != -1) { _formattingString.AppendFormat("font_size={0} ", System.Maui.Maui.ConvertToEflFontPoint(FontSize)); } if ((FontAttributes & FontAttributes.Bold) != 0) { _formattingString.Append("font_weight=Bold "); } else { // FontWeight is only available in case of FontAttributes.Bold is not used. if (FontWeight != Specific.FontWeight.None) { _formattingString.AppendFormat("font_weight={0} ", FontWeight); } } if ((FontAttributes & FontAttributes.Italic) != 0) { _formattingString.Append("font_style=italic "); } if (Underline) { _formattingString.AppendFormat("underline=on underline_color={0} ", ForegroundColor.IsDefault ? s_defaultLineColor.ToHex() : ForegroundColor.ToHex()); } if (Strikethrough) { _formattingString.AppendFormat("strikethrough=on strikethrough_color={0} ", ForegroundColor.IsDefault ? s_defaultLineColor.ToHex() : ForegroundColor.ToHex()); } switch (HorizontalTextAlignment) { case TextAlignment.Auto: _formattingString.Append("align=auto "); break; case TextAlignment.Start: _formattingString.Append("align=left "); break; case TextAlignment.End: _formattingString.Append("align=right "); break; case TextAlignment.Center: _formattingString.Append("align=center "); break; case TextAlignment.None: break; } if (LineHeight != -1.0d) { _formattingString.Append($"linerelsize={(int)(LineHeight * 100)}%"); } switch (LineBreakMode) { case LineBreakMode.HeadTruncation: _formattingString.Append("ellipsis=0.0"); break; case LineBreakMode.MiddleTruncation: _formattingString.Append("ellipsis=0.5"); break; case LineBreakMode.TailTruncation: _formattingString.Append("ellipsis=1.0"); break; case LineBreakMode.None: break; } return(_formattingString); }
public string Get(string propertyName) { switch (propertyName) { //ELEMENT case nameof(ClassId): return(ClassId.ToString()); case nameof(AutomationId): return(AutomationId.ToString()); case nameof(Id): return(Id.ToString()); case nameof(StyleId): return(StyleId.ToString()); //VISUAL ELEMENT case nameof(AnchorX): return(AnchorX.ToString()); case nameof(AnchorY): return(AnchorY.ToString()); case nameof(BackgroundColor): return(BackgroundColor.ToHex()); case nameof(Width): return(this.Width.ToString()); case nameof(Height): return(this.Height.ToString()); case nameof(IsEnabled): return(IsEnabled.ToString()); case nameof(WidthRequest): return(this.WidthRequest.ToString()); case nameof(HeightRequest): return(this.HeightRequest.ToString()); case nameof(IsFocused): return(IsFocused.ToString()); case nameof(IsVisible): return(IsVisible.ToString()); case nameof(InputTransparent): return(InputTransparent.ToString()); case nameof(X): return(this.X.ToString()); case nameof(Y): return(this.Y.ToString()); case nameof(Opacity): return(this.Opacity.ToString()); case nameof(TranslationX): return(this.TranslationX.ToString()); case nameof(TranslationY): return(this.TranslationY.ToString()); case nameof(Rotation): return(this.Rotation.ToString()); case nameof(RotationX): return(this.RotationX.ToString()); case nameof(RotationY): return(this.RotationY.ToString()); case nameof(Scale): return(this.Scale.ToString()); //VIEW case nameof(Margin): return(this.Margin.ToString()); case nameof(VerticalOptions): return(this.VerticalOptions.ToString()); case nameof(HorizontalOptions): return(this.HorizontalOptions.ToString()); //STEPPER case nameof(Maximum): return(Maximum.ToString()); case nameof(Minimum): return(Minimum.ToString()); case nameof(Value): return(Value.ToString()); case nameof(Increment): return(Increment.ToString()); default: return(string.Empty); } }
public string Get(string propertyName) { switch (propertyName) { //ELEMENT case nameof(ClassId): return(ClassId.ToString()); case nameof(AutomationId): return(AutomationId.ToString()); case nameof(Id): return(Id.ToString()); case nameof(StyleId): return(StyleId.ToString()); //VISUAL ELEMENT case nameof(AnchorX): return(AnchorX.ToString()); case nameof(AnchorY): return(AnchorY.ToString()); case nameof(BackgroundColor): return(BackgroundColor.ToHex()); case nameof(Width): return(this.Width.ToString()); case nameof(Height): return(this.Height.ToString()); case nameof(IsEnabled): return(IsEnabled.ToString()); case nameof(WidthRequest): return(this.WidthRequest.ToString()); case nameof(HeightRequest): return(this.HeightRequest.ToString()); case nameof(IsFocused): return(IsFocused.ToString()); case nameof(IsVisible): return(IsVisible.ToString()); case nameof(InputTransparent): return(InputTransparent.ToString()); case nameof(X): return(this.X.ToString()); case nameof(Y): return(this.Y.ToString()); case nameof(Opacity): return(this.Opacity.ToString()); case nameof(TranslationX): return(this.TranslationX.ToString()); case nameof(TranslationY): return(this.TranslationY.ToString()); case nameof(Rotation): return(this.Rotation.ToString()); case nameof(RotationX): return(this.RotationX.ToString()); case nameof(RotationY): return(this.RotationY.ToString()); case nameof(Scale): return(this.Scale.ToString()); //VIEW case nameof(Margin): return(this.Margin.ToString()); case nameof(VerticalOptions): return(this.VerticalOptions.ToString()); case nameof(HorizontalOptions): return(this.HorizontalOptions.ToString()); //PICKER case nameof(ItemsSource): return(ItemsSource.OfType <object>().Select(x => x.ToString()).Aggregate((x, y) => x + "," + y)); case nameof(SelectedItem): return(SelectedItem.ToString()); case nameof(SelectedIndex): return(SelectedIndex.ToString()); case nameof(Items): return(Items.Aggregate((x, y) => x + "," + y)); case nameof(Title): return(Title); default: return(string.Empty); } }
public string Get(string propertyName) { switch (propertyName) { //ELEMENT case nameof(ClassId): return(ClassId.ToString()); case nameof(AutomationId): return(AutomationId.ToString()); case nameof(Id): return(Id.ToString()); case nameof(StyleId): return(StyleId.ToString()); //VISUAL ELEMENT case nameof(AnchorX): return(AnchorX.ToString()); case nameof(AnchorY): return(AnchorY.ToString()); case nameof(BackgroundColor): return(BackgroundColor.ToHex()); case nameof(Width): return(this.Width.ToString()); case nameof(Height): return(this.Height.ToString()); case nameof(IsEnabled): return(IsEnabled.ToString()); case nameof(WidthRequest): return(this.WidthRequest.ToString()); case nameof(HeightRequest): return(this.HeightRequest.ToString()); case nameof(IsFocused): return(IsFocused.ToString()); case nameof(IsVisible): return(IsVisible.ToString()); case nameof(InputTransparent): return(InputTransparent.ToString()); case nameof(X): return(this.X.ToString()); case nameof(Y): return(this.Y.ToString()); case nameof(Opacity): return(this.Opacity.ToString()); case nameof(TranslationX): return(this.TranslationX.ToString()); case nameof(TranslationY): return(this.TranslationY.ToString()); case nameof(Rotation): return(this.Rotation.ToString()); case nameof(RotationX): return(this.RotationX.ToString()); case nameof(RotationY): return(this.RotationY.ToString()); case nameof(Scale): return(this.Scale.ToString()); //VIEW case nameof(Margin): return(this.Margin.ToString()); case nameof(VerticalOptions): return(this.VerticalOptions.ToString()); case nameof(HorizontalOptions): return(this.HorizontalOptions.ToString()); //ITEMSVIEW case nameof(ItemsSource): return(ItemsSource.OfType <object>().Select(x => x.ToString()).Aggregate((x, y) => x + "," + y)); //LISTVIEW case nameof(HasUnevenRows): return(HasUnevenRows.ToString()); case nameof(IsGroupingEnabled): return(IsGroupingEnabled.ToString()); case nameof(RowHeight): return(RowHeight.ToString()); case nameof(Footer): return(Footer.ToString()); case nameof(Header): return(Header.ToString()); case nameof(IsPullToRefreshEnabled): return(IsPullToRefreshEnabled.ToString()); case nameof(IsRefreshing): return(IsRefreshing.ToString()); case nameof(SelectedItem): return(SelectedItem.ToString()); case nameof(SeparatorColor): return(SeparatorColor.ToHex()); case nameof(this.SeparatorVisibility): return(SeparatorVisibility.ToString()); default: return(string.Empty); } }
public string Get(string propertyName) { switch (propertyName) { //ELEMENT case nameof(ClassId): return(ClassId.ToString()); case nameof(AutomationId): return(AutomationId.ToString()); case nameof(Id): return(Id.ToString()); case nameof(StyleId): return(StyleId.ToString()); //VISUAL ELEMENT case nameof(AnchorX): return(AnchorX.ToString()); case nameof(AnchorY): return(AnchorY.ToString()); case nameof(BackgroundColor): return(BackgroundColor.ToHex()); case nameof(Width): return(this.Width.ToString()); case nameof(Height): return(this.Height.ToString()); case nameof(IsEnabled): return(IsEnabled.ToString()); case nameof(WidthRequest): return(this.WidthRequest.ToString()); case nameof(HeightRequest): return(this.HeightRequest.ToString()); case nameof(IsFocused): return(IsFocused.ToString()); case nameof(IsVisible): return(IsVisible.ToString()); case nameof(InputTransparent): return(InputTransparent.ToString()); case nameof(X): return(this.X.ToString()); case nameof(Y): return(this.Y.ToString()); case nameof(Opacity): return(this.Opacity.ToString()); case nameof(TranslationX): return(this.TranslationX.ToString()); case nameof(TranslationY): return(this.TranslationY.ToString()); case nameof(Rotation): return(this.Rotation.ToString()); case nameof(RotationX): return(this.RotationX.ToString()); case nameof(RotationY): return(this.RotationY.ToString()); case nameof(Scale): return(this.Scale.ToString()); //VIEW case nameof(Margin): return(this.Margin.ToString()); case nameof(VerticalOptions): return(this.VerticalOptions.ToString()); case nameof(HorizontalOptions): return(this.HorizontalOptions.ToString()); //SEARCHBAR case nameof(CancelButtonColor): return(this.CancelButtonColor.ToHex()); case nameof(Placeholder): return(this.Placeholder); case nameof(SearchCommandParameter): return(SearchCommandParameter.ToString()); case nameof(Text): return(Text); default: return(string.Empty); } }
public string Get(string propertyName) { switch (propertyName) { //ELEMENT case nameof(ClassId): return(ClassId.ToString()); case nameof(AutomationId): return(AutomationId.ToString()); case nameof(Id): return(Id.ToString()); case nameof(StyleId): return(StyleId.ToString()); //VISUAL ELEMENT case nameof(AnchorX): return(AnchorX.ToString()); case nameof(AnchorY): return(AnchorY.ToString()); case nameof(BackgroundColor): return(BackgroundColor.ToHex()); case nameof(Width): return(this.Width.ToString()); case nameof(Height): return(this.Height.ToString()); case nameof(IsEnabled): return(IsEnabled.ToString()); case nameof(WidthRequest): return(this.WidthRequest.ToString()); case nameof(HeightRequest): return(this.HeightRequest.ToString()); case nameof(IsFocused): return(IsFocused.ToString()); case nameof(IsVisible): return(IsVisible.ToString()); case nameof(InputTransparent): return(InputTransparent.ToString()); case nameof(X): return(this.X.ToString()); case nameof(Y): return(this.Y.ToString()); case nameof(Opacity): return(this.Opacity.ToString()); case nameof(TranslationX): return(this.TranslationX.ToString()); case nameof(TranslationY): return(this.TranslationY.ToString()); case nameof(Rotation): return(this.Rotation.ToString()); case nameof(RotationX): return(this.RotationX.ToString()); case nameof(RotationY): return(this.RotationY.ToString()); case nameof(Scale): return(this.Scale.ToString()); //VIEW case nameof(Margin): return(this.Margin.ToString()); case nameof(VerticalOptions): return(this.VerticalOptions.ToString()); case nameof(HorizontalOptions): return(this.HorizontalOptions.ToString()); //IMAGE case nameof(Source): switch (Source) { case FileImageSource file: return(file.File); case UriImageSource uri: return(uri.Uri.ToString()); default: return(string.Empty); } case nameof(Aspect): return(this.Aspect.ToString()); case nameof(IsOpaque): return(this.IsOpaque.ToString()); default: return(string.Empty); } }
public string Get(string propertyName) { switch (propertyName) { //ELEMENT case nameof(ClassId): return ClassId.ToString(); case nameof(AutomationId): return AutomationId.ToString(); case nameof(Id): return Id.ToString(); case nameof(StyleId): return StyleId.ToString(); //VISUAL ELEMENT case nameof(AnchorX): return AnchorX.ToString(); case nameof(AnchorY): return AnchorY.ToString(); case nameof(BackgroundColor): return BackgroundColor.ToHex(); case nameof(Width): return this.Width.ToString(); case nameof(Height): return this.Height.ToString(); case nameof(IsEnabled): return IsEnabled.ToString(); case nameof(WidthRequest): return this.WidthRequest.ToString(); case nameof(HeightRequest): return this.HeightRequest.ToString(); case nameof(IsFocused): return IsFocused.ToString(); case nameof(IsVisible): return IsVisible.ToString(); case nameof(InputTransparent): return InputTransparent.ToString(); case nameof(X): return this.X.ToString(); case nameof(Y): return this.Y.ToString(); case nameof(Opacity): return this.Opacity.ToString(); case nameof(TranslationX): return this.TranslationX.ToString(); case nameof(TranslationY): return this.TranslationY.ToString(); case nameof(Rotation): return this.Rotation.ToString(); case nameof(RotationX): return this.RotationX.ToString(); case nameof(RotationY): return this.RotationY.ToString(); case nameof(Scale): return this.Scale.ToString(); //VIEW case nameof(Margin): return this.Margin.ToString(); case nameof(VerticalOptions): return this.VerticalOptions.ToString(); case nameof(HorizontalOptions): return this.HorizontalOptions.ToString(); //PROGRESSBAR case nameof(Progress): return this.Progress.ToString(); default: return string.Empty; } }
public string Get(string propertyName) { switch (propertyName) { //ELEMENT case nameof(ClassId): return(ClassId.ToString()); case nameof(AutomationId): return(AutomationId.ToString()); case nameof(Id): return(Id.ToString()); case nameof(StyleId): return(StyleId.ToString()); //VISUAL ELEMENT case nameof(AnchorX): return(AnchorX.ToString()); case nameof(AnchorY): return(AnchorY.ToString()); case nameof(BackgroundColor): return(BackgroundColor.ToHex()); case nameof(Width): return(this.Width.ToString()); case nameof(Height): return(this.Height.ToString()); case nameof(IsEnabled): return(IsEnabled.ToString()); case nameof(WidthRequest): return(this.WidthRequest.ToString()); case nameof(HeightRequest): return(this.HeightRequest.ToString()); case nameof(IsFocused): return(IsFocused.ToString()); case nameof(IsVisible): return(IsVisible.ToString()); case nameof(InputTransparent): return(InputTransparent.ToString()); case nameof(X): return(this.X.ToString()); case nameof(Y): return(this.Y.ToString()); case nameof(Opacity): return(this.Opacity.ToString()); case nameof(TranslationX): return(this.TranslationX.ToString()); case nameof(TranslationY): return(this.TranslationY.ToString()); case nameof(Rotation): return(this.Rotation.ToString()); case nameof(RotationX): return(this.RotationX.ToString()); case nameof(RotationY): return(this.RotationY.ToString()); case nameof(Scale): return(this.Scale.ToString()); //VIEW case nameof(Margin): return(this.Margin.ToString()); case nameof(VerticalOptions): return(this.VerticalOptions.ToString()); case nameof(HorizontalOptions): return(this.HorizontalOptions.ToString()); //BUTTON case nameof(BorderColor): return(BorderColor.ToHex()); #pragma warning disable CS0618 // Type or member is obsolete case nameof(BorderRadius): return(BorderRadius.ToString()); #pragma warning restore CS0618 // Type or member is obsolete case nameof(BorderWidth): return(BorderWidth.ToString()); case nameof(CornerRadius): return(CornerRadius.ToString()); case nameof(CommandParameter): return(CommandParameter.ToString()); case nameof(FontAttributes): return(FontAttributes.ToString()); case nameof(FontFamily): return(FontFamily); case nameof(FontSize): return(FontSize.ToString()); case nameof(TextColor): return(TextColor.ToHex()); case nameof(Text): return(Text); default: return(string.Empty); } }