Text = "Disabled",
IsEnabled = false,
};
- disabledButton.EnableFocus();
disabledButton.Clicked += (object obj, ClickedEventArgs ev) =>
{
// This event should not be recieved. button is disabled.
Log.Info(this.GetType().Name, "Selected Button Clicked\n");
if (obj is Button button)
{
- disabledButton.IsEnabled = button.IsSelected;
- if (button.IsSelected)
+ disabledButton.IsEnabled = button.IsSelected;
+ if (button.IsSelected)
{
button.Text = "Selected";
}
internal class CheckBoxExample : ContentPage, IExample
{
private View rootContent;
- private CheckBox checkBox1, checkBox2, checkBox3;
+ private CheckBox checkBox, disabledCheckBox, selectedCheckBox;
public void Activate()
{
};
// CheckBox examples.
- checkBox1 = new CheckBox()
+ checkBox = new CheckBox();
+ rootContent.Add(checkBox);
+
+ disabledCheckBox = new CheckBox()
{
- WidthSpecification = LayoutParamPolicies.MatchParent,
+ IsEnabled = false,
};
- rootContent.Add(checkBox1);
+ rootContent.Add(disabledCheckBox);
- checkBox2 = new CheckBox()
+ selectedCheckBox = new CheckBox()
{
- WidthSpecification = LayoutParamPolicies.MatchParent,
+ IsSelected = true,
};
- rootContent.Add(checkBox2);
-
- checkBox3 = new CheckBox()
+ selectedCheckBox.Clicked += (object obj, ClickedEventArgs ev) =>
{
- WidthSpecification = LayoutParamPolicies.MatchParent,
+ Log.Info(this.GetType().Name, "Selected CheckBox Clicked\n");
+ if (obj is CheckBox cb)
+ {
+ disabledCheckBox.IsEnabled = !cb.IsSelected;
+ }
};
- rootContent.Add(checkBox3);
+ rootContent.Add(selectedCheckBox);
Content = rootContent;
}
--- /dev/null
+/*
+ * Copyright(c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.ComponentModel;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+
+namespace Tizen.NUI.StyleGuide
+{
+ // IExample inehrited class will be automatically added in the main examples list.
+ internal class ProgressExample : ContentPage, IExample
+ {
+ private View rootContent;
+ private Tizen.NUI.Components.Progress bufferingProgress, disabledProgress, determinatedProgress, indeterminatedProgress;
+
+ public void Activate()
+ {
+ }
+ public void Deactivate()
+ {
+ }
+
+ /// Modify this method for adding other examples.
+ public ProgressExample() : base()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent;
+ HeightSpecification = LayoutParamPolicies.MatchParent;
+
+ // Navigator bar title is added here.
+ AppBar = new AppBar()
+ {
+ Title = "Slider Default Style",
+ };
+
+ // Example root content view.
+ // you can decorate, add children on this view.
+ rootContent = new View()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center,
+ CellPadding = new Size2D(10, 20),
+ },
+ };
+
+ // CheckBox examples.
+ bufferingProgress = new Progress()
+ {
+ MinValue = 0,
+ MaxValue = 100,
+ BufferValue = 10,
+ ProgressState = Progress.ProgressStatusType.Buffering,
+ };
+ rootContent.Add(bufferingProgress);
+
+ determinatedProgress = new Progress()
+ {
+ MinValue = 0,
+ MaxValue = 100,
+ CurrentValue = 80,
+ ProgressState = Progress.ProgressStatusType.Determinate,
+ };
+ rootContent.Add(determinatedProgress);
+
+ indeterminatedProgress = new Progress()
+ {
+ MinValue = 0,
+ MaxValue = 100,
+ ProgressState = Progress.ProgressStatusType.Indeterminate,
+ };
+ rootContent.Add(indeterminatedProgress);
+
+
+ disabledProgress = new Progress()
+ {
+ MinValue = 0,
+ MaxValue = 100,
+ IsEnabled = false,
+ ProgressState = Progress.ProgressStatusType.Indeterminate,
+ };
+ rootContent.Add(disabledProgress);
+ Content = rootContent;
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright(c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+
+namespace Tizen.NUI.StyleGuide
+{
+ // IExample inehrited class will be automatically added in the main examples list.
+ internal class SliderExample : ContentPage, IExample
+ {
+ private View rootContent;
+ private Slider slider, disabledSlider, completedSlider;
+
+ public void Activate()
+ {
+ }
+ public void Deactivate()
+ {
+ }
+
+ /// Modify this method for adding other examples.
+ public SliderExample() : base()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent;
+ HeightSpecification = LayoutParamPolicies.MatchParent;
+
+ // Navigator bar title is added here.
+ AppBar = new AppBar()
+ {
+ Title = "Slider Default Style",
+ };
+
+ // Example root content view.
+ // you can decorate, add children on this view.
+ rootContent = new View()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center,
+ CellPadding = new Size2D(10, 20),
+ },
+ };
+
+ // CheckBox examples.
+ slider = new Slider()
+ {
+ MinValue = 0,
+ MaxValue = 100,
+ };
+ rootContent.Add(slider);
+
+ disabledSlider = new Slider()
+ {
+ MinValue = 0,
+ MaxValue = 100,
+ IsEnabled = false,
+ };
+ rootContent.Add(disabledSlider);
+
+ completedSlider = new Slider()
+ {
+ MinValue = 0,
+ MaxValue = 100,
+ CurrentValue = 100,
+ };
+ rootContent.Add(completedSlider);
+
+ Content = rootContent;
+ }
+ }
+}