{
public class BoxViewRenderer : ViewRenderer<BoxView, ERectangle>
{
- public BoxViewRenderer()
- {
- }
-
protected override void OnElementChanged(ElementChangedEventArgs<BoxView> e)
{
if (Control == null)
public ButtonRenderer()
{
RegisterPropertyHandler(Button.TextProperty, UpdateText);
- RegisterPropertyHandler(Button.FontFamilyProperty, UpdateText);
- RegisterPropertyHandler(Button.FontSizeProperty, UpdateText);
- RegisterPropertyHandler(Button.FontAttributesProperty, UpdateText);
+ RegisterPropertyHandler(Button.FontFamilyProperty, UpdateFontFamily);
+ RegisterPropertyHandler(Button.FontSizeProperty, UpdateFontSize);
+ RegisterPropertyHandler(Button.FontAttributesProperty, UpdateFontAttributes);
RegisterPropertyHandler(Button.TextColorProperty, UpdateTextColor);
RegisterPropertyHandler(Button.ImageProperty, UpdateBitmap);
RegisterPropertyHandler(Button.BorderColorProperty, UpdateBorder);
void UpdateText()
{
Control.Text = Element.Text ?? "";
+ }
+
+ void UpdateFontSize()
+ {
Control.FontSize = Element.FontSize;
+ }
+
+ void UpdateFontAttributes()
+ {
Control.FontAttributes = Element.FontAttributes;
+ }
+
+ void UpdateFontFamily()
+ {
Control.FontFamily = Element.FontFamily;
}
protected EvasObject _page;
/// <summary>
- /// The default constructor.
- /// </summary>
- public CarouselPageRenderer()
- {
- }
-
- /// <summary>
/// Invoked whenever the CarouselPage element has been changed in Xamarin.
/// </summary>
/// <param name="e">Event parameters.</param>
{
public class ImageRenderer : ViewRenderer<Image, Native.Image>
{
- public ImageRenderer()
- {
- }
-
protected override void OnElementChanged(ElementChangedEventArgs<Image> e)
{
if (Control == null)
return Task.FromResult<bool>(false);
}
}
-}
\ No newline at end of file
+}
public LabelRenderer()
{
- RegisterPropertyHandler(Label.TextProperty, () => Control.Text = Element.Text);
+ RegisterPropertyHandler(Label.TextProperty, UpdateText);
RegisterPropertyHandler(Label.TextColorProperty, UpdateTextColor);
// FontProperty change is called also for FontSizeProperty, FontFamilyProperty and FontAttributesProperty change
RegisterPropertyHandler(Label.FontProperty, UpdateFontProperties);
RegisterPropertyHandler(Label.LineBreakModeProperty, UpdateLineBreakMode);
- RegisterPropertyHandler(Label.HorizontalTextAlignmentProperty, UpdateTextAlignment);
- RegisterPropertyHandler(Label.VerticalTextAlignmentProperty, UpdateTextAlignment);
+ RegisterPropertyHandler(Label.HorizontalTextAlignmentProperty, UpdateHorizontalTextAlignment);
+ RegisterPropertyHandler(Label.VerticalTextAlignmentProperty, UpdateVerticalTextAlignment);
RegisterPropertyHandler(Label.FormattedTextProperty, UpdateFormattedText);
if (TizenPlatformServices.AppDomain.IsTizenSpecificAvailable)
{
Control.FormattedText = ConvertFormattedText(Element.FormattedText);
}
+ void UpdateText()
+ {
+ Control.Text = Element.Text;
+ }
+
void UpdateTextColor()
{
Control.TextColor = Element.TextColor.ToNative();
}
- void UpdateTextAlignment()
+ void UpdateHorizontalTextAlignment()
{
Control.HorizontalTextAlignment = Element.HorizontalTextAlignment.ToNative();
+ }
+
+ void UpdateVerticalTextAlignment()
+ {
Control.VerticalTextAlignment = Element.VerticalTextAlignment.ToNative();
}
{
bool _isLayoutUpdatedRegistered = false;
- /// <summary>
- /// Default constructor.
- /// </summary>
- public LayoutRenderer()
- {
- }
-
public void RegisterOnLayoutUpdated()
{
if (!_isLayoutUpdatedRegistered)
NaviItem CurrentNaviItem => _naviFrame.NavigationStack.Count > 0 ? _naviFrame.NavigationStack.Last() : null;
NaviItem PreviousNaviItem => _naviFrame.NavigationStack.Count > 1 ? _naviFrame.NavigationStack[_naviFrame.NavigationStack.Count - 2] : null;
- public NavigationPageRenderer()
- {
- }
-
protected override void Dispose(bool disposing)
{
_naviFrame.AnimationFinished -= AnimationFinishedHandler;
}
}
}
-}
\ No newline at end of file
+}
internal Native.Dialog _dialog;
Dictionary<ListItem, int> _itemToItemNumber = new Dictionary<ListItem, int>();
- public PickerRenderer()
- {
- }
-
protected override void OnElementChanged(ElementChangedEventArgs<Picker> e)
{
if (Control == null)
{
public class ProgressBarRenderer : ViewRenderer<ProgressBar, EProgressBar>
{
- public ProgressBarRenderer()
- {
- }
-
protected override void OnElementChanged(ElementChangedEventArgs<ProgressBar> e)
{
if (base.Control == null)
public SliderRenderer()
{
RegisterPropertyHandler(Slider.ValueProperty, UpdateValue);
- RegisterPropertyHandler(Slider.MinimumProperty, UpdateMinMax);
- RegisterPropertyHandler(Slider.MaximumProperty, UpdateMinMax);
+ RegisterPropertyHandler(Slider.MinimumProperty, UpdateMinimum);
+ RegisterPropertyHandler(Slider.MaximumProperty, UpdateMaximum);
}
protected override void OnElementChanged(ElementChangedEventArgs<Slider> e)
Control.Value = Element.Value;
}
- protected void UpdateMinMax()
+ protected void UpdateMinimum()
{
Control.Minimum = Element.Minimum;
+ }
+
+ protected void UpdateMaximum()
+ {
Control.Maximum = Element.Maximum;
- UpdateValue();
}
}
}
public StepperRenderer()
{
RegisterPropertyHandler(Stepper.ValueProperty, UpdateValue);
- RegisterPropertyHandler(Stepper.MinimumProperty, UpdateMinMax);
- RegisterPropertyHandler(Stepper.MaximumProperty, UpdateMinMax);
+ RegisterPropertyHandler(Stepper.MinimumProperty, UpdateMinimum);
+ RegisterPropertyHandler(Stepper.MaximumProperty, UpdateMaximum);
RegisterPropertyHandler(Stepper.IncrementProperty, UpdateStep);
}
Control.Value = Element.Value;
}
- protected void UpdateMinMax()
+ protected void UpdateMinimum()
{
Control.Minimum = Element.Minimum;
+ }
+
+ protected void UpdateMaximum()
+ {
Control.Maximum = Element.Maximum;
- UpdateValue();
}
void UpdateStep()