--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.Collections.Generic;
+using ElmSharp;
+using Xamarin.Forms;
+using Xamarin.Forms.Platform.Tizen;
+using Tizen.Wearable.CircularUI.Forms.Renderer;
+using Tizen.Wearable.CircularUI.Forms;
+
+[assembly: ExportRenderer(typeof(Check2TextCell), typeof(Check2TextCellRenderer))]
+namespace Tizen.Wearable.CircularUI.Forms.Renderer
+{
+ public class Check2TextCellRenderer : CheckCellRenderer
+ {
+ protected Check2TextCellRenderer(string style) : base(style)
+ {
+ }
+
+ public Check2TextCellRenderer() : this("2text.1icon.1")
+ {
+ MainPart = "elm.text";
+ DetailPart = "elm.text.1";
+ CheckBoxPart = "elm.icon";
+ }
+
+ protected string DetailPart { get; set; }
+
+ protected override Span OnGetText(Cell cell, string part)
+ {
+ if (part == MainPart)
+ {
+ return new Span()
+ {
+ Text = (cell as CheckCell).Text
+ };
+ }
+ else if (part == DetailPart)
+ {
+ return new Span()
+ {
+ Text = (cell as Check2TextCell).Detail
+ };
+ }
+ return null;
+ }
+
+
+ protected override bool OnCellPropertyChanged(Cell cell, string property, Dictionary<string, EvasObject> realizedView)
+ {
+ if (property == Check2TextCell.DetailProperty.PropertyName)
+ {
+ return true;
+ }
+ return base.OnCellPropertyChanged(cell, property, realizedView);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.Collections.Generic;
+using ElmSharp;
+using Xamarin.Forms;
+using Xamarin.Forms.Platform.Tizen;
+using Tizen.Wearable.CircularUI.Forms.Renderer;
+using Tizen.Wearable.CircularUI.Forms;
+
+[assembly: ExportRenderer(typeof(CheckCell), typeof(CheckCellRenderer))]
+namespace Tizen.Wearable.CircularUI.Forms.Renderer
+{
+ public class CheckCellRenderer : CellRenderer
+ {
+ readonly Dictionary<EvasObject, VisualElement> _cacheCandidate = new Dictionary<EvasObject, VisualElement>();
+
+ protected CheckCellRenderer(string style) : base(style)
+ {
+
+ }
+
+ public CheckCellRenderer() : this("1text.1icon.1")
+ {
+ MainPart = "elm.text";
+ CheckBoxPart = "elm.icon";
+ }
+
+ protected string MainPart { get; set; }
+
+ protected string CheckBoxPart { get; set; }
+
+ protected override Span OnGetText(Cell cell, string part)
+ {
+ if (part == MainPart)
+ {
+ return new Span()
+ {
+ Text = (cell as CheckCell).Text
+ };
+ }
+ return null;
+ }
+
+ protected override EvasObject OnGetContent(Cell cell, string part)
+ {
+ if (part == CheckBoxPart)
+ {
+ var check = new CheckBox()
+ {
+ BindingContext = cell,
+ Parent = cell.Parent
+ };
+ check.SetBinding(CheckBox.IsCheckedProperty, new Binding(CheckCell.OnProperty.PropertyName));
+ check.SetBinding(CheckBox.ColorProperty, new Binding(CheckCell.OnColorProperty.PropertyName));
+ var nativeView = Platform.GetOrCreateRenderer(check).NativeView;
+ nativeView.PropagateEvents = false;
+
+ _cacheCandidate[nativeView] = check;
+ nativeView.Deleted += (sender, e) =>
+ {
+ _cacheCandidate.Remove(sender as EvasObject);
+ };
+ return nativeView;
+ }
+ return null;
+ }
+
+ protected override EvasObject OnReusableContent(Cell cell, string part, EvasObject old)
+ {
+ if (!_cacheCandidate.ContainsKey(old))
+ {
+ return null;
+ }
+ _cacheCandidate[old].BindingContext = cell;
+ return old;
+ }
+
+ protected override bool OnCellPropertyChanged(Cell cell, string property, Dictionary<string, EvasObject> realizedView)
+ {
+ if (property == CheckCell.TextProperty.PropertyName || property == CheckCell.OnProperty.PropertyName || property == CheckCell.OnColorProperty.PropertyName)
+ {
+ return true;
+ }
+ return base.OnCellPropertyChanged(cell, property, realizedView);
+ }
+ }
+}
\ No newline at end of file
SetNativeControl(new WatchDateTimePicker(XForms.NativeParent, surface));
Control.DateTimeChanged += OnDateTimeChanged;
}
- else
- {
- throw new CirclePageNotFoundException();
- }
}
base.OnElementChanged(e);
}
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.Collections.Generic;
+using ElmSharp;
+using Xamarin.Forms;
+using Xamarin.Forms.Platform.Tizen;
+using Tizen.Wearable.CircularUI.Forms.Renderer;
+using Tizen.Wearable.CircularUI.Forms;
+using System;
+
+[assembly: ExportRenderer(typeof(Radio2TextCell), typeof(Radio2TextCellRenderer))]
+namespace Tizen.Wearable.CircularUI.Forms.Renderer
+{
+ public class Radio2TextCellRenderer : RadioCellRenderer
+ {
+ protected Radio2TextCellRenderer(string style) : base(style)
+ {
+
+ }
+
+ public Radio2TextCellRenderer() : this("2text.1icon.1")
+ {
+ MainPart = "elm.text";
+ DetailPart = "elm.text.1";
+ RadioPart = "elm.icon";
+ }
+
+ protected string DetailPart { get; set; }
+
+ protected override Span OnGetText(Cell cell, string part)
+ {
+ if (part == MainPart)
+ {
+ return new Span()
+ {
+ Text = (cell as RadioCell).Text
+ };
+ }
+ else if (part == DetailPart)
+ {
+ return new Span()
+ {
+ Text = (cell as Radio2TextCell).Detail
+ };
+ }
+ return null;
+ }
+
+ protected override bool OnCellPropertyChanged(Cell cell, string property, Dictionary<string, EvasObject> realizedView)
+ {
+ if (property == Radio2TextCell.DetailProperty.PropertyName)
+ {
+ return true;
+ }
+ return base.OnCellPropertyChanged(cell, property, realizedView);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.Collections.Generic;
+using ElmSharp;
+using Xamarin.Forms;
+using Xamarin.Forms.Platform.Tizen;
+using Tizen.Wearable.CircularUI.Forms.Renderer;
+using Tizen.Wearable.CircularUI.Forms;
+using System;
+
+[assembly: ExportRenderer(typeof(RadioCell), typeof(RadioCellRenderer))]
+namespace Tizen.Wearable.CircularUI.Forms.Renderer
+{
+ public class RadioCellRenderer : CellRenderer
+ {
+ protected RadioCellRenderer(string style) : base(style)
+ {
+
+ }
+
+ public RadioCellRenderer() : this("1text.1icon.1")
+ {
+ MainPart = "elm.text";
+ RadioPart = "elm.icon";
+ }
+
+ protected string MainPart { get; set; }
+ protected string RadioPart { get; set; }
+
+ protected override Span OnGetText(Cell cell, string part)
+ {
+ if (part == MainPart)
+ {
+ return new Span()
+ {
+ Text = (cell as RadioCell).Text
+ };
+ }
+ return null;
+ }
+
+ protected override EvasObject OnGetContent(Cell cell, string part)
+ {
+ if (part == RadioPart)
+ {
+ var nativeView = Platform.GetOrCreateRenderer(((RadioCell)cell).RadioButton).NativeView;
+ nativeView.PropagateEvents = false;
+ return nativeView;
+ }
+ return null;
+ }
+
+ protected override bool OnCellPropertyChanged(Cell cell, string property, Dictionary<string, EvasObject> realizedView)
+ {
+ if (property == RadioCell.TextProperty.PropertyName || property == RadioCell.OnProperty.PropertyName || property == RadioCell.GroupNameProperty.PropertyName)
+ {
+ return true;
+ }
+ return base.OnCellPropertyChanged(cell, property, realizedView);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Xamarin.Forms;
+using Xamarin.Forms.Platform.Tizen;
+using Tizen.Wearable.CircularUI.Forms.Renderer;
+using Tizen.Wearable.CircularUI.Forms;
+
+[assembly: ExportRenderer(typeof(SingleTextCell), typeof(SingleTextCellRenderer))]
+namespace Tizen.Wearable.CircularUI.Forms.Renderer
+{
+ public class SingleTextCellRenderer : TextCellRenderer
+ {
+ protected SingleTextCellRenderer(string style) : base(style)
+ {
+ }
+
+ public SingleTextCellRenderer() : this("1text")
+ {
+ MainPart = "elm.text";
+ }
+
+ protected override Span OnGetText(Cell cell, string part)
+ {
+ if (part == MainPart)
+ {
+ return OnMainText((SingleTextCell)cell);
+ }
+ return null;
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.Collections.Generic;
+using ElmSharp;
+using Xamarin.Forms;
+using Xamarin.Forms.Platform.Tizen;
+using Tizen.Wearable.CircularUI.Forms.Renderer;
+using Tizen.Wearable.CircularUI.Forms;
+
+[assembly: ExportRenderer(typeof(Switch2TextCell), typeof(Switch2TextCellRenderer))]
+namespace Tizen.Wearable.CircularUI.Forms.Renderer
+{
+ public class Switch2TextCellRenderer : SwitchCellRenderer
+ {
+ protected Switch2TextCellRenderer(string style) : base(style)
+ {
+ }
+
+ public Switch2TextCellRenderer() : this("2text.1icon.1")
+ {
+ MainPart = "elm.text";
+ DetailPart = "elm.text.1";
+ SwitchPart = "elm.icon";
+ }
+
+ protected string DetailPart { get; set; }
+
+ protected override Span OnGetText(Cell cell, string part)
+ {
+ if (part == MainPart)
+ {
+ return new Span()
+ {
+ Text = (cell as SwitchCell).Text
+ };
+ }
+ else if (part == DetailPart)
+ {
+ return new Span()
+ {
+ Text = (cell as Switch2TextCell).Detail
+ };
+ }
+ return null;
+ }
+
+
+ protected override bool OnCellPropertyChanged(Cell cell, string property, Dictionary<string, EvasObject> realizedView)
+ {
+ if (property == Switch2TextCell.DetailProperty.PropertyName)
+ {
+ return true;
+ }
+ return base.OnCellPropertyChanged(cell, property, realizedView);
+ }
+ }
+}
\ No newline at end of file
* limitations under the License.
*/
+using System;
using Xamarin.Forms;
namespace Tizen.Wearable.CircularUI.Forms
/// <summary>
/// The ActionButtonItem is a class that presents a menu item and associates it with a command
/// </summary>
- /// <since_tizen> 4 </since_tizen>
+ [Obsolete("ActionButtonItem is obsolete as of version 1.5.0. Please use Xamarin.Forms.Button with with Button.Style(TizenSpecific) or ContentButton instead.")]
public class ActionButtonItem : MenuItem
{
/// <summary>
/// BindableProperty. Identifies the IsEnable bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsEnableProperty = BindableProperty.Create(nameof(IsEnable), typeof(bool), typeof(ActionButtonItem), true);
+
/// <summary>
/// BindableProperty. Identifies the IsVisible bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsVisibleProperty = BindableProperty.Create(nameof(IsVisible), typeof(bool), typeof(ActionButtonItem), true);
/// <summary>
/// BindableProperty. Identifies the BackgroundColor bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BackgroundColorProperty = BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(ActionButtonItem), Color.Default);
/// <summary>
/// Gets or sets a boolean value that indicates whether this ActionButtonItem is enabled.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsEnable
{
get => (bool)GetValue(IsEnableProperty);
/// <summary>
/// Gets or sets a boolean value that indicates whether this ActionButtonItem is visible.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsVisible
{
get => (bool)GetValue(IsVisibleProperty);
/// <summary>
/// Gets or sets a background color value of ActionButtonItem.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public Color BackgroundColor
{
get => (Color)GetValue(BackgroundColorProperty);
/// The check widget allows for toggling a value between true and false.
/// The check is extension of Xamarin.Forms.Switch.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
/// <example>
/// <code>
/// var check = new Check
/// <summary>
/// BindableProperty. Identifies the DisplayStyle bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty DisplayStyleProperty = BindableProperty.Create(nameof(DisplayStyle), typeof(CheckDisplayStyle), typeof(Check), defaultValue: CheckDisplayStyle.Default);
/// <summary>
/// BindableProperty. Identifies the Color bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty ColorProperty = BindableProperty.Create(nameof(Color), typeof(Color), typeof(Check), Color.Default);
/// <summary>
/// Gets or sets display style of Check.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public CheckDisplayStyle DisplayStyle
{
get { return (CheckDisplayStyle)GetValue(DisplayStyleProperty); }
/// <summary>
/// Gets or sets a color value of Check.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public Color Color
{
get => (Color)GetValue(ColorProperty);
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Xamarin.Forms;
+
+namespace Tizen.Wearable.CircularUI.Forms
+{
+ /// <summary>
+ /// A Cell with two labels and a Check.
+ /// </summary>
+ public class Check2TextCell : CheckCell
+ {
+ /// <summary>
+ /// Identifies the Detail bindable property.
+ /// </summary>
+ public static readonly BindableProperty DetailProperty = BindableProperty.Create(nameof(Detail), typeof(string), typeof(Check2TextCell), default(string));
+
+ /// <summary>
+ /// Gets or sets the sub text displayed next to the checkbox. This is a bindable property.
+ /// </summary>
+ public string Detail
+ {
+ get { return (string)GetValue(DetailProperty); }
+ set { SetValue(DetailProperty, value); }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using Xamarin.Forms;
+
+namespace Tizen.Wearable.CircularUI.Forms
+{
+ /// <summary>
+ /// A Cell with a label and a Check.
+ /// </summary>
+ public class CheckCell : Cell
+ {
+ /// <summary>
+ /// Identifies the On bindable property.
+ /// </summary>
+ public static readonly BindableProperty OnProperty = BindableProperty.Create(nameof(On), typeof(bool), typeof(CheckCell), false, propertyChanged: (obj, oldValue, newValue) =>
+ {
+ var checkCell = (CheckCell)obj;
+ checkCell.OnChanged?.Invoke(obj, new CheckedChangedEventArgs((bool)newValue));
+ }, defaultBindingMode: BindingMode.TwoWay);
+
+ /// <summary>
+ /// Identifies the Text bindable property.
+ /// </summary>
+ public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(CheckCell), default(string));
+
+ /// <summary>
+ /// The backing store for the OnColor field.
+ /// </summary>
+ public static readonly BindableProperty OnColorProperty = BindableProperty.Create(nameof(OnColor), typeof(Color), typeof(CheckCell), Color.Default);
+
+ /// <summary>
+ /// Gets or sets the color of On state of the checkbox. This is a bindable property.
+ /// </summary>
+ public Color OnColor
+ {
+ get { return (Color)GetValue(OnColorProperty); }
+ set { SetValue(OnColorProperty, value); }
+ }
+
+ /// <summary>
+ /// Gets or sets the state of the checkbox. This is a bindable property.
+ /// </summary>
+ public bool On
+ {
+ get { return (bool)GetValue(OnProperty); }
+ set { SetValue(OnProperty, value); }
+ }
+
+ /// <summary>
+ /// Gets or sets the text displayed next to the checkbox. This is a bindable property.
+ /// </summary>
+ public string Text
+ {
+ get { return (string)GetValue(TextProperty); }
+ set { SetValue(TextProperty, value); }
+ }
+
+ /// <summary>
+ /// Triggered when the checkbox has changed value.
+ /// </summary>
+ public event EventHandler<CheckedChangedEventArgs> OnChanged;
+ }
+}
\ No newline at end of file
/// <summary>
/// Enumeration for the style of the Check.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public enum CheckDisplayStyle
{
/// <summary>
/// <summary>
/// The CircleDateTimeSelector is a view that can change the value by bezel action by touching each item of "Year: Month: Day" and "Hour: Minute: AM / PM"
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class CircleDateTimeSelector : Xamarin.Forms.View, IRotaryFocusable, ICircleSurfaceConsumer
{
/// <summary>
/// BindableProperty. Identifies the MarkerColor bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
[Obsolete("MarkerColor bindable property is obsolete as of Tizen.NET version 4.0.0 and is no longer supported")]
public static readonly BindableProperty MarkerColorProperty = BindableProperty.Create(nameof(MarkerColor), typeof(Color), typeof(CircleDateTimeSelector), Color.Default);
+
/// <summary>
/// BindableProperty. Identifies the ValueType bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty ValueTypeProperty = BindableProperty.Create(nameof(ValueType), typeof(DateTimeType), typeof(CircleDateTimeSelector), DateTimeType.Date);
+
/// <summary>
/// BindableProperty. Identifies the DateTime bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty DateTimeProperty = BindableProperty.Create(nameof(DateTime), typeof(DateTime), typeof(CircleDateTimeSelector), DateTime.Now);
+
/// <summary>
/// BindableProperty. Identifies the MaximumDate bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty MaximumDateProperty = BindableProperty.Create(nameof(MaximumDate), typeof(DateTime), typeof(CircleDateTimeSelector), DateTime.Now + TimeSpan.FromDays(3650));
+
/// <summary>
/// BindableProperty. Identifies the MinimumDate bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty MinimumDateProperty = BindableProperty.Create(nameof(MinimumDate), typeof(DateTime), typeof(CircleDateTimeSelector), new DateTime(1900, 1, 1));
/// <summary>
/// BindableProperty. Identifies the IsVisibleOfYear bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsVisibleOfYearProperty = BindableProperty.Create(nameof(IsVisibleOfYear), typeof(bool), typeof(CircleDateTimeSelector), true);
+
/// <summary>
/// BindableProperty. Identifies the IsVisibleOfMonth bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsVisibleOfMonthProperty = BindableProperty.Create(nameof(IsVisibleOfMonth), typeof(bool), typeof(CircleDateTimeSelector), true);
+
/// <summary>
/// BindableProperty. Identifies the IsVisibleOfDate bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsVisibleOfDateProperty = BindableProperty.Create(nameof(IsVisibleOfDate), typeof(bool), typeof(CircleDateTimeSelector), true);
+
/// <summary>
/// BindableProperty. Identifies the IsVisibleOfHour bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsVisibleOfHourProperty = BindableProperty.Create(nameof(IsVisibleOfHour), typeof(bool), typeof(CircleDateTimeSelector), true);
+
/// <summary>
/// BindableProperty. Identifies the IsVisibleOfMinute bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsVisibleOfMinuteProperty = BindableProperty.Create(nameof(IsVisibleOfMinute), typeof(bool), typeof(CircleDateTimeSelector), true);
+
/// <summary>
/// BindableProperty. Identifies the IsVisibleOfAmPm bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsVisibleOfAmPmProperty = BindableProperty.Create(nameof(IsVisibleOfAmPm), typeof(bool), typeof(CircleDateTimeSelector), true);
/// <summary>
/// Gets or sets Marker color
/// </summary>
- /// <since_tizen> 4 </since_tizen>
[Obsolete("MarkerColor is obsolete as of Tizen.NET version 4.0.0 and is no longer supported")]
public Color MarkerColor { get => (Color)GetValue(MarkerColorProperty); set => SetValue(MarkerColorProperty, value); }
+
/// <summary>
/// Gets or sets DateTimeType value. If it is Time, the UI will be changed to enable time selection. If it is a Date, the date can be changed.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public DateTimeType ValueType { get => (DateTimeType)GetValue(ValueTypeProperty); set => SetValue(ValueTypeProperty, value); }
+
/// <summary>
/// Gets or sets the date / time.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public DateTime DateTime { get => (DateTime)GetValue(DateTimeProperty); set => SetValue(DateTimeProperty, value); }
+
/// <summary>
/// Gets or sets the maximum date when ValueType is Date.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public DateTime MaximumDate { get => (DateTime)GetValue(MaximumDateProperty); set => SetValue(MaximumDateProperty, value); }
+
/// <summary>
/// Gets or sets the minimum date when ValueType is Date.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public DateTime MinimumDate { get => (DateTime)GetValue(MinimumDateProperty); set => SetValue(MinimumDateProperty, value); }
/// <summary>
/// Gets or sets a boolean value that indicates whether the year field type is visible.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsVisibleOfYear
{
get => (bool)GetValue(IsVisibleOfYearProperty);
set => SetValue(IsVisibleOfYearProperty, value);
}
+
/// <summary>
/// Gets or sets a boolean value that indicates whether the month field type is visible.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsVisibleOfMonth
{
get => (bool)GetValue(IsVisibleOfMonthProperty);
set => SetValue(IsVisibleOfMonthProperty, value);
}
+
/// <summary>
/// Gets or sets a boolean value that indicates whether the date field type is visible.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsVisibleOfDate
{
get => (bool)GetValue(IsVisibleOfDateProperty);
set => SetValue(IsVisibleOfDateProperty, value);
}
+
/// <summary>
/// Gets or sets a boolean value that indicates whether the hour field type is visible.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsVisibleOfHour
{
get => (bool)GetValue(IsVisibleOfHourProperty);
set => SetValue(IsVisibleOfHourProperty, value);
}
+
/// <summary>
/// Gets or sets a boolean value that indicates whether the minute field type is visible.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsVisibleOfMinute
{
get => (bool)GetValue(IsVisibleOfMinuteProperty);
/// <summary>
/// Gets or sets a boolean value that indicates whether the AmPm field type is visible.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsVisibleOfAmPm
{
get => (bool)GetValue(IsVisibleOfAmPmProperty);
/// <summary>
/// Gets or sets a CircleSurfaceProvider.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public ICircleSurfaceProvider CircleSurfaceProvider { get; set; }
}
}
\ No newline at end of file
/// The CircleListView is a view that represents Xamarin.Forms.ListView on Circular UI.
/// You can move the list through bezel action.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class CircleListView : ListView, IRotaryFocusable, ICircleSurfaceConsumer
{
/// <summary>
/// BindableProperty. Identifies the Header, Footer cancel the Fish Eye Effect or not.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty CancelEffectProperty = BindableProperty.CreateAttached("CancelEffect", typeof(bool), typeof(CircleListView), false);
/// <summary>
/// BindableProperty. Identifies color of the scroll bar.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BarColorProperty = BindableProperty.CreateAttached("BarColor", typeof(Color), typeof(CircleListView), Color.Default);
/// <summary>
/// Gets the Header, Footer cancel the Fish Eye Effect or not.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static bool GetCancelEffect(BindableObject view) => (bool)view.GetValue(CancelEffectProperty);
/// <summary>
/// Sets the Header, Footer cancel the Fish Eye Effect or not.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static void SetCancelEffect(BindableObject view, bool value) => view.SetValue(CancelEffectProperty, value);
/// <summary>
/// Gets or sets a scroll bar color value.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public Color BarColor
{
get => (Color)GetValue(BarColorProperty);
/// <summary>
/// Gets or sets a CircleSurfaceProvider.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public ICircleSurfaceProvider CircleSurfaceProvider { get; set; }
}
}
\ No newline at end of file
/// The CirclePage is a ContentPage, which allows you to insert views that require CircleSurface, and you can show ToolbarItems with MoreOption.
/// It has an ActionButton, and can use the MenuItem type as text, icon, command, and so on.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
[Obsolete("CirclePage is obsolete as of version 1.5.0. Please use Xamarin.Forms.ContentPage, CircleSurfaceView, and BezelInteracationPage instead.")]
public class CirclePage : ContentPage, ICircleSurfaceProvider, IBezelInteractionRouter
{
/// <summary>
/// BindableProperty. Identifies the ActionButton bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty ActionButtonProperty = BindableProperty.Create(nameof(ActionButton), typeof(ActionButtonItem), typeof(CirclePage), null,
propertyChanged: (b, o, n) =>
{
/// <summary>
/// BindableProperty. Identifies the RotaryFocusObject bindable property Key.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty RotaryFocusObjectProperty = BindableProperty.Create(nameof(RotaryFocusObject), typeof(IRotaryFocusable), typeof(CirclePage), null);
/// <summary>
/// Creates and initializes a new instance of the CirclePage class.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public CirclePage()
{
var surfaceItems = new ObservableCollection<ICircleSurfaceItem>();
surfaceItems.CollectionChanged += OnSurfaceItemsChanged;
CircleSurfaceItems = surfaceItems;
}
+
/// <summary>
/// Gets a list of CircleSurfaceItems represented through CircleSurface.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public IList<ICircleSurfaceItem> CircleSurfaceItems { get; }
[EditorBrowsable(EditorBrowsableState.Never)]
/// <summary>
/// Gets or sets ActionButton that presents a menu item and associates it with a command
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public ActionButtonItem ActionButton
{
get => (ActionButtonItem)GetValue(ActionButtonProperty);
/// <summary>
/// Gets or sets object of RotaryFocusObject to receive bezel action(take a rotary event) from the current page.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public IRotaryFocusable RotaryFocusObject
{
get => (IRotaryFocusable)GetValue(RotaryFocusObjectProperty);
/// <summary>
/// The CirclePageNotFoundException is an Exception class that occurs when a CircleSurface has no child.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
+ /// [Obsolete("CirclePageNotFoundException is obsolete as of version 1.5.0. Please do not use.")]
public class CirclePageNotFoundException : Exception
{
/// <summary>
/// Creates and initializes a new instance of the CirclePageNotFoundException class.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public CirclePageNotFoundException() : base("Circle widget must be child of Circle Page.")
{
}
/// <summary>
/// The CircleProgressBarSurfaceItem displays circular progressbar at CirclePage.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class CircleProgressBarSurfaceItem : CircleSurfaceItem
{
/// <summary>
/// BindableProperty. Identifies the Value bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty ValueProperty = BindableProperty.Create(nameof(Value), typeof(double), typeof(CircleProgressBarSurfaceItem), 0.0 , coerceValue:CoerceValue);
/// <summary>
/// Gets or sets the value of the progressbar.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public double Value { get => (double)GetValue(ValueProperty); set => SetValue(ValueProperty, value); }
internal static object CoerceValue(BindableObject bindable, object value)
/// The CircleScrollView has circular scroll bar. it can be scrolled by bezel action.
/// The CircleScrollView is extension of Xamarin.Forms.ScrollView.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class CircleScrollView : ScrollView, IRotaryFocusable, ICircleSurfaceConsumer
{
/// <summary>
/// BindableProperty. Identifies the Header, Footer cancel the Fish Eye Effect or not.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BarColorProperty = BindableProperty.CreateAttached("BarColor", typeof(Color), typeof(CircleScrollView), Color.Default);
/// <summary>
/// Gets or sets a scroll bar color value.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public Color BarColor
{
get => (Color)GetValue(BarColorProperty);
/// <summary>
/// Gets or sets a CircleSurfaceProvider.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public ICircleSurfaceProvider CircleSurfaceProvider { get; set; }
}
}
\ No newline at end of file
/// <summary>
/// The CircleSliderSurfaceItem displays circular slider at CirclePage.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class CircleSliderSurfaceItem : CircleSurfaceItem, IRotaryFocusable
{
/// <summary>
/// BindableProperty. Identifies the Minimum bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty MinimumProperty = BindableProperty.Create(nameof(Minimum), typeof(double), typeof(CircleSliderSurfaceItem), 0d, coerceValue: (bindable, v) =>
{
var slider = (CircleSliderSurfaceItem)bindable;
/// <summary>
/// BindableProperty. Identifies the Maximum bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty MaximumProperty = BindableProperty.Create(nameof(Maximum), typeof(double), typeof(CircleSliderSurfaceItem), 11d, coerceValue: (bindable, v) =>
{
var slider = (CircleSliderSurfaceItem)bindable;
/// <summary>
/// BindableProperty. Identifies the Increment bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IncrementProperty = BindableProperty.Create(nameof(Increment), typeof(double), typeof(CircleSliderSurfaceItem), 1d, coerceValue: (bindable, v) =>
{
if ((double)v < 0d)
/// <summary>
/// BindableProperty. Identifies the Value bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty ValueProperty = BindableProperty.Create(nameof(Value), typeof(double), typeof(CircleSliderSurfaceItem), 0d, coerceValue: (bindable, v) =>
{
var slider = (CircleSliderSurfaceItem)bindable;
/// <summary>
/// Gets or sets the minimum value of the slider.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public double Minimum { get => (double)GetValue(MinimumProperty); set => SetValue(MinimumProperty, value); }
/// <summary>
/// Gets or sets the maximum value of the slider.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public double Maximum { get => (double)GetValue(MaximumProperty); set => SetValue(MaximumProperty, value); }
/// <summary>
/// Gets or sets the value of the slider.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public double Value
{
get
/// Gets or sets the Increment value.
/// The value of the slider is increased/decreased by the Increment value.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public double Increment
{
get { return (double)GetValue(IncrementProperty); }
namespace Tizen.Wearable.CircularUI.Forms
{
+ /// <summary>
+ /// A container to layout children linear in the circular area.
+ /// </summary>
public class CircleStackLayout : StackLayout
{
protected override void LayoutChildren(double x, double y, double width, double height)
/// <summary>
/// The CircleStepper is a class that extends Xamarin.Forms.Stepper for Circular UI.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class CircleStepper : Stepper, IRotaryFocusable, ICircleSurfaceConsumer
{
/// <summary>
/// BindableProperty. Identifies the MarkerColor bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
[Obsolete("MarkerColor bindable property is obsolete as of Tizen.NET version 4.0.0 and is no longer supported")]
public static readonly BindableProperty MarkerColorProperty = BindableProperty.Create(nameof(MarkerColor), typeof(Color), typeof(CircleStepper), Color.Default);
+
/// <summary>
/// BindableProperty. Identifies the MarkerLineWidth bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
[Obsolete("MarkerLineWidth bindable property is obsolete as of Tizen.NET version 4.0.0 and is no longer supported")]
public static readonly BindableProperty MarkerLineWidthProperty = BindableProperty.Create(nameof(MarkerLineWidth), typeof(int), typeof(CircleStepper), 23);
+
/// <summary>
/// BindableProperty. Identifies the LabelFormat bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty LabelFormatProperty = BindableProperty.Create(nameof(LabelFormat), typeof(string), typeof(CircleStepper), null);
/// <summary>
/// BindableProperty. Identifies the Title bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(CircleStepper), null);
/// <summary>
/// BindableProperty. Identifies whether min/max value is wrapped or not.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsWrapEnabledProperty = BindableProperty.Create(nameof(IsWrapEnabled), typeof(bool), typeof(CircleStepper), true);
/// <summary>
/// Gets or sets Marker color
/// </summary>
- /// <since_tizen> 4 </since_tizen>
[Obsolete("MarkerColor is obsolete as of Tizen.NET version 4.0.0 and is no longer supported")]
public Color MarkerColor
{
/// <summary>
/// Gets or sets length of Marker
/// </summary>
- /// <since_tizen> 4 </since_tizen>
[Obsolete("MarkerLineWidth is obsolete as of Tizen.NET version 4.0.0 and is no longer supported")]
public int MarkerLineWidth
{
/// <summary>
/// Gets or sets format in which Value is shown
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public string LabelFormat
{
get => (string)GetValue(LabelFormatProperty);
/// <summary>
/// Gets or sets title
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public string Title
{
get => (string)GetValue(TitleProperty);
/// <summary>
/// Gets or sets a status of Value is wrapped.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsWrapEnabled
{
get => (bool)GetValue(IsWrapEnabledProperty);
/// <summary>
/// Gets or sets a CircleSurfaceProvider.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public ICircleSurfaceProvider CircleSurfaceProvider { get; set; }
/// <summary>
/// Occurs when the circle stepper's wheel is appeared.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public event EventHandler WheelAppeared;
/// <summary>
/// Occurs when the circle stepper's wheel is disappeared.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public event EventHandler WheelDisappeared;
/// <summary>
/// <summary>
/// The CircleSurfaceEffectBehavior is a behavior which allows you to add views that require CircleSurface.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
+ /// [Obsolete("CircleSurfaceEffectBehavior is obsolete as of version 1.5.0. Please use BezelInteracationPage instead.")]
public class CircleSurfaceEffectBehavior : Behavior<Page>
{
internal static readonly BindableProperty SurfaceProperty = BindableProperty.CreateAttached("CircleSurface", typeof(object), typeof(CircleSurfaceEffectBehavior), null);
+ /// <summary>
+ /// BindableProperty. Identifies the RotaryFocusObject bindable property.
+ /// </summary>
public static readonly BindableProperty RotaryFocusObjectProperty = BindableProperty.CreateAttached("RotaryFocusObject", typeof(IRotaryFocusable), typeof(CircleSurfaceEffectBehavior), null);
internal static object GetSurface(BindableObject obj) => obj.GetValue(SurfaceProperty);
+
internal static void SetSurface(BindableObject obj, object surface) => obj.SetValue(SurfaceProperty, surface);
+ /// <summary>
+ /// Get a RotaryFocusObject
+ /// </summary>
+ /// <param name="obj"> Effect element </param>
+ /// <returns> Focusable object </returns>
public static IRotaryFocusable GetRotaryFocusObject(BindableObject obj) => (IRotaryFocusable)obj.GetValue(RotaryFocusObjectProperty);
+
+ /// <summary>
+ /// Set a RotaryFocusObject
+ /// </summary>
+ /// <param name="obj"> Effect element </param>
+ /// <param name="focusable"> Focusable object </param>
public static void SetRotaryFocusObject(BindableObject obj, IRotaryFocusable focusable) => obj.SetValue(RotaryFocusObjectProperty, focusable);
protected override void OnAttachedTo(Page page)
/// <summary>
/// The CircleSurfaceItem is a class that controls the items represented in the CircleSurface.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class CircleSurfaceItem : Element, ICircleSurfaceItem
{
/// <summary>
/// BindableProperty. Identifies the BackgroundAngle bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BackgroundAngleProperty = BindableProperty.Create(nameof(BackgroundAngle), typeof(double), typeof(CircleSurfaceItem), 360.0);
/// <summary>
/// BindableProperty. Identifies the BackgroundAngleOffset bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BackgroundAngleOffsetProperty = BindableProperty.Create(nameof(BackgroundAngleOffset), typeof(double), typeof(CircleSurfaceItem), 0.0);
/// <summary>
/// BindableProperty. Identifies the BackgroundColor bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BackgroundColorProperty = BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(CircleSurfaceItem), default(Color));
/// <summary>
/// BindableProperty. Identifies the BackgroundLineWidth bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BackgroundLineWidthProperty = BindableProperty.Create(nameof(BackgroundLineWidth), typeof(int), typeof(CircleSurfaceItem), -1);
/// <summary>
/// BindableProperty. Identifies the BackgroundRadius bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BackgroundRadiusProperty = BindableProperty.Create(nameof(BackgroundRadius), typeof(double), typeof(CircleSurfaceItem), -1.0);
/// <summary>
/// BindableProperty. Identifies the BarAngle bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BarAngleProperty = BindableProperty.Create(nameof(BarAngle), typeof(double), typeof(CircleSurfaceItem), 0.0);
/// <summary>
/// BindableProperty. Identifies the BarAngleOffset bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BarAngleOffsetProperty = BindableProperty.Create(nameof(BarAngleOffset), typeof(double), typeof(CircleSurfaceItem), 0.0);
/// <summary>
/// BindableProperty. Identifies the BarAngleMaximum bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BarAngleMaximumProperty = BindableProperty.Create(nameof(BarAngleMaximum), typeof(double), typeof(CircleSurfaceItem), 360.0);
/// <summary>
/// BindableProperty. Identifies the BarAngleMinimum bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BarAngleMinimumProperty = BindableProperty.Create(nameof(BarAngleMinimum), typeof(double), typeof(CircleSurfaceItem), 0.0);
/// <summary>
/// BindableProperty. Identifies the BarColor bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BarColorProperty = BindableProperty.Create(nameof(BarColor), typeof(Color), typeof(CircleSurfaceItem), default(Color));
/// <summary>
/// BindableProperty. Identifies the BarLineWidth bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BarLineWidthProperty = BindableProperty.Create(nameof(BarLineWidth), typeof(int), typeof(CircleSurfaceItem), -1);
/// <summary>
/// BindableProperty. Identifies the BarRadius bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BarRadiusProperty = BindableProperty.Create(nameof(BarRadius), typeof(double), typeof(CircleSurfaceItem), -1.0);
/// <summary>
/// BindableProperty. Identifies the IsVisible bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsVisibleProperty = BindableProperty.Create(nameof(IsVisible), typeof(bool), typeof(CircleSurfaceItem), true);
/// <summary>
/// BindableProperty. Identifies the IsEnabled bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create(nameof(IsEnabled), typeof(bool), typeof(CircleSurfaceItem), true);
/// <summary>
/// Gets or sets the background angle value.
/// If background angle is 180, background of surface item draw 180 degree from background angle offset.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public double BackgroundAngle { get => (double)GetValue(BackgroundAngleProperty); set => SetValue(BackgroundAngleProperty, value); }
/// <summary>
/// Gets or sets the background angle offset value.
/// if background angle offset is 30, background of surface item start at 30 degree.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public double BackgroundAngleOffset { get => (double)GetValue(BackgroundAngleOffsetProperty); set => SetValue(BackgroundAngleOffsetProperty, value); }
/// <summary>
/// Gets or sets the background color value.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public Color BackgroundColor { get => (Color)GetValue(BackgroundColorProperty); set => SetValue(BackgroundColorProperty, value); }
/// <summary>
/// Gets or sets the background line width value.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public int BackgroundLineWidth { get => (int)GetValue(BackgroundLineWidthProperty); set => SetValue(BackgroundLineWidthProperty, value); }
/// <summary>
/// Gets or sets the background radius value.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public double BackgroundRadius { get => (double)GetValue(BackgroundRadiusProperty); set => SetValue(BackgroundRadiusProperty, value); }
/// <summary>
/// Gets or sets the bar angle value.
/// If bar angle is 180, bar of surface item draw 180 degree from bar angle offset.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public double BarAngle { get => (double)GetValue(BarAngleProperty); set => SetValue(BarAngleProperty, value); }
/// <summary>
/// Gets or sets the bar angle offset value.
/// if bar angle offset is 30, bar of surface item start at 30 degree.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public double BarAngleOffset { get => (double)GetValue(BarAngleOffsetProperty); set => SetValue(BarAngleOffsetProperty, value); }
/// <summary>
/// Gets or sets the bar angle maximum value.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public double BarAngleMaximum { get => (double)GetValue(BarAngleMaximumProperty); set => SetValue(BarAngleMaximumProperty, value); }
/// <summary>
/// Gets or sets the bar angle minimum value.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public double BarAngleMinimum { get => (double)GetValue(BarAngleMinimumProperty); set => SetValue(BarAngleMinimumProperty, value); }
/// <summary>
/// Gets or sets the bar color value.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public Color BarColor { get => (Color)GetValue(BarColorProperty); set => SetValue(BarColorProperty, value); }
/// <summary>
/// Gets or sets the bar line width value.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public int BarLineWidth { get => (int)GetValue(BarLineWidthProperty); set => SetValue(BarLineWidthProperty, value); }
/// <summary>
/// Gets or sets the bar radius value.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public double BarRadius { get => (double)GetValue(BarRadiusProperty); set => SetValue(BarRadiusProperty, value); }
/// <summary>
/// Gets or sets the visibility value of circle surface item.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsVisible { get => (bool)GetValue(IsVisibleProperty); set => SetValue(IsVisibleProperty, value); }
/// <summary>
/// Gets or sets a value indicating whether this element is enabled.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsEnabled { get => (bool)GetValue(IsEnabledProperty); set => SetValue(IsEnabledProperty, value); }
}
}
\ No newline at end of file
namespace Tizen.Wearable.CircularUI.Forms
{
+ /// <summary>
+ /// A subclass of Xamarin.Forms.View that can have several CircleSurfaceItem as a View not Page.
+ /// </summary>
public class CircleSurfaceView : View, ICircleSurfaceProvider
{
+ /// <summary>
+ /// An IList of the ICircleSurfaceItem on this CircleSurfaceView.
+ /// </summary>
public IList<ICircleSurfaceItem> CircleSurfaceItems { get; internal set; }
[EditorBrowsable(EditorBrowsableState.Never)]
/// <summary>
/// The CircleToolbarItem is a class that extends Xamarin.Forms.ToolbarItem for Circular UI.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class CircleToolbarItem : ToolbarItem
{
/// <summary>
/// BindableProperty. Identifies the Subtext bindable property to display on the menu item.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty SubTextProperty = BindableProperty.Create(nameof(SubText), typeof(string), typeof(CircleToolbarItem), null);
/// <summary>
/// Gets or sets Subtext to display on the menu item
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public string SubText
{
get => (string)GetValue(SubTextProperty);
namespace Tizen.Wearable.CircularUI.Forms
{
+ /// <summary>
+ /// A subclass of Xamarin.Forms.Shell that have additional options for circular screen.
+ /// </summary>
public class CircularShell : Shell
{
+ /// <summary>
+ /// BindableProperty. Identifies the FlyoutIconBackgroundColor bindable property.
+ /// </summary>
public static readonly BindableProperty FlyoutIconBackgroundColorProperty = BindableProperty.CreateAttached("FlyoutIconBackgroundColor", typeof(Color), typeof(Shell), Color.Default);
+
+ /// <summary>
+ /// BindableProperty. Identifies the FlyoutForegroundColor bindable property.
+ /// </summary>
public static readonly BindableProperty FlyoutForegroundColorProperty = BindableProperty.CreateAttached("FlyoutForegroundColor", typeof(Color), typeof(Shell), Color.Default);
+ /// <summary>
+ /// Get a color of FlyoutIconBackgroundColor
+ /// </summary>
+ /// <param name="element">Xamarin.Forms.Shell</param>
+ /// <returns>Returns a Color of FlyoutIconBackgroundColor</returns>
public static Color GetFlyoutIconBackgroundColor(BindableObject element)
{
return (Color)element.GetValue(FlyoutIconBackgroundColorProperty);
}
+ /// <summary>
+ /// Set a color of FlyoutIconBackgroundColor
+ /// </summary>
+ /// <param name="element">Xamarin.Forms.Shell</param>
+ /// <param name="color">Xamarin.Forms.Color</param>
public static void SetFlyoutIconBackgroundColor(BindableObject element, Color color)
{
element.SetValue(FlyoutIconBackgroundColorProperty, color);
}
+ /// <summary>
+ /// Get a color of FlyoutForegroundColor
+ /// </summary>
+ /// <param name="element">Xamarin.Forms.Shell</param>
+ /// <returns>Returns a Color of FlyoutForegroundColor</returns>
public static Color GetFlyoutForegroundColor(BindableObject element)
{
return (Color)element.GetValue(FlyoutForegroundColorProperty);
}
+ /// <summary>
+ /// Set a color of FlyoutForegroundColor
+ /// </summary>
+ /// <param name="element">Xamarin.Forms.Shell</param>
+ /// <param name="color">Xamarin.Forms.Color</param>
public static void SetFlyoutForegroundColor(BindableObject element, Color color)
{
element.SetValue(FlyoutForegroundColorProperty, color);
}
+ /// <summary>
+ /// Gets or sets FlyoutIconBackgroundColor
+ /// </summary>
public Color FlyoutIconBackgroundColor
{
get => (Color)GetValue(FlyoutIconBackgroundColorProperty);
set => SetValue(FlyoutIconBackgroundColorProperty, value);
}
+ /// <summary>
+ /// Gets or sets FlyoutForegroundColor
+ /// </summary>
public Color FlyoutForegroundColor
{
get => (Color)GetValue(FlyoutForegroundColorProperty);
namespace Tizen.Wearable.CircularUI.Forms
{
+ /// <summary>
+ /// A subclass of Xamarin.Forms.MenuItem that controls the background color of the button used in the popup control.
+ /// </summary>
public class ColorMenuItem : MenuItem
{
/// <summary>
/// BindableProperty. Identifies the BackgroundColor bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BackgroundColorProperty = BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(ActionButtonItem), Color.Default);
/// <summary>
/// Gets or sets a background color value of this ActionButtonItem.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public Color BackgroundColor
{
get => (Color)GetValue(BackgroundColorProperty);
/// <summary>
/// The ContentButton is a Button, which allows you to customize the View to be displayed.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class ContentButton : ContentView, IButtonController
{
/// <summary>
/// BindableProperty. Identifies the Command bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty CommandProperty = BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(ContentButton), null,
propertyChanging: OnCommandChanging, propertyChanged: OnCommandChanged);
/// <summary>
/// BindableProperty. Identifies the CommandParameter bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty CommandParameterProperty = BindableProperty.Create(nameof(CommandParameter), typeof(object), typeof(ContentButton), null,
propertyChanged: (bindable, oldvalue, newvalue) => CommandCanExcuteChanged(bindable, EventArgs.Empty));
/// <summary>
/// Gets or sets command that is executed when the button is clicked.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public ICommand Command
{
get => (ICommand)GetValue(CommandProperty);
/// <summary>
/// Gets or sets command paramter that is executed when the button is clicked.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public object CommandParameter
{
get => GetValue(CommandParameterProperty);
/// <summary>
/// Occurs when the button is clicked.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public event EventHandler Clicked;
/// <summary>
/// Occurs when the button is pressed.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public event EventHandler Pressed;
/// <summary>
/// Occurs when the button is released.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public event EventHandler Released;
bool IsEnabledCore
/// <summary>
/// The ContextPopupEffectBehavior is a behavior which allows you to add a context popup.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class ContextPopupEffectBehavior : Behavior<View>
{
/// <summary>
/// BindableProperty. Identifies the AcceptText bindable property. AcceptText is to use as Accept button
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty AcceptTextProperty = BindableProperty.Create(nameof(AcceptText), typeof(string), typeof(ContextPopupEffectBehavior), null);
/// <summary>
/// BindableProperty. Identifies the AcceptCommand bindable property. AcceptCommand is executed when the Accept button is pressed.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty AcceptCommandProperty = BindableProperty.Create(nameof(AcceptCommand), typeof(ICommand), typeof(ContextPopupEffectBehavior), null);
+
/// <summary>
/// BindableProperty. Identifies the AcceptCommandParameter bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty AcceptCommandParameterProperty = BindableProperty.Create(nameof(AcceptCommandParameter), typeof(object), typeof(ContextPopupEffectBehavior), null);
/// <summary>
/// BindableProperty. Identifies the CancelText bindable property. CancelText is to use as Cancel button
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty CancelTextProperty = BindableProperty.Create(nameof(CancelText), typeof(string), typeof(ContextPopupEffectBehavior), null);
+
/// <summary>
/// BindableProperty. Identifies the CancelCommand bindable property. CancelCommand is executed when the Cancel button is pressed, even if the popup disappears by selecting outside the popup.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty CancelCommandProperty = BindableProperty.Create(nameof(CancelCommand), typeof(ICommand), typeof(ContextPopupEffectBehavior), null);
+
/// <summary>
/// BindableProperty. Identifies the CancelCommandParameter bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty CancelCommandParameterProperty = BindableProperty.Create(nameof(CancelCommandParameter), typeof(object), typeof(ContextPopupEffectBehavior), null);
/// <summary>
/// BindableProperty. Identifies the ConfirmVisibility bindable property. Popup appears if ConfirmVisibility is True, and disappears when it becomes False. CancelCommand works even if it disappears to False.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty VisibilityProperty = BindableProperty.Create(nameof(Visibility), typeof(bool), typeof(ContextPopupEffectBehavior), false);
/// <summary>
/// BindableProperty. Identifies the PositionOption bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty PositionOptionProperty = BindableProperty.Create(nameof(PositionOption), typeof(PositionOption), typeof(ContextPopupEffectBehavior), PositionOption.BottomOfView);
+
/// <summary>
/// BindableProperty. Identifies the Offset bindable property. Offset is a value of how far to move from the base tap position represented by the PositionOption type. If it isn't set, it returns 0,0.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty OffsetProperty = BindableProperty.Create(nameof(Offset), typeof(Point), typeof(ContextPopupEffectBehavior), default(Point));
internal static readonly BindableProperty ContextPopupEffectBehaviorProperty = BindableProperty.CreateAttached("ContextPopupEffectBehavior", typeof(ContextPopupEffectBehavior), typeof(View), null);
/// <summary>
/// Gets or sets text of Accept button
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public string AcceptText
{
get => (string)GetValue(AcceptTextProperty);
/// <summary>
/// Gets or sets command that is executed when the Accept button is pressed.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public ICommand AcceptCommand
{
get => (ICommand)GetValue(AcceptCommandProperty);
/// <summary>
/// Gets or sets command paramter that is executed when the Accept button is pressed.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public object AcceptCommandParameter
{
get => GetValue(AcceptCommandParameterProperty);
/// <summary>
/// Gets or sets text of Cancel button
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public string CancelText
{
get => (string)GetValue(CancelTextProperty);
/// <summary>
/// Gets or sets command that is executed when the Cancel button is pressed, even if the popup disappears by selecting outside the popup.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public ICommand CancelCommand
{
get => (ICommand)GetValue(CancelCommandProperty);
/// <summary>
/// Gets or sets command that is executed when the Cancel button is pressed, even if the popup disappears by selecting outside the popup.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public object CancelCommandParameter
{
get => GetValue(CancelCommandParameterProperty);
/// <summary>
/// Gets visibility of Confirmation popup. Popup appears if ConfirmVisibility is True, and disappears when it becomes False. CancelCommand works even if it disappears to False.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool Visibility
{
get => (bool)GetValue(VisibilityProperty);
/// <summary>
/// Gets or sets position type of popup
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public PositionOption PositionOption
{
get => (PositionOption)GetValue(PositionOptionProperty);
/// <summary>
/// Gets or sets offset. Offset is a value of how far to move from the base tap position represented by the PositionOption type. If it isn't set, it returns 0,0.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public Point Offset
{
get => (Point)GetValue(OffsetProperty);
/// <summary>
/// Enumeration for style type of CircleDateTimeSelector
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public enum DateTimeType
{
/// <summary>
/// Style type of "timepicker/circle"
/// </summary>
Time,
+
/// <summary>
/// Style type of "datepicker/circle"
/// </summary>
/// FlatViewCell contains a developer-defined Xamarin.Forms.View.
/// It has no fish-eye effect while ViewCell has fish-eye effect.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
public class FlatViewCell : ViewCell
{
}
namespace Tizen.Wearable.CircularUI.Forms
{
+ /// <summary>
+ /// An interface to take rotary events.
+ /// </summary>
public interface IBezelInteractionRouter
{
IRotaryFocusable RotaryFocusObject { get; }
/// <summary>
/// The ICircleSurfaceConsumer is an interface represents the CircleSurfaceObject.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public interface ICircleSurfaceConsumer
{
/// <summary>
/// Gets or sets CircleSurfaceProvider
/// </summary>
- /// <since_tizen> 4 </since_tizen>
ICircleSurfaceProvider CircleSurfaceProvider { get; set; }
}
}
\ No newline at end of file
/// <summary>
/// The ICircleSurfaceItem is an interface that controls the items represented in the CircleSurface.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public interface ICircleSurfaceItem
{
/// <summary>
/// Gets or sets CircleSurfaceItem's visibility
/// </summary>
- /// <since_tizen> 4 </since_tizen>
bool IsVisible { get; set; }
}
}
\ No newline at end of file
/// <summary>
/// The ICircleSurfaceProvider is an interface providing the CircleSurface.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public interface ICircleSurfaceProvider
{
/// <summary>
/// Gets or sets CircleSurface object. For internal use only
/// </summary>
- /// <since_tizen> 4 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
object CircleSurface { get; set; }
}
/// <summary>
/// The IInformationPopup is an interface to describe information pop-up which has circular bottom button, title, text, and content area
/// </summary>
- /// <since_tizen> 4 </since_tizen>
internal interface IInformationPopup
{
/// <summary>
/// Occurs when the Back button is pressed.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
event EventHandler BackButtonPressed;
/// <summary>
/// Gets or sets progress visibility of the Popup.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
bool IsProgressRunning { get; set; }
/// <summary>
/// Gets or sets bottom button of the Popup
/// </summary>
- /// <since_tizen> 4 </since_tizen>
MenuItem BottomButton { get; set; }
/// <summary>
/// Gets or sets title of the Popup
/// </summary>
- /// <since_tizen> 4 </since_tizen>
string Title { get; set; }
/// <summary>
/// Gets or sets text of the Popup
/// </summary>
- /// <since_tizen> 4 </since_tizen>
string Text { get; set; }
/// <summary>
/// Shows the Popup
/// </summary>
- /// <since_tizen> 4 </since_tizen>
void Show();
+
/// <summary>
/// Dismisses the Popup
/// </summary>
- /// <since_tizen> 4 </since_tizen>
void Dismiss();
}
}
\ No newline at end of file
/// <summary>
/// The IRotaryFocusable is an interface to take a Rotary Event
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public interface IRotaryFocusable
{
}
/// <summary>
/// The IRotaryEventReceiver is a receiver interface to take Rotary Events
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public interface IRotaryEventReceiver : IRotaryFocusable
{
/// <summary>
/// Rotate it by the RotaryEventArgs value.
/// </summary>
/// <param name="args">Rotated direction of Rotary device</param>
- /// <since_tizen> 4 </since_tizen>
void Rotate(RotaryEventArgs args);
}
}
\ No newline at end of file
/// <summary>
/// This interface, which defines the ability to display simple text, is used internally.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
internal interface IToast
{
/// <summary>
/// Gets or sets the duration.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
int Duration { get; set; }
/// <summary>
/// Gets or sets the text.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
string Text { get; set; }
/// <summary>
/// Gets or sets the file path of icon.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
FileImageSource Icon { get; set; }
/// <summary>
/// Shows the view for the specified duration.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
void Show();
/// <summary>
/// Dismisses the specified view.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
void Dismiss();
}
}
\ No newline at end of file
/// <summary>
/// The ITwoButtonPopup is an interface to describe confirmation pop-up which has circular two button, title, text, and content area
/// </summary>
- /// <since_tizen> 4 </since_tizen>
internal interface ITwoButtonPopup
{
/// <summary>
/// Occurs when the Back button is pressed.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
event EventHandler BackButtonPressed;
/// <summary>
/// Gets or sets content view of the Popup.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
View Content { get; set; }
/// <summary>
/// Gets or sets left button of the Popup
/// </summary>
- /// <since_tizen> 4 </since_tizen>
MenuItem FirstButton { get; set; }
/// <summary>
/// Gets or sets right button of the Popup
/// </summary>
- /// <since_tizen> 4 </since_tizen>
MenuItem SecondButton { get; set; }
/// <summary>
/// Gets or sets title of the Popup
/// </summary>
- /// <since_tizen> 4 </since_tizen>
string Title { get; set; }
/// <summary>
/// Gets or sets text of the Popup
/// </summary>
- /// <since_tizen> 4 </since_tizen>
string Text { get; set; }
/// <summary>
/// Shows the Popup
/// </summary>
- /// <since_tizen> 4 </since_tizen>
void Show();
+
/// <summary>
/// Dismisses the Popup
/// </summary>
- /// <since_tizen> 4 </since_tizen>
void Dismiss();
}
}
\ No newline at end of file
/// The IndexPage is extension of Xamarin.Forms.MultiPage.
/// When Page is added/removed at Multipage. circular index is added/removed automatically at the top of window.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
[Obsolete("IndexPage is obsolete as of version 1.5.0. Please use Xamarin.Forms.CarouselView and Xamarin.Forms.IndicatorView instead.")]
public class IndexPage : MultiPage<ContentPage>
{
/// <summary>
/// BindableProperty. Identifies the IsProgressRunning bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsProgressRunningProperty = BindableProperty.Create(nameof(IsProgressRunning), typeof(bool), typeof(InformationPopup), false);
/// <summary>
/// BindableProperty. Identifies the title bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(InformationPopup), null);
/// <summary>
/// BindableProperty. Identifies the title bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(InformationPopup), null);
/// <summary>
/// BindableProperty. Identifies the first button bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty BottomButtonProperty = BindableProperty.Create(nameof(BottomButton), typeof(MenuItem), typeof(InformationPopup), null);
IInformationPopup _popUp;
/// <summary>
/// Occurs when the device's back button is pressed.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public event EventHandler BackButtonPressed;
public InformationPopup()
/// <summary>
/// Dismisses the InformationPopup.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public void Dismiss()
{
_popUp.Dismiss();
/// The PopupEntry is a class that extends Xamarin.Forms.Entry.
/// It makes a new layer when editing text on the entry.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class PopupEntry : Entry
{
/// <summary>
/// BindableProperty. Identifies color of Popup background.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty PopupBackgroundColorProperty = BindableProperty.CreateAttached(nameof(PopupBackgroundColor), typeof(Color), typeof(PopupEntry), Color.Default);
/// <summary>
/// BindableProperty. Identifies whether Popup is opended or not.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsPopupOpenedProperty = BindableProperty.CreateAttached(nameof(IsPopupOpened), typeof(bool), typeof(PopupEntry), false);
/// <summary>
/// Gets or sets a color value of Popup.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public Color PopupBackgroundColor
{
get => (Color)GetValue(PopupBackgroundColorProperty);
/// <summary>
/// Gets or sets a status of Popup's open.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsPopupOpened
{
get => (bool)GetValue(IsPopupOpenedProperty);
/// <summary>
/// Enumeration for position type of popup
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public enum PositionOption
{
/// <summary>
/// The popup appears at the bottom of the View using the Effect. The position is changed by Offset in the center of View.
/// </summary>
BottomOfView,
+
/// <summary>
/// In the center of the screen, move by the Offset in the Popup.
/// </summary>
CenterOfParent,
+
/// <summary>
/// The value of Offset is X, Y and popup is placed on the screen.
/// </summary>
Absolute,
+
/// <summary>
/// Set Offset.X * Window.Width, Offset.Y * Window.Height.
/// </summary>
/// <summary>
/// The Radio is a widget that allows one or more options to be displayed and have the user choose only one of them.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
/// <example>
/// <code>
/// var radio1 = new Radio
/// <summary>
/// BindableProperty. Identifies the Value bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty ValueProperty = BindableProperty.Create("Value", typeof(string), typeof(Radio), default(string));
/// <summary>
/// BindableProperty. Identifies the IsSelected bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty IsSelectedProperty = BindableProperty.Create("IsSelected", typeof(bool), typeof(Radio), false,
propertyChanged: IsSelectedPropertyChanged);
/// <summary>
/// BindableProperty. Identifies the GroupName bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty GroupNameProperty = BindableProperty.Create("GroupName", typeof(string), typeof(Radio), default(string));
/// <summary>
/// BindableProperty. Identifies the Color bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty ColorProperty = BindableProperty.Create(nameof(Color), typeof(Color), typeof(Radio), Color.Default);
/// Gets or sets the value of the Radio.
/// This is a bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public string Value
{
get { return (string)GetValue(ValueProperty); }
/// Gets or sets the name that specifies which Radio controls are mutually exclusive.
/// It can be set to null.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public string GroupName
{
get { return (string)GetValue(GroupNameProperty); }
/// <summary>
/// Gets or sets a boolean value that indicates whether this Radio is selected.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsSelected
{
get { return (bool)GetValue(IsSelectedProperty); }
/// <summary>
/// Occurs when the Radio selection was changed.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public event EventHandler<SelectedEventArgs> Selected;
/// <summary>
/// Gets or sets a color value of Radio.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public Color Color
{
get => (Color)GetValue(ColorProperty);
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Xamarin.Forms;
+
+namespace Tizen.Wearable.CircularUI.Forms
+{
+ /// <summary>
+ /// A Cell with two labels and a RadioButton.
+ /// </summary>
+ public class Radio2TextCell : RadioCell
+ {
+ /// <summary>
+ /// Identifies the Detail bindable property.
+ /// </summary>
+ public static readonly BindableProperty DetailProperty = BindableProperty.Create(nameof(Detail), typeof(string), typeof(Radio2TextCell), default(string));
+
+ /// <summary>
+ /// Gets or sets the sub text displayed next to the radio button. This is a bindable property.
+ /// </summary>
+ public string Detail
+ {
+ get { return (string)GetValue(DetailProperty); }
+ set { SetValue(DetailProperty, value); }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.ComponentModel;
+using Xamarin.Forms;
+
+namespace Tizen.Wearable.CircularUI.Forms
+{
+ /// <summary>
+ /// A Cell with a label and a RadioButton.
+ /// </summary>
+ public class RadioCell : Cell
+ {
+ /// <summary>
+ /// Identifies the On bindable property.
+ /// </summary>
+ public static readonly BindableProperty OnProperty = BindableProperty.Create(nameof(On), typeof(bool), typeof(RadioCell), false, propertyChanged: (obj, oldValue, newValue) =>
+ {
+ var radioCell = (RadioCell)obj;
+ radioCell.OnChanged?.Invoke(obj, new CheckedChangedEventArgs((bool)newValue));
+ }, defaultBindingMode: BindingMode.TwoWay);
+
+ /// <summary>
+ /// Identifies the GroupName bindable property.
+ /// </summary>
+ public static readonly BindableProperty GroupNameProperty = BindableProperty.Create(nameof(GroupName), typeof(string), typeof(RadioCell), default(string));
+
+ /// <summary>
+ /// Identifies the Text bindable property.
+ /// </summary>
+ public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(RadioCell), default(string));
+
+ /// <summary>
+ /// Gets or sets the state of the radio button. This is a bindable property.
+ /// </summary>
+ public bool On
+ {
+ get { return (bool)GetValue(OnProperty); }
+ set { SetValue(OnProperty, value); }
+ }
+
+ /// <summary>
+ /// Gets or sets the group name of the radio button. This is a bindable property.
+ /// </summary>
+ public string GroupName
+ {
+ get { return (string)GetValue(GroupNameProperty); }
+ set { SetValue(GroupNameProperty, value); }
+ }
+
+ /// <summary>
+ /// Gets or sets the text displayed next to the radio button. This is a bindable property.
+ /// </summary>
+ public string Text
+ {
+ get { return (string)GetValue(TextProperty); }
+ set { SetValue(TextProperty, value); }
+ }
+
+ /// <summary>
+ /// Triggered when the radio button has changed value.
+ /// </summary>
+ public event EventHandler<CheckedChangedEventArgs> OnChanged;
+
+
+ /// <summary>
+ /// Internal use only.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public RadioButton RadioButton { get; }
+
+ public RadioCell()
+ {
+ RadioButton = new RadioButton()
+ {
+ Parent = this,
+ BindingContext = this,
+ };
+ RadioButton.SetBinding(RadioButton.IsCheckedProperty, new Binding(OnProperty.PropertyName));
+ RadioButton.SetBinding(RadioButton.GroupNameProperty, new Binding(GroupNameProperty.PropertyName));
+ }
+ }
+}
\ No newline at end of file
/// Delegate for a triggering rotary event
/// </summary>
/// <param name="args">Rotated direction of Rotary device</param>
- /// <since_tizen> 4 </since_tizen>
public delegate void RotaryEventHandler(RotaryEventArgs args);
/// <summary>
/// Event arguments for RotaryEvent.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class RotaryEventArgs : EventArgs
{
/// <summary>
/// Gets or sets rotated direction of Rotary device. IsClockwise is true when Rotary device rotated in the clockwise direction or false on counter clockwise.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsClockwise { get; set; }
}
}
\ No newline at end of file
/// <summary>
/// The RotaryEventManager provides an event for the global rotary event for wearable devices.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
/// <example>
/// <code>
/// RotaryEventManager.Rotated += (s, e) =>
/// <summary>
/// Event arguments for events of RadioButton.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class SelectedEventArgs : EventArgs
{
/// <summary>
/// Creates a new SelectedEventArgs object that represents a change from RadioButton.
/// </summary>
/// <param name="value">The boolean value that checks whether the RadioButton is selected.</param>
- /// <since_tizen> 4 </since_tizen>
public SelectedEventArgs(string value, bool isSelected)
{
Value = value;
/// <summary>
/// Gets the Value for the SelectedEventArgs object.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public string Value { get; private set; }
/// <summary>
/// Gets the IsSelected for the SelectedEventArgs object.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public bool IsSelected { get; private set; }
}
}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Xamarin.Forms;
+
+namespace Tizen.Wearable.CircularUI.Forms
+{
+ /// <summary>
+ /// A Cell with a signle text. The Detail property is always ignored.
+ /// </summary>
+ public class SingleTextCell : TextCell
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Xamarin.Forms;
+
+namespace Tizen.Wearable.CircularUI.Forms
+{
+ /// <summary>
+ /// A Cell with two labels and a Switch.
+ /// </summary>
+ public class Switch2TextCell : SwitchCell
+ {
+ /// <summary>
+ /// Identifies the Detail bindable property.
+ /// </summary>
+ public static readonly BindableProperty DetailProperty = BindableProperty.Create(nameof(Detail), typeof(string), typeof(Switch2TextCell), default(string));
+
+ /// <summary>
+ /// Gets or sets the sub text displayed next to the switch. This is a bindable property.
+ /// </summary>
+ public string Detail
+ {
+ get { return (string)GetValue(DetailProperty); }
+ set { SetValue(DetailProperty, value); }
+ }
+ }
+}
\ No newline at end of file
/// <summary>
/// The Toast class provides properties that show simple types of messages
/// </summary>
- /// <since_tizen> 4 </since_tizen>
/// <example>
/// <code>
/// Toast.DisplayText("Hello World", 3000)
/// </summary>
/// <param name="text">The body text of the toast.</param>
/// <param name="duration">How long to display the text in milliseconds.</param>
- /// <since_tizen> 4 </since_tizen>
public static void DisplayText(string text, int duration)
{
new ToastProxy
/// <param name="text">The body text of the toast.</param>
/// <param name="icon">The file path of the toast icon.</param>
/// <param name="duration">How long to display the text in milliseconds.</param>
- /// <since_tizen> 4 </since_tizen>
public static void DisplayIconText(string text, FileImageSource icon, int duration)
{
new ToastProxy
/// </summary>
/// <param name="text">The body text of the toast.</param>
/// <param name="icon">The file path of the toast icon.</param>
- /// <since_tizen> 4 </since_tizen>
public static void DisplayIconText(string text, FileImageSource icon) => DisplayIconText(text, icon, 3000);
}
}
\ No newline at end of file
/// <summary>
/// This class is for the internal use by toast.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
internal class ToastProxy : IToast
{
IToast _toastProxy;
/// <summary>
/// Gets or sets duration of the Toast pop-up.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public int Duration
{
get
/// <summary>
/// Gets or sets text of the Toast pop-up.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public string Text
{
get
/// <summary>
/// Gets or sets icon of the Toast pop-up.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public FileImageSource Icon
{
get
/// <summary>
/// Dismisses the Toast pop-up.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public void Dismiss()
{
_toastProxy.Dismiss();
/// <summary>
/// Shows the Toast pop-up.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public void Show()
{
_toastProxy.Show();
/// <summary>
/// The TwoButtonPage is a page that has a rectangular area inside the circle as contents area. It also has two buttons and a Title area.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public class TwoButtonPage : ContentPage
{
/// <summary>
/// BindableProperty. Identifies the FirstButton bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty FirstButtonProperty = BindableProperty.Create(nameof(FirstButton), typeof(MenuItem), typeof(TwoButtonPage),
propertyChanged: (b, o, n) =>
{
/// <summary>
/// BindableProperty. Identifies the SecondButton bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty SecondButtonProperty = BindableProperty.Create(nameof(SecondButton), typeof(MenuItem), typeof(TwoButtonPage),
propertyChanged: (b, o, n) =>
{
/// <summary>
/// BindableProperty. Identifies the Overlap bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty OverlapProperty = BindableProperty.Create(nameof(Overlap), typeof(bool), typeof(TwoButtonPage), false);
/// <summary>
/// Gets or sets left button of TwoButtonPage.
/// Text property of MenuItem is ignored since button has no space to display text.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public MenuItem FirstButton
{
get => (MenuItem)GetValue(FirstButtonProperty);
/// Gets or sets right button of TwoButtonPage.
/// Text property of MenuItem is ignored since button has no space to display text.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public MenuItem SecondButton
{
get => (MenuItem)GetValue(SecondButtonProperty);
/// <summary>
/// The TwoButtonPopup describe pop-up which has circular two button, title, text, and content area.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
/// <example>
/// <code>
/// var leftButton = new MenuItem()
/// <summary>
/// BindableProperty. Identifies the content bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty ContentProperty = BindableProperty.Create(nameof(Content), typeof(View), typeof(TwoButtonPopup), null);
/// <summary>
/// BindableProperty. Identifies the title bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(TwoButtonPopup), null);
/// <summary>
/// BindableProperty. Identifies the title bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TwoButtonPopup), null);
/// <summary>
/// BindableProperty. Identifies the first button bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty FirstButtonProperty = BindableProperty.Create(nameof(FirstButton), typeof(MenuItem), typeof(TwoButtonPopup), null);
/// <summary>
/// BindableProperty. Identifies the second button bindable property.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public static readonly BindableProperty SecondButtonProperty = BindableProperty.Create(nameof(SecondButton), typeof(MenuItem), typeof(TwoButtonPopup), null);
ITwoButtonPopup _popUp;
/// <summary>
/// Occurs when the device's back button is pressed.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public event EventHandler BackButtonPressed;
/// <summary>
/// Creates and initializes a new instance of the TwoButtonPopup class.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public TwoButtonPopup()
{
_popUp = DependencyService.Get<ITwoButtonPopup>(DependencyFetchTarget.NewInstance);
/// <summary>
/// Gets or sets content view of the Popup.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public View Content
{
get { return (View)GetValue(ContentProperty); }
/// <summary>
/// Gets or sets title of the Popup.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public string Title
{
get { return (string)GetValue(TitleProperty); }
/// <summary>
/// Gets or sets text of the Popup.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public string Text
{
get { return (string)GetValue(TextProperty); }
/// Gets or sets left button of the Popup.
/// Text property of MenuItem is ignored since button has no space to display text.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public MenuItem FirstButton
{
get { return (MenuItem)GetValue(FirstButtonProperty); }
/// Gets or sets right button of the Popup.
/// Text property of MenuItem is ignored since button has no space to display text.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public MenuItem SecondButton
{
get { return (MenuItem)GetValue(SecondButtonProperty); }
/// <summary>
/// Shows the TwoButtonPopup.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public void Show()
{
_popUp.Show();
/// <summary>
/// Dismisses the TwoButtonPopup.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
public void Dismiss()
{
_popUp.Dismiss();
+++ /dev/null
-namespace Xamarin.Forms
-{
- public class AppThemeColor : OnAppTheme<Color> { }
-}
\ No newline at end of file
}
}
- public OSAppTheme RequestedTheme => Device.PlatformServices.RequestedTheme;
+ public OSAppTheme UserAppTheme
+ {
+ get => _userAppTheme;
+ set
+ {
+ _userAppTheme = value;
+ TriggerThemeChangedActual(new AppThemeChangedEventArgs(value));
+ }
+ }
+ public OSAppTheme RequestedTheme => UserAppTheme == OSAppTheme.Unspecified ? Device.PlatformServices.RequestedTheme : UserAppTheme;
public event EventHandler<AppThemeChangedEventArgs> RequestedThemeChanged
{
bool _themeChangedFiring;
OSAppTheme _lastAppTheme;
+ OSAppTheme _userAppTheme = OSAppTheme.Unspecified;
[EditorBrowsable(EditorBrowsableState.Never)]
- public void OnRequestedThemeChanged(AppThemeChangedEventArgs args)
+ public void TriggerThemeChanged(AppThemeChangedEventArgs args)
+ {
+ if (UserAppTheme != OSAppTheme.Unspecified)
+ return;
+ TriggerThemeChangedActual(args);
+ }
+
+ void TriggerThemeChangedActual(AppThemeChangedEventArgs args)
{
if (Device.Flags == null || Device.Flags.IndexOf(ExperimentalFlags.AppThemeExperimental) == -1)
return;
return returnIfNotSet;
}
-
- public static void SetOnAppTheme<T>(this BindableObject self, BindableProperty targetProperty, T light, T dark, T defaultValue = default)
- {
- ExperimentalFlags.VerifyFlagEnabled(nameof(BindableObjectExtensions), ExperimentalFlags.AppThemeExperimental, nameof(BindableObjectExtensions), nameof(SetOnAppTheme));
-
- var appTheme = new OnAppTheme<T> { Light = light, Dark = dark, Default = defaultValue };
- self.SetBinding(targetProperty, appTheme);
- }
-
- public static void SetAppThemeColor(this BindableObject self, BindableProperty targetProperty, Color light, Color dark, Color defaultValue = default)
- {
- ExperimentalFlags.VerifyFlagEnabled(nameof(BindableObjectExtensions), ExperimentalFlags.AppThemeExperimental, nameof(BindableObjectExtensions), nameof(SetAppThemeColor));
-
- var appTheme = new AppThemeColor { Light = light, Dark = dark, Default = defaultValue };
- self.SetBinding(targetProperty, appTheme);
- }
}
}
\ No newline at end of file
{
const string ExpandAnimationName = nameof(ExpandAnimationName);
const uint DefaultAnimationLength = 250;
+ const double EnabledOpacity = 1;
+ const double DisabledOpacity = .6;
public event EventHandler Tapped;
SetContent(true, true);
}
+ protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ base.OnPropertyChanged(propertyName);
+ if (propertyName == IsEnabledProperty.PropertyName)
+ OnIsEnabledChanged();
+ }
+
protected override void OnSizeAllocated(double width, double height)
{
base.OnSizeAllocated(width, height);
State = ExpanderState.Expanded;
});
}
+
+ void OnIsEnabledChanged()
+ => ExpanderLayout.Opacity = IsEnabled ? EnabledOpacity: DisabledOpacity;
}
}
\ No newline at end of file
namespace Xamarin.Forms
{
- public class OnAppTheme<T> : BindingBase
+ class OnAppTheme<T> : BindingBase
{
WeakReference<BindableObject> _weakTarget;
BindableProperty _targetProperty;
- public OnAppTheme()
- {
- Application.Current.RequestedThemeChanged += ThemeChanged;
- }
+ public OnAppTheme() => Application.Current.RequestedThemeChanged += (o,e) => Device.BeginInvokeOnMainThread(() => ApplyCore());
- void ThemeChanged(object sender, AppThemeChangedEventArgs e)
- {
- Device.BeginInvokeOnMainThread(() => ApplyCore());
- }
- public new BindingMode Mode
- {
- get => base.Mode;
- private set { }
- }
- internal override BindingBase Clone()
- {
- return new OnAppTheme<T> { Light = Light, Dark = Dark, Default = Default };
- }
+ internal override BindingBase Clone() => new OnAppTheme<T> { Light = Light, Dark = Dark, Default = Default };
internal override void Apply(bool fromTarget)
{
base.Apply(context, bindObj, targetProperty, fromBindingContextChanged);
ApplyCore();
}
+
+ internal override void Unapply(bool fromBindingContextChanged = false)
+ {
+ base.Unapply(fromBindingContextChanged);
+ _weakTarget = null;
+ _targetProperty = null;
+ }
+
void ApplyCore()
{
if (_weakTarget == null || !_weakTarget.TryGetTarget(out var target))
_isLightSet = true;
}
}
+
public T Dark
{
get => _dark;
_isDarkSet = true;
}
}
+
public T Default
{
get => _default;
}
}
- public static implicit operator T(OnAppTheme<T> onAppTheme)
- {
- return onAppTheme.GetValue();
- }
-
- public T Value => GetValue();
-
T GetValue()
{
switch (Application.Current.RequestedTheme)
return OnBackButtonPressed();
}
- protected override void OnRequestedThemeChanged(OSAppTheme newValue)
- {
- base.OnRequestedThemeChanged(newValue);
-
- Resources?.Reload();
- }
-
protected virtual void LayoutChildren(double x, double y, double width, double height)
{
var area = new Rectangle(x, y, width, height);
protected virtual bool OnBackButtonPressed()
{
+ if (RealParent is BaseShellItem || RealParent is Shell)
+ return true;
+
var application = RealParent as Application;
if (application == null || this == application.MainPage)
return false;
set => SetValue(CurrentItemProperty, value);
}
+ internal ShellContent CurrentContent => CurrentItem?.CurrentItem?.CurrentItem;
+ internal ShellSection CurrentSection => CurrentItem?.CurrentItem;
+
public ShellNavigationState CurrentState => (ShellNavigationState)GetValue(CurrentStateProperty);
[TypeConverter(typeof(ImageSourceConverter))]
protected override bool OnBackButtonPressed()
{
+ if(GetVisiblePage() is Page page)
+ {
+ if(!page.SendBackButtonPressed())
+ {
+ return false;
+ }
+ }
+
var currentContent = CurrentItem?.CurrentItem;
if (currentContent != null && currentContent.Stack.Count > 1)
{
return lookupDict;
}
- internal FlyoutBehavior GetEffectiveFlyoutBehavior() => GetEffectiveValue(Shell.FlyoutBehaviorProperty, FlyoutBehavior);
+ internal FlyoutBehavior GetEffectiveFlyoutBehavior()
+ {
+ ShellItem rootItem = null;
+ return GetEffectiveValue(Shell.FlyoutBehaviorProperty,
+ () =>
+ {
+ if (this.IsSet(FlyoutBehaviorProperty))
+ return FlyoutBehavior;
+
+ if (rootItem is FlyoutItem)
+ return FlyoutBehavior.Flyout;
+ else if (rootItem is TabBar)
+ return FlyoutBehavior.Disabled;
+
+ return FlyoutBehavior;
+ },
+ (o) => rootItem = rootItem ?? o as ShellItem);
+ }
T GetEffectiveValue<T>(BindableProperty property, T defaultValue)
{
- Element element = GetVisiblePage();
+ return GetEffectiveValue(property, () => defaultValue, null);
+ }
+
+ T GetEffectiveValue<T>(BindableProperty property, Func<T> defaultValue, Action<Element> observer)
+ {
+ Element element = GetVisiblePage() ?? CurrentContent;
while (element != this && element != null)
{
+ observer?.Invoke(element);
+
if (element.IsSet(property))
return (T)element.GetValue(property);
element = element.Parent;
}
- return defaultValue;
+ if (defaultValue == null)
+ return default(T);
+
+ return defaultValue();
}
ShellAppearance GetAppearanceForPivot(Element pivot)
public FlyoutItem()
{
- Shell.SetFlyoutBehavior(this, FlyoutBehavior.Flyout);
+
}
}
{
public TabBar()
{
- Shell.SetFlyoutBehavior(this, FlyoutBehavior.Disabled);
}
}
{
UnApplyCore(bindable, BasedOn ?? GetBasedOnResource(bindable));
bindable.RemoveDynamicResource(_basedOnResourceProperty);
- _targets.RemoveAll(wr =>
+ lock (_targets)
{
- BindableObject target;
- return wr.TryGetTarget(out target) && target == bindable;
- });
+ _targets.RemoveAll(wr =>
+ {
+ BindableObject target;
+ return wr.TryGetTarget(out target) && target == bindable;
+ });
+ }
}
internal bool CanBeAppliedTo(Type targetType)
return;
}
- _targets.RemoveAll(t => t == null || !t.TryGetTarget(out _));
- _cleanupThreshold = _targets.Count + CleanupTrigger;
+ lock (_targets)
+ {
+ _targets.RemoveAll(t => t == null || !t.TryGetTarget(out _));
+ _cleanupThreshold = _targets.Count + CleanupTrigger;
+ }
}
}
}
\ No newline at end of file
internal VisualElement()
{
- if (Application.Current != null)
- Application.Current.RequestedThemeChanged += (s, a) => OnRequestedThemeChanged(a.RequestedTheme);
- }
-
- protected virtual void OnRequestedThemeChanged(OSAppTheme newValue)
- {
- ExperimentalFlags.VerifyFlagEnabled(nameof(VisualElement), ExperimentalFlags.AppThemeExperimental, nameof(OnRequestedThemeChanged));
}
public double AnchorX
InvalidateMeasureInternal(InvalidationTrigger.Undefined);
}
+ internal override void OnResourcesChanged(object sender, ResourcesChangedEventArgs e)
+ {
+ if (e == ResourcesChangedEventArgs.StyleSheets)
+ ApplyStyleSheets();
+ else
+ base.OnResourcesChanged(sender, e);
+ }
+
internal override void OnParentResourcesChanged(IEnumerable<KeyValuePair<string, object>> values)
{
if (values == null)
(self as IPropertyPropagationController)?.PropagatePropertyChanged(VisualElement.VisualProperty.PropertyName);
}
- static void FlowDirectionChanged(BindableObject bindable, object oldValue, object newValue)
+ static void FlowDirectionChanging(BindableObject bindable, object oldValue, object newValue)
{
var self = bindable as IFlowDirectionController;
if (self.EffectiveFlowDirection.IsExplicit() && oldValue == newValue)
return;
- var newFlowDirection = (FlowDirection)newValue;
+ var newFlowDirection = ((FlowDirection)newValue).ToEffectiveFlowDirection(isExplicit: true);
- self.EffectiveFlowDirection = newFlowDirection.ToEffectiveFlowDirection(isExplicit: true);
+ if (self is VisualElement ve)
+ ve.SetEffectiveFlowDirection(newFlowDirection, false);
+ else
+ self.EffectiveFlowDirection = newFlowDirection;
+ }
- (self as IPropertyPropagationController)?.PropagatePropertyChanged(VisualElement.FlowDirectionProperty.PropertyName);
+ static void FlowDirectionChanged(BindableObject bindable, object oldValue, object newValue)
+ {
+ (bindable as IPropertyPropagationController)?.PropagatePropertyChanged(VisualElement.FlowDirectionProperty.PropertyName);
}
--- /dev/null
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+namespace Xamarin.Forms
+{
+ public static class VisualElementExtensions
+ {
+ public static void SetOnAppTheme<T>(this VisualElement self, BindableProperty targetProperty, T light, T dark)
+ {
+ ExperimentalFlags.VerifyFlagEnabled(nameof(BindableObjectExtensions), ExperimentalFlags.AppThemeExperimental, nameof(BindableObjectExtensions), nameof(SetOnAppTheme));
+ self.SetBinding(targetProperty, new OnAppTheme<T> { Light = light, Dark = dark});
+ }
+
+ public static void SetAppThemeColor(this VisualElement self, BindableProperty targetProperty, Color light, Color dark) => SetOnAppTheme(self, targetProperty, light, dark);
+ }
+}
\ No newline at end of file
{
return null;
}
+
+ protected virtual void OnCreated(Cell cell, bool isGroup)
+ {
+ }
+
protected virtual void OnDeleted(Cell cell)
{
}
OnUnrealizedCell(cell);
}
+ public void SendCreatedCell(Cell cell, bool isGroup = false)
+ {
+ OnCreated(cell, isGroup);
+ }
+
internal Native.ListView.ItemContext GetCurrentItem()
{
return _currentItem;
{
nativeView.PropagateEvents = false;
}
+
+ _cacheCandidate[nativeView] = toggle;
+ nativeView.Deleted += (sender, e) =>
+ {
+ _cacheCandidate.Remove(sender as EvasObject);
+ };
+
return nativeView;
}
return null;
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using ElmSharp;
+
+namespace Xamarin.Forms.Platform.Tizen.Native
+{
+ interface ITableView
+ {
+ void ApplyTableRoot(TableRoot root);
+ }
+}
\ No newline at end of file
/// <summary>
/// Native ListView implementation for Xamarin renderer
/// </summary>
- /// <remarks>
+ /// <remarks>
/// This internally uses GenList class.
/// One should note that it is optimized for displaying many elements which may be
/// unavailable at first. This means that only currently visible elements will be constructed.
/// Adds elements to the list and defines its presentation based on Cell type.
/// </summary>
/// <param name="source">IEnumerable on Cell collection.</param>
- /// <param name="beforeCell">Cell before which new items will be placed.
+ /// <param name="beforeCell">Cell before which new items will be placed.
/// Null value may also be passed as this parameter, which results in appending new items to the end.
/// </param>
public virtual void AddSource(IEnumerable source, Cell beforeCell = null)
}
}
- protected void InitializeFooterItemContext(GenItemClass headerTemplate)
+ protected void InitializeFooterItemContext(GenItemClass footerTemplate)
{
var context = new HeaderFooterItemContext();
context.Element = GetFooter();
- context.Item = Append(headerTemplate, context);
+ context.Item = Append(footerTemplate, context);
context.Item.SelectionMode = GenItemSelectionMode.None;
context.Item.Deleted += OnFooterItemDeleted;
FooterItemContext = context;
Type type = cell.GetType();
var cache = isGroup ? _groupCellRendererCache : _cellRendererCache;
if (cache.ContainsKey(type))
- return cache[type];
+ {
+ var cacheCellRenderer = cache[type];
+ cacheCellRenderer.SendCreatedCell(cell, isGroup);
+ return cacheCellRenderer;
+ }
CellRenderer renderer = null;
renderer = Forms.GetHandler<CellRenderer>(type);
}
renderer.SetGroupMode(isGroup);
-
+ renderer.SendCreatedCell(cell, isGroup);
return cache[type] = renderer;
}
return _headerFooterItemClass;
}
}
-}
+}
\ No newline at end of file
/// <summary>
/// Extends the ListView class to provide TableView class implementation.
/// </summary>
- public class TableView : ListView
+ public class TableView : ListView, ITableView
{
static readonly SectionCellRenderer _sectionCellRenderer = new SectionCellRenderer();
protected override void UpdateFooter()
{
- if (GetHeader() != null)
+ if (GetFooter() != null)
{
base.UpdateFooter();
}
--- /dev/null
+using ElmSharp;
+using ElmSharp.Wearable;
+
+namespace Xamarin.Forms.Platform.Tizen.Native.Watch
+{
+ public class WatchTableView : WatchListView, ITableView
+ {
+ static readonly SectionCellRenderer _sectionCellRenderer = new SectionCellRenderer();
+
+ public WatchTableView(EvasObject parent, CircleSurface surface) : base(parent, surface)
+ {
+ }
+
+ public void ApplyTableRoot(TableRoot root)
+ {
+ Clear();
+ var cls = new PaddingItemClass();
+ Append(cls, null);
+ foreach (TableSection ts in root)
+ {
+ if (!string.IsNullOrEmpty(ts.Title))
+ AddSectionTitle(ts.Title, ts.TextColor);
+ AddSource(ts);
+ }
+ Append(cls, null);
+ }
+
+ protected override CellRenderer GetCellRenderer(Cell cell, bool isGroup = false)
+ {
+ if (cell.GetType() == typeof(SectionCell))
+ {
+ return _sectionCellRenderer;
+ }
+ return base.GetCellRenderer(cell, isGroup);
+ }
+
+ void AddSectionTitle(string title, Color textColor)
+ {
+ Cell cell = new SectionCell()
+ {
+ Text = title,
+ TextColor = textColor
+ };
+ AddCell(cell);
+ }
+
+ internal class SectionCellRenderer : TextCellRenderer
+ {
+ public SectionCellRenderer() : this("group_index")
+ {
+ DetailPart = "null";
+ }
+ protected SectionCellRenderer(string style) : base(style) { }
+ }
+ class SectionCell : TextCell
+ {
+ }
+
+ class PaddingItemClass : GenItemClass
+ {
+ public PaddingItemClass() : base("padding")
+ {
+ }
+ }
+ }
+}
using System;
using ElmSharp;
+using Xamarin.Forms.Platform.Tizen.Native;
namespace Xamarin.Forms.Platform.Tizen
{
- public class TableViewRenderer : ViewRenderer<TableView, Native.TableView>
+ public class TableViewRenderer : ViewRenderer<TableView, Native.ListView>
{
internal static BindableProperty PresentationProperty = BindableProperty.Create("Presentation", typeof(View), typeof(TableSectionBase), null, BindingMode.OneWay, null, null, null, null, null as BindableProperty.CreateDefaultValueDelegate);
{
if (Control == null)
{
- SetNativeControl(new Native.TableView(Forms.NativeParent));
+ SetNativeControl(CreateNativeControl(Forms.NativeParent));
Control.ItemSelected += OnSelected;
}
if (e.NewElement != null)
{
e.NewElement.ModelChanged += OnRootPropertyChanged;
- Control.ApplyTableRoot(e.NewElement.Root);
+ (Control as ITableView)?.ApplyTableRoot(e.NewElement.Root);
}
base.OnElementChanged(e);
}
+ protected virtual Native.ListView CreateNativeControl(EvasObject parent)
+ {
+ if (Device.Idiom == TargetIdiom.Watch)
+ {
+ return new Native.Watch.WatchTableView(parent, Forms.CircleSurface);
+ }
+ else
+ {
+ return new Native.TableView(parent);
+ }
+ }
+
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (Element != null)
{
- Control.ApplyTableRoot(Element.Root);
+ (Control as ITableView)?.ApplyTableRoot(Element.Root);
}
}
else if (match == "OnIdiom")
markupExtension = new OnIdiomExtension();
else if (match == "OnAppTheme")
- markupExtension = new OnAppThemeExtension();
+ markupExtension = new AppThemeBindingExtension();
else if (match == "DataTemplate")
markupExtension = new DataTemplateExtension();
else
--- /dev/null
+using System;
+using System.Globalization;
+using System.Reflection;
+
+namespace Xamarin.Forms.Xaml
+{
+ [ContentProperty(nameof(Default))]
+ public class AppThemeBindingExtension : IMarkupExtension<BindingBase>
+ {
+ object _default;
+ bool _hasdefault;
+ object _light;
+ bool _haslight;
+ object _dark;
+ bool _hasdark;
+
+ public AppThemeBindingExtension()
+ {
+ ExperimentalFlags.VerifyFlagEnabled(nameof(AppThemeBindingExtension), ExperimentalFlags.AppThemeExperimental, nameof(AppThemeBindingExtension));
+ }
+
+ public object Default
+ {
+ get => _default; set
+ {
+ _default = value;
+ _hasdefault = true;
+ }
+ }
+ public object Light
+ {
+ get => _light; set
+ {
+ _light = value;
+ _haslight = true;
+ }
+ }
+ public object Dark
+ {
+ get => _dark; set
+ {
+ _dark = value;
+ _hasdark = true;
+ }
+ }
+ public object Value { get; private set; }
+
+ public object ProvideValue(IServiceProvider serviceProvider) => (this as IMarkupExtension<BindingBase>).ProvideValue(serviceProvider);
+
+ BindingBase IMarkupExtension<BindingBase>.ProvideValue(IServiceProvider serviceProvider)
+ {
+ if (Default == null
+ && Light == null
+ && Dark == null)
+ throw new XamlParseException("AppThemeBindingExtension requires a non-null value to be specified for at least one theme or Default.", serviceProvider);
+
+ var valueProvider = serviceProvider?.GetService<IProvideValueTarget>() ?? throw new ArgumentException();
+
+ BindableProperty bp;
+ PropertyInfo pi = null;
+ Type propertyType = null;
+
+ if (valueProvider.TargetObject is Setter setter)
+ bp = setter.Property;
+ else
+ {
+ bp = valueProvider.TargetProperty as BindableProperty;
+ pi = valueProvider.TargetProperty as PropertyInfo;
+ }
+ propertyType = bp?.ReturnType
+ ?? pi?.PropertyType
+ ?? throw new InvalidOperationException("Cannot determine property to provide the value for.");
+
+ var converterProvider = serviceProvider?.GetService<IValueConverterProvider>();
+
+ MemberInfo minforetriever()
+ {
+ if (pi != null)
+ return pi;
+
+ MemberInfo minfo = null;
+ try
+ {
+ minfo = bp.DeclaringType.GetRuntimeProperty(bp.PropertyName);
+ }
+ catch (AmbiguousMatchException e)
+ {
+ throw new XamlParseException($"Multiple properties with name '{bp.DeclaringType}.{bp.PropertyName}' found.", serviceProvider, innerException: e);
+ }
+ if (minfo != null)
+ return minfo;
+ try
+ {
+ return bp.DeclaringType.GetRuntimeMethod("Get" + bp.PropertyName, new[] { typeof(BindableObject) });
+ }
+ catch (AmbiguousMatchException e)
+ {
+ throw new XamlParseException($"Multiple methods with name '{bp.DeclaringType}.Get{bp.PropertyName}' found.", serviceProvider, innerException: e);
+ }
+ }
+
+ var binding = new OnAppTheme<object>();
+ if (converterProvider != null)
+ {
+ if (_haslight) binding.Light = converterProvider.Convert(Light, propertyType, minforetriever, serviceProvider);
+ if (_hasdark) binding.Dark = converterProvider.Convert(Dark, propertyType, minforetriever, serviceProvider);
+ if (_hasdefault) binding.Default = converterProvider.Convert(Default, propertyType, minforetriever, serviceProvider);
+ return binding;
+ }
+
+ Exception converterException = null;
+
+ if (converterException != null && _haslight)
+ binding.Light = Light.ConvertTo(propertyType, minforetriever, serviceProvider, out converterException);
+ if (converterException != null && _hasdark)
+ binding.Dark = Dark.ConvertTo(propertyType, minforetriever, serviceProvider, out converterException);
+ if (converterException != null && _hasdefault)
+ binding.Default = Default.ConvertTo(propertyType, minforetriever, serviceProvider, out converterException);
+
+ if (converterException != null)
+ throw converterException;
+
+ return binding;
+ }
+ }
+}
\ No newline at end of file