Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/Controls/samples/Controls.Sample/Pages/MainPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,16 @@ void SetupMauiLayout()

verticalStack.Add(horizontalStack);

var paddingButton = new Button
verticalStack.Add(new Button { Text = "Default" });
verticalStack.Add(new Button { Text = "0 Padding", Padding = 0 });
verticalStack.Add(new Button { Text = "NaN Padding", Padding = double.NaN });
verticalStack.Add(new Button { Text = "NaN,0,0,0 Padding", Padding = new Thickness(double.NaN, 0, 0, 0) });
verticalStack.Add(new Button
{
Padding = new Thickness(40),
Text = "This button has a padding!!",
Text = "This button has a padding of 40!!",
BackgroundColor = Color.Purple,
};

verticalStack.Add(paddingButton);
});
verticalStack.Add(new Button { Text = "CharacterSpacing" });
verticalStack.Add(new Button { CharacterSpacing = 8, Text = "CharacterSpacing" });

Expand Down
2 changes: 2 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Button.Impl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ void IButton.Released()
}

Font IText.Font => Font;

Thickness IPadding.Padding => IsSet(PaddingProperty) ? Padding : new Thickness(double.NaN);
}
}
4 changes: 2 additions & 2 deletions src/Core/src/Core/IActivityIndicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ public interface IActivityIndicator : IView
/// Gets a value that indicates whether the ActivityIndicator should be visible and animating,
/// or hidden.
/// </summary>
bool IsRunning { get; }
bool? IsRunning { get; }

/// <summary>
/// Gets a Color value that defines the display color.
/// </summary>
Color Color { get; }
Color? Color { get; }
}
}
2 changes: 1 addition & 1 deletion src/Core/src/Core/ICheckBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{
public interface ICheckBox : IView
{
bool IsChecked { get; set; }
bool? IsChecked { get; set; }
}
}
10 changes: 5 additions & 5 deletions src/Core/src/Core/IDatePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ public interface IDatePicker : IView
/// <summary>
/// Gets the format of the date to display to the user.
/// </summary>
string Format { get; set; }
string? Format { get; set; }

/// <summary>
/// Gets the displayed date.
/// </summary>
DateTime Date { get; set; }
DateTime? Date { get; set; }

/// <summary>
/// Gets the minimum DateTime selectable.
/// </summary>
DateTime MinimumDate { get; }
DateTime? MinimumDate { get; }

/// <summary>
/// Gets the maximum DateTime selectable.
/// </summary>
DateTime MaximumDate { get; }
DateTime? MaximumDate { get; }

/// <summary>
/// Gets the spacing between characters of the text.
/// </summary>
double CharacterSpacing { get; }
double? CharacterSpacing { get; }
}
}
4 changes: 2 additions & 2 deletions src/Core/src/Core/IEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ public interface IEditor : IView, ITextInput
/// <summary>
/// Gets or sets the placeholder text color.
/// </summary>
Color PlaceholderColor { get; set; }
Color? PlaceholderColor { get; set; }

/// <summary>
/// Gets a value that controls whether text prediction and automatic text correction is on or off.
/// </summary>
bool IsTextPredictionEnabled { get; }
bool? IsTextPredictionEnabled { get; }
}
}
8 changes: 4 additions & 4 deletions src/Core/src/Core/IEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ public interface IEntry : IView, IText, ITextInput, ITextAlignment
/// <summary>
/// Gets a value that indicates if the entry should visually obscure typed text.
/// </summary>
bool IsPassword { get; }
bool? IsPassword { get; }

/// <summary>
/// Gets a value that controls whether text prediction and automatic text correction is on or off.
/// </summary>
bool IsTextPredictionEnabled { get; }
bool? IsTextPredictionEnabled { get; }

/// <summary>
/// Gets an enumeration value that controls the appearance of the return button.
/// </summary>
ReturnType ReturnType { get; }
ReturnType? ReturnType { get; }

/// <summary>
/// Gets an enumeration value that shows/hides clear button on the Entry.
/// </summary>
ClearButtonVisibility ClearButtonVisibility { get; }
ClearButtonVisibility? ClearButtonVisibility { get; }
}
}
24 changes: 12 additions & 12 deletions src/Core/src/Core/IFrameworkElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ public interface IFrameworkElement
/// <summary>
/// Gets a value indicating whether this FrameworkElement is enabled in the user interface.
/// </summary>
bool IsEnabled { get; }
bool? IsEnabled { get; }

/// <summary>
/// Gets the color which will fill the background of a FrameworkElement.
/// </summary>
Color BackgroundColor { get; }
Color? BackgroundColor { get; }

/// <summary>
/// Gets the bounds of the FrameworkElement.
/// </summary>
Rectangle Frame { get; }
Rectangle? Frame { get; }

/// <summary>
/// Gets the current rendered width of this FrameworkElement.
/// </summary>
double Width { get; }
double? Width { get; }

/// <summary>
/// Gets the current rendered height of this FrameworkElement.
/// </summary>
double Height { get; }
double? Height { get; }

/// <summary>
/// Gets or sets the View Handler of the FrameworkElement.
Expand Down Expand Up @@ -59,17 +59,17 @@ public interface IFrameworkElement
/// <summary>
/// Gets the current rendered Size of this FrameworkElement.
/// </summary>
Size DesiredSize { get; }
Size? DesiredSize { get; }

/// <summary>
/// Gets a value indicating whether the current size returned by layout measure is valid.
/// </summary>
bool IsMeasureValid { get; }
bool? IsMeasureValid { get; }

/// <summary>
/// Gets a value indicating whether the computed size and position of child elements in this element's layout are valid.
/// </summary>
bool IsArrangeValid { get; }
bool? IsArrangeValid { get; }

/// <summary>
/// Gets a value indicating whether the computed size and position of child elements in this element's layout are valid.
Expand All @@ -84,21 +84,21 @@ public interface IFrameworkElement
/// <summary>
/// Id used by automation tools to interact with this FrameworkElement
/// </summary>
string AutomationId { get; }
string? AutomationId { get; }

/// <summary>
/// Direction in which the UI elements on the page are scanned by the eye
/// </summary>
FlowDirection FlowDirection { get; }
FlowDirection? FlowDirection { get; }

/// <summary>
/// Determines the horizontal aspect of this element's arrangement in a container
/// </summary>
LayoutAlignment HorizontalLayoutAlignment { get; }
LayoutAlignment? HorizontalLayoutAlignment { get; }

/// <summary>
/// Determines the vertical aspect of this element's arrangement in a container
/// </summary>
LayoutAlignment VerticalLayoutAlignment { get; }
LayoutAlignment? VerticalLayoutAlignment { get; }
}
}
8 changes: 4 additions & 4 deletions src/Core/src/Core/ILabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ public interface ILabel : IView, IText, ITextAlignment, IPadding
/// <summary>
/// Gets the option for line breaking.
/// </summary>
LineBreakMode LineBreakMode { get; }
LineBreakMode? LineBreakMode { get; }

/// <summary>
/// Gets the maximum number of lines allowed in the Label.
/// </summary>
int MaxLines { get; }
int? MaxLines { get; }

/// <summary>
/// Gets the text decoration applied to the Label.
/// Underline and strike-through text decorations can be applied.
/// </summary>
TextDecorations TextDecorations { get; }
TextDecorations? TextDecorations { get; }
/// <summary>
/// Gets the line height applied to the Label.
/// Underline and strike-through text decorations can be applied.
/// </summary>
double LineHeight { get; }
double? LineHeight { get; }
}
}
2 changes: 1 addition & 1 deletion src/Core/src/Core/IPadding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public interface IPadding
/// <summary>
/// Gets the Padding
/// </summary>
Thickness Padding { get; }
Thickness? Padding { get; }
}
}
2 changes: 1 addition & 1 deletion src/Core/src/Core/IPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public interface IPage
/// <summary>
/// Gets or sets the view that contains the content of the Page.
/// </summary>
public IView View { get; set; }
IView? View { get; set; }
}
}
10 changes: 5 additions & 5 deletions src/Core/src/Core/IPicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ public interface IPicker : IView
/// <summary>
/// Gets the title for the Picker.
/// </summary>
string Title { get; }
string? Title { get; }

/// <summary>
/// Gets or sets the internal list of items to template and display.
/// </summary>
IList<string> Items { get; }
IList<string>? Items { get; }

/// <summary>
/// Gets or sets the source list of items to template and display.
/// </summary>
IList ItemsSource { get; }
IList? ItemsSource { get; }

/// <summary>
/// Gets the index of the selected item of the picker.
/// </summary>
int SelectedIndex { get; set; }
int? SelectedIndex { get; set; }

/// <summary>
/// Gets the selected item.
Expand All @@ -36,6 +36,6 @@ public interface IPicker : IView
/// <summary>
/// Gets the character spacing.
/// </summary>
double CharacterSpacing { get; set; }
double? CharacterSpacing { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/Core/src/Core/IPlaceholder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public interface IPlaceholder
/// <summary>
/// Gets the placeholder or hint text.
/// </summary>
string Placeholder { get; }
string? Placeholder { get; }
}
}
2 changes: 1 addition & 1 deletion src/Core/src/Core/IProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public interface IProgress : IView
/// Is a value that represents the current progress as a value from 0 to 1.
/// Progress values less than 0 will be clamped to 0, values greater than 1 will be clamped to 1.
/// </summary>
double Progress { get; }
double? Progress { get; }
}
}
6 changes: 3 additions & 3 deletions src/Core/src/Core/IRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ public interface IRange : IView
/// <summary>
/// Gets or sets the minimum selectable value.
/// </summary>
double Minimum { get; }
double? Minimum { get; }

/// <summary>
/// Gets or sets the maximum selectable value.
/// </summary>
double Maximum { get; }
double? Maximum { get; }

/// <summary>
/// Gets or sets the current value.
/// </summary>
double Value { get; set; }
double? Value { get; set; }
}
}
6 changes: 3 additions & 3 deletions src/Core/src/Core/ISlider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ public interface ISlider : IView, IRange
/// <summary>
/// Gets or sets the color of the portion of the slider track that contains the minimum value of the slider.
/// </summary>
Color MinimumTrackColor { get; }
Color? MinimumTrackColor { get; }

/// <summary>
/// Gets or sets the color of the portion of the slider track that contains the maximum value of the slider.
/// </summary>
Color MaximumTrackColor { get; }
Color? MaximumTrackColor { get; }

/// <summary>
/// Gets or sets the color of the slider thumb button.
/// </summary>
Color ThumbColor { get; }
Color? ThumbColor { get; }

/// <summary>
/// Notify when drag starts.
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Core/IStackLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public interface IStackLayout : ILayout
/// <summary>
/// Identifies the Spacing between childs.
/// </summary>
int Spacing { get; }
int? Spacing { get; }
}
}
2 changes: 1 addition & 1 deletion src/Core/src/Core/IStepper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public interface IStepper : IView, IRange
/// <summary>
/// Gets the amount by which Value is increased or decreased.
/// </summary>
double Interval { get; }
double? Interval { get; }
}
}
6 changes: 3 additions & 3 deletions src/Core/src/Core/ISwitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ public interface ISwitch : IView
/// <summary>
/// Gets or sets a Boolean value that indicates whether this Switch is toggled.
/// </summary>
bool IsToggled { get; set; }
bool? IsToggled { get; set; }

/// <summary>
/// Gets the Switch Track Color.
/// </summary>
Color TrackColor { get; }
Color? TrackColor { get; }

/// <summary>
/// Gets the Switch Thumb Color.
/// </summary>
Color ThumbColor { get; }
Color? ThumbColor { get; }
}
}
Loading