+.vs/
.vscode/*
SettingWiFi/SettingView/bin/
SettingWiFi/SettingView/obj/
SettingWiFi/SettingWiFi/bin/
SettingWiFi/SettingWiFi/obj/
+tags
+msbuild.log
private void OnPropertyChanged(string propertyName)
{
- Debug("OnPropertyChanged " + propertyName);
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
--- /dev/null
+using System;
+using SettingWiFi.res.locale;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using static SettingWiFi.Logger;
+
+
+namespace SettingWiFi
+{
+ internal class InfoInputPage : DialogPage
+ {
+ internal InfoInputPage()
+ {
+ Debug("InfoInputPage");
+ }
+
+ internal void CreateComponents(string title, string value)
+ {
+ var infoView = new RecyclerViewItem()
+ {
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ },
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.WrapContent,
+ };
+
+ var valueField = new TextField()
+ {
+ WidthSpecification = 600,
+ PlaceholderText = value,
+ };
+ infoView.Add(valueField);
+
+ var cancelButton = new Button()
+ {
+ Text = Resources.IDS_WIFI_SK_CANCEL,
+ };
+ cancelButton.Clicked += OnCancelClicked;
+ var okButton = new Button()
+ {
+ Text = "OK",
+ };
+ okButton.Clicked += OnOkClicked;
+
+ Content = new AlertDialog()
+ {
+ Title = title,
+ Content = infoView,
+ Actions = new View[] { cancelButton, okButton},
+ };
+ }
+
+ private void OnOkClicked(object sender, ClickedEventArgs e)
+ {
+ Debug("OnOkClicked");
+ Navigator.Pop();
+ }
+
+ private void OnCancelClicked(object sender, ClickedEventArgs e)
+ {
+ Debug("OnCancelClicked");
+ Navigator.Pop();
+ }
+ }
+}
\ No newline at end of file
internal class InfoPage : ContentPage
{
private AP mAp;
- private APSource mApSource;
private WiFi mWifi;
ApInfoSource mApInfoSource;
ScrollingDirection = ScrollableBase.Direction.Vertical,
WidthSpecification = LayoutParamPolicies.MatchParent,
HeightSpecification = LayoutParamPolicies.MatchParent,
- SelectionMode = ItemSelectionMode.None,
+ SelectionMode = ItemSelectionMode.Single,
};
+ apInfoListView.SelectionChanged += OnInfoListViewSelected;
var header = GetHeader();
Content = infoView;
}
+ private void OnInfoListViewSelected(object sender, SelectionChangedEventArgs e)
+ {
+ foreach (object item in e.CurrentSelection)
+ {
+ if (item is ApInfoText info)
+ {
+ Navigator.Push(CreateInfoInputPage(info.InfoTitle, info.InfoValue));
+ break;
+ }
+ }
+ }
+
+ private Page CreateInfoInputPage(string title, string value)
+ {
+ var page = new InfoInputPage();
+ page.CreateComponents(title, value);
+ return page;
+ }
+
private DataTemplate CreateItemTemplate()
{
return new DataTemplate(() =>
public async void OnScanListSelected(object sender, SelectionChangedEventArgs ev)
{
- //SingleSelection Only have 1 or nil object in the list.
- /*
- foreach (object item in ev.PreviousSelection)
- {
- if (item == null) break;
- if (item is AP ap)
- {
- Debug("Disconnect " + ap.Essid);
- await mWifi.Disconnect(ap.Essid);
- //mApSource.UpdateState(ap);
- }
- }
- */
foreach (object item in ev.CurrentSelection)
{
if (item == null) break;