static View mDetailView;
static ContentPage mDetailPage;
static string mBtDeviceName;
+ static Device mDevice;
internal static void CreateDetailView(Device device)
{
Window window = NUIApplication.GetDefaultWindow();
+ mDevice = device;
var appBar = new AppBar()
{
{
DefaultLinearItem deviceItem = (DefaultLinearItem)sender;
var deviceName = deviceItem.BindingContext as string;
+ deviceName = mBtDeviceName;
Log.Debug(SettingBluetooth.LogTag, "Name: " + deviceName);
- /*
+
Window window = NUIApplication.GetDefaultWindow();
- var connectPage = new RenamePage(device);
+ var connectPage = new RenamePage(deviceName, mDevice);
mBtDeviceName = connectPage.CreateComponents(mBtDeviceName);
- window.GetDefaultNavigator().Push(connectPage);*/
+ window.GetDefaultNavigator().Push(connectPage);
}
}
internal class RenamePage : DialogPage
{
TextField mRenameField;
- Device mDevice;
+ static Device mDevice;
private static void PopDialog()
{
Navigator navigator = NUIApplication.GetDefaultWindow().GetDefaultNavigator();
navigator?.Pop();
}
- internal RenamePage(Device device)
+ internal RenamePage(string deviceName, Device device)
{
mDevice = device;
}
{
try
{
- Log.Debug(SettingBluetooth.LogTag, "Old Name " + mDevice.Name + " field value; " + mRenameField.Text);
+ Log.Debug(SettingBluetooth.LogTag, "Device name before rename: " + mDevice.Name);
mDevice.Name = mRenameField.Text;
- Log.Debug(SettingBluetooth.LogTag, "New Name " + mDevice.Name);
- Navigator.Pop();
+ Log.Debug(SettingBluetooth.LogTag, "Device Name after rename: " + mDevice.Name);
}
catch(Exception e)
{
Log.Debug(SettingBluetooth.LogTag, "Exception : " + e.Message);
}
- Navigator.Pop();
+ NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop();
+ NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop();
+ BtDetailView.CreateDetailView(mDevice);
}
}
}