using System;
|
using Shared.Common;
|
using Shared.Phone.UserView;
|
using ZigBee.Device;
|
|
namespace Shared.Phone.Device.Curtain
|
{
|
public class RollerShadeControl:FrameLayout,ZigBee.Common.IStatus
|
{
|
#region ◆ 变量__________________________
|
/// <summary>
|
/// 设备是否在线标识--Online
|
/// </summary>
|
private readonly string DeviceStatus_Online = "Online";
|
public HorizontalSeekBar SeekBar;
|
public Button seekBarTitle;
|
public Action action;
|
public Button rollerShadeIMG;
|
/// <summary>
|
/// 收藏按钮
|
/// </summary>
|
public Button collectionBtn;
|
/// <summary>
|
/// 更多设置
|
/// </summary>
|
private Button moreBtn;
|
/// <summary>
|
/// 下、关
|
/// </summary>
|
private Button downBtn;
|
/// <summary>
|
/// 停
|
/// </summary>
|
private Button stopBtn;
|
/// <summary>
|
/// 上、开
|
/// </summary>
|
private Button upBtn;
|
/// <summary>
|
/// 房间
|
/// </summary>
|
private Button roomBtn;
|
/// <summary>
|
/// 房间名
|
/// </summary>
|
private Button roomName;
|
/// <summary>
|
/// 传过来的设备
|
/// </summary>
|
private DeviceUI device;
|
/// <summary>
|
/// 传过来的房间
|
/// </summary>
|
private Shared.Common.Room room;
|
/// <summary>
|
/// 网关
|
/// </summary>
|
private ZbGateway zbGateway = null;
|
/// <summary>
|
/// 是否发送控制命令成功了
|
/// </summary>
|
private bool sendedControlCommand = false;
|
|
/// <summary>
|
///延时 300毫秒
|
/// </summary>
|
private int sleepSpan = 300;
|
|
#endregion
|
|
#region ◆ 接口___________________________
|
/// <summary>
|
/// 处理变化事件 --将弃用 改用DeviceInfoChange()
|
/// </summary>
|
/// <returns>The changed.</returns>
|
/// <param name="common">Common.</param>
|
public void Changed(CommonDevice common)
|
{
|
|
}
|
/// <summary>
|
/// 设备状态更新接口
|
/// <para>type:如果为 DeviceInComingRespon:设备新上报</para>
|
/// <para>type:如果为 IASInfoReport:RemoveDeviceRespon</para>
|
/// <para>type:如果为 DeviceStatusReport:设备上报</para>
|
/// <para>type:如果为 IASInfoReport:IAS安防信息上报</para>
|
/// <para>type:如果为 OnlineStatusChange: 设备在线状态更新</para>
|
/// </summary>
|
/// <param name="common">Common.</param>
|
/// <param name="typeTag">Type tag.</param>
|
public void DeviceInfoChange(CommonDevice common, string typeTag)
|
{
|
if (typeTag == "DeviceStatusReport")
|
{
|
Application.RunOnMainThread(() =>
|
{
|
try
|
{
|
var deviceUI = SeekBar.Tag as DeviceUI;
|
//设备为空
|
if (deviceUI.CommonDevice == null)
|
{
|
return;
|
}
|
//是否为当前设备
|
if (deviceUI.CommonDevice.DeviceEpoint != common.DeviceEpoint || deviceUI.CommonDevice.DeviceAddr != common.DeviceAddr)
|
{
|
return;
|
}
|
if (common.DeviceStatusReport.CluterID == 258)
|
{
|
if (common.DeviceStatusReport.AttriBute[0].AttributeId == 8)
|
{
|
//窗帘百分比
|
var rollerShade = deviceUI.CommonDevice as Rollershade;
|
rollerShade.DeviceStatusReport = common.DeviceStatusReport;
|
rollerShade.WcdCurrentPositionLiftPercentage = common.DeviceStatusReport.AttriBute[0].AttriButeData;
|
SeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage;
|
seekBarTitle.Text = $"{SeekBar.Progress} %";
|
rollerShade.LastDateTime = DateTime.Now;
|
}
|
else if (common.DeviceStatusReport.AttriBute[0].AttributeId == 0)
|
{
|
//窗帘类型
|
var rollerShade = deviceUI.CommonDevice as Rollershade;
|
rollerShade.DeviceStatusReport = common.DeviceStatusReport;
|
rollerShade.WcdType = common.DeviceStatusReport.AttriBute[0].AttriButeData;
|
rollerShade.LastDateTime = DateTime.Now;
|
}
|
}
|
//***新改***设备状态上报中,当CluterID=3,证明设备在线,直接标记
|
else if (common.DeviceStatusReport.CluterID == 3)
|
{
|
var rollerShade = deviceUI.CommonDevice as Rollershade;
|
rollerShade.IsOnline = 1;
|
rollerShadeIMG.IsSelected = rollerShade.IsOnline == 1;
|
rollerShade.LastDateTime = DateTime.Now;
|
}
|
}
|
catch (Exception ex)
|
{
|
System.Console.WriteLine($"Error:{ex.Message}");
|
}
|
});
|
}
|
else if (typeTag == "OnlineStatusChange")
|
{
|
Application.RunOnMainThread(() =>
|
{
|
try
|
{
|
var deviceUI = SeekBar.Tag as DeviceUI;
|
//设备为空
|
if (deviceUI.CommonDevice == null)
|
{
|
return;
|
}
|
//是否为当前设备
|
if (deviceUI.CommonDevice.DeviceEpoint != common.DeviceEpoint || deviceUI.CommonDevice.DeviceAddr != common.DeviceAddr)
|
{
|
return;
|
}
|
var rollerShade = deviceUI.CommonDevice as Rollershade;
|
rollerShade.IsOnline = common.IsOnline;
|
rollerShadeIMG.IsSelected = rollerShade.IsOnline == 1;
|
rollerShade.LastDateTime = DateTime.Now;
|
}
|
catch (Exception ex)
|
{
|
System.Console.WriteLine($"Error:{ex.Message}");
|
}
|
});
|
}
|
}
|
/// <summary>
|
/// Changeds the IL ogic status.
|
/// </summary>
|
/// <param name="logic">Logic.</param>
|
public void ChangedILogicStatus(ZigBee.Device.Logic logic)
|
{
|
//throw new NotImplementedException();
|
}
|
/// <summary>
|
/// Changeds the IS cene status.
|
/// </summary>
|
/// <param name="scene">Scene.</param>
|
public void ChangedISceneStatus(Scene scene)
|
{
|
//throw new NotImplementedException();
|
}
|
#endregion
|
|
#region ◆ 构造方法________________________
|
|
/// <summary>
|
/// 构造方法
|
/// </summary>
|
public RollerShadeControl()
|
{
|
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
|
ZigBee.Device.ZbGateway.StatusList.Add(this);
|
}
|
|
#endregion
|
|
#region ◆ 重写移除方法____________________
|
|
/// <summary>
|
/// Removes from parent.
|
/// </summary>
|
public override void RemoveFromParent()
|
{
|
UserView.HomePage.Instance.ScrollEnabled = true;
|
ZigBee.Device.ZbGateway.StatusList.Remove(this);
|
action();
|
action = null;
|
RemoveUpdateControlDeviceStatuAction();
|
base.RemoveFromParent();
|
}
|
|
#endregion
|
|
#region ◆ 显示界面________________________
|
|
/// <summary>
|
/// 显示卷帘控制界面
|
/// </summary>
|
public void Show(DeviceUI device, Shared.Common.Room room)
|
{
|
#region topview
|
var topBGView = new FrameLayout()
{
Height = Application.GetRealHeight(CommonPage.Navigation_Height),
BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor
};
AddChidren(topBGView);
var topView = new FrameLayout()
{
Y = Application.GetRealHeight(CommonPage.NavigationTitle_Y),
Height = Application.GetRealHeight(CommonPage.Navigation_Height - CommonPage.NavigationTitle_Y),
BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor,
};
AddChidren(topView);
|
|
moreBtn = new Device.CommonForm.SelectedStatuButton()
|
{
|
X = Application.GetRealWidth(CommonPage.AppRealWidth - 150),
|
Width = Application.GetMinReal(110),
|
Height = Application.GetMinReal(110),
|
Gravity = Gravity.CenterVertical,
|
UnSelectedImagePath = "Item/More.png",
|
SelectedImagePath = "Item/MoreSelected.png",
|
};
|
topView.AddChidren(moreBtn);
|
|
var back = new Device.CommonForm.BackButton() { };
topView.AddChidren(back);
|
back.MouseUpEventHandler += (sender, e) =>
|
{
|
this.RemoveFromParent();
|
};
|
if (device == null || device.CommonDevice == null || room == null)
|
{
|
return;
|
}
|
this.device = device;
|
this.zbGateway = this.device.CommonDevice.Gateway;
|
this.room = room;
|
|
var rollerShade = device.CommonDevice as ZigBee.Device.Rollershade;
|
//不上非远程
|
if (rollerShade.Gateway == null)
|
{
|
return;
|
}
|
if (rollerShade.Gateway.IsVirtual)
|
{
|
UserHomeView.ReadStatus(rollerShade, () =>
|
{
|
rollerShade.ReadWcdCurrentPositionLiftPercentage();
|
rollerShade.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
|
});
|
}
|
else
|
{
|
//防止短时间内多次读取
|
if ((DateTime.Now - rollerShade.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
|
{
|
rollerShade.ReadWcdCurrentPositionLiftPercentage();
|
rollerShade.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
|
}
|
}
|
|
#endregion
|
|
#region midFL
|
var midFL = new FrameLayout()
|
{
|
Height = Application.GetRealHeight(CommonPage.AppRealHeight - CommonPage.Navigation_Height),
|
Y = topView.Bottom,
|
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
|
};
|
this.AddChidren(midFL);
|
|
var itemView = new FrameLayout()
|
{
|
Y = Application.GetRealHeight(50),
|
Width = Application.GetRealWidth(CommonPage.AppRealWidth - CommonPage.XLeft*2),
|
Height = midFL.Height - Application.GetRealHeight(100),
|
Radius = CommonPage.BigFormRadius,
|
Gravity = Gravity.CenterHorizontal,
|
BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor
|
};
|
midFL.AddChidren(itemView);
|
var rollerShadeView = new FrameLayout()
|
{
|
X = 2,
|
Y = 2,
|
Width = itemView.Width - 4,
|
Height = itemView.Height - Application.GetRealHeight(130),
|
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
|
Tag=device
|
};
|
itemView.AddChidren(rollerShadeView);
|
|
collectionBtn = new Button()
|
{
|
X = rollerShadeView.Width - Application.GetRealWidth(130),
|
Y = Application.GetRealHeight(20),
|
Width = Application.GetMinReal(110),
|
Height = Application.GetMinReal(110),
|
UnSelectedImagePath = "Item/Collection.png",
|
SelectedImagePath = "Item/CollectionSelected.png"
|
};
|
rollerShadeView.AddChidren(collectionBtn);
|
|
rollerShadeIMG = new Button()
|
{
|
Y = Application.GetRealHeight(80),
|
Height = Application.GetMinRealAverage(240),
|
Width = Application.GetMinRealAverage(240),
|
Gravity = Gravity.CenterHorizontal,
|
UnSelectedImagePath = device.IconPath,
|
SelectedImagePath = device.OnlineIconPath,
|
IsSelected=rollerShade.IsOnline==1,
|
Tag=DeviceStatus_Online
|
};
|
rollerShadeView.AddChidren(rollerShadeIMG);
|
|
var rollerShadeName = new Button()
|
{
|
Y = rollerShadeIMG.Bottom,
|
Height = Application.GetRealHeight(85),
|
Width = rollerShadeView.Width - Application.GetRealWidth(100),
|
Gravity = Gravity.CenterHorizontal,
|
Text = device.CommonDevice.DeviceEpointName,
|
TextColor = ZigbeeColor.Current.GXCTextBlackColor
|
};
|
rollerShadeView.AddChidren(rollerShadeName);
|
//滑条
|
SeekBar = new HorizontalSeekBar()
|
{
|
Y = rollerShadeName.Bottom + Application.GetRealHeight(350),
|
Width = rollerShadeView.Width - Application.GetRealWidth(100),
|
Height = Application.GetRealHeight(80),
|
Gravity = Gravity.CenterHorizontal,
|
BackgroundColor = ZigbeeColor.Current.GXCSliderUnSelectedColor,
|
ThumbColor = ZigbeeColor.Current.GXCButtonBlueColor,
|
BorderColor = ZigbeeColor.Current.GXCButtonBlueColor,
|
ProgressColor = ZigbeeColor.Current.GXCButtonBlueColor,
|
Max = 100,
|
Tag=device,
|
Progress = rollerShade.WcdCurrentPositionLiftPercentage,
|
SleepTime=sleepSpan
|
};
|
rollerShadeView.AddChidren(SeekBar);
|
|
seekBarTitle = new Button()
|
{
|
Y = rollerShadeName.Bottom + Application.GetRealHeight(250),
|
Width = Application.GetRealWidth(300),
|
Height = Application.GetRealHeight(80),
|
Gravity = Gravity.CenterHorizontal,
|
Text = $"{SeekBar.Progress}%",
|
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
|
Tag=device
|
};
|
rollerShadeView.AddChidren(seekBarTitle);
|
|
downBtn = new Device.CommonForm.SelectedStatuButton()
|
{
|
X = Application.GetRealWidth(50),
|
Y = Application.GetRealHeight(300) + SeekBar.Bottom,
|
Width = Application.GetMinRealAverage(160),
|
Height = Application.GetMinRealAverage(160),
|
UnSelectedImagePath = "WindowCovering/RollerShadeClose.png",
|
SelectedImagePath = "WindowCovering/RollerShadeCloseSelected.png",
|
//IsSelected = !((device.CommonDevice as ZigBee.Device.Rollershade).WcdCurrentPositionLiftPercentage > 0)
|
};
|
rollerShadeView.AddChidren(downBtn);
|
|
stopBtn = new Device.CommonForm.SelectedStatuButton()
|
{
|
X = Application.GetRealWidth(200) + downBtn.Right,
|
Y = Application.GetRealHeight(300) + SeekBar.Bottom,
|
Width = Application.GetMinRealAverage(160),
|
Height = Application.GetMinRealAverage(160),
|
UnSelectedImagePath = "WindowCovering/RollerShadeStop.png",
|
SelectedImagePath = "WindowCovering/RollerShadeStopSelected.png",
|
};
|
rollerShadeView.AddChidren(stopBtn);
|
|
upBtn = new Device.CommonForm.SelectedStatuButton()
|
{
|
X = Application.GetRealWidth(200) + stopBtn.Right,
|
Y = Application.GetRealHeight(300) + SeekBar.Bottom,
|
Width = Application.GetMinRealAverage(160),
|
Height = Application.GetMinRealAverage(160),
|
UnSelectedImagePath = "WindowCovering/RollerShadeOpen.png",
|
SelectedImagePath = "WindowCovering/RollerShadeOpenSelected.png",
|
//IsSelected = (device.CommonDevice as ZigBee.Device.Rollershade).WcdCurrentPositionLiftPercentage > 0
|
};
|
rollerShadeView.AddChidren(upBtn);
|
|
roomBtn = new Button()
|
{
|
X = Application.GetRealWidth(50),
|
Y = Application.GetRealHeight(25) + rollerShadeView.Bottom,
|
Width = Application.GetMinReal(80),
|
Height = Application.GetMinReal(80),
|
UnSelectedImagePath = "Item/Room.png",
|
SelectedImagePath = "Item/RoomSelected.png"
|
};
|
itemView.AddChidren(roomBtn);
|
|
roomName = new Button()
|
{
|
X = roomBtn.Right + Application.GetRealWidth(20),
|
Y = roomBtn.Y,
|
Width = Application.GetRealWidth(400),
|
Height = Application.GetRealHeight(80),
|
Text = room.Name,
|
TextAlignment = TextAlignment.CenterLeft,
|
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
|
SelectedTextColor = ZigbeeColor.Current.GXCTextBlueColor
|
};
|
itemView.AddChidren(roomName);
|
|
var dev =Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
|
if (dev == null)
|
{
|
collectionBtn.IsSelected = false;
|
}
|
else
|
{
|
collectionBtn.IsSelected = true;
|
}
|
|
if (rollerShade.WcdType == -1)
|
{
|
CommonPage.Loading.Start();
|
new System.Threading.Thread(() =>
|
{
|
ZigBee.Device.Rollershade.ReadWcdTypeAction(rollerShade, () =>
|
{
|
Application.RunOnMainThread(() =>
|
{
|
if (rollerShade.WcdType == 0)
|
{
|
downBtn.UnSelectedImagePath = "WindowCovering/RollerShadeDown.png";
|
downBtn.SelectedImagePath = "WindowCovering/RollerShadeDownSelected.png";
|
upBtn.UnSelectedImagePath = "WindowCovering/RollerShadeUp.png";
|
upBtn.SelectedImagePath = "WindowCovering/RollerShadeUpSelected.png";
|
}
|
else
|
{
|
downBtn.UnSelectedImagePath = "WindowCovering/RollerShadeClose.png";
|
downBtn.SelectedImagePath = "WindowCovering/RollerShadeCloseSelected.png";
|
upBtn.UnSelectedImagePath = "WindowCovering/RollerShadeOpen.png";
|
upBtn.SelectedImagePath = "WindowCovering/RollerShadeOpenSelected.png";
|
}
|
CommonPage.Loading.Hide();
|
});
|
});
|
})
|
{ IsBackground = true }.Start();
|
}
|
else if(rollerShade.WcdType == 0)
|
{
|
downBtn.UnSelectedImagePath = "WindowCovering/RollerShadeDown.png";
|
downBtn.SelectedImagePath = "WindowCovering/RollerShadeDownSelected.png";
|
upBtn.UnSelectedImagePath = "WindowCovering/RollerShadeUp.png";
|
upBtn.SelectedImagePath = "WindowCovering/RollerShadeUpSelected.png";
|
}
|
else
|
{
|
downBtn.UnSelectedImagePath = "WindowCovering/RollerShadeClose.png";
|
downBtn.SelectedImagePath = "WindowCovering/RollerShadeCloseSelected.png";
|
upBtn.UnSelectedImagePath = "WindowCovering/RollerShadeOpen.png";
|
upBtn.SelectedImagePath = "WindowCovering/RollerShadeOpenSelected.png";
|
}
|
#endregion
|
|
|
BindEvent();
|
}
|
|
#endregion
|
|
#region ◆ 绑定事件________________________
|
|
/// <summary>
|
/// 绑定按钮的事件
|
/// </summary>
|
private void BindEvent()
|
{
|
upBtn.MouseUpEventHandler += Up;
|
stopBtn.MouseUpEventHandler += Stop;
|
downBtn.MouseUpEventHandler += Down;
|
SeekBar.ProgressChanged += SeekBar_ProgressChange;
|
collectionBtn.MouseUpEventHandler += Collection;
|
moreBtn.MouseUpEventHandler += More;
|
roomBtn.MouseUpEventHandler += BackToRoomHandler;
|
roomName.MouseUpEventHandler += BackToRoomHandler;
|
}
|
|
#endregion
|
|
#region ◆ 控制___________________________
|
|
/// <summary>
|
/// 滑条移动发送命令
|
/// </summary>
|
/// <param name="sender">Sender.</param>
|
/// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
|
private void SeekBar_ProgressChange(object sender, int mouseEventArgs)
|
{
|
seekBarTitle.Text = $"{SeekBar.Progress}%";
|
(device.CommonDevice as ZigBee.Device.Rollershade).WcdGoToTiltValue(SeekBar.Progress);
|
}
|
|
|
/// <summary>
|
/// 上、开
|
/// </summary>
|
/// <param name="sender">Sender.</param>
|
/// <param name="eventArgs">Event arguments.</param>
|
private void Up(object sender, MouseEventArgs eventArgs)
|
{
|
sendedControlCommand = false;
|
zbGateway.ReportAction += UpdateDeviceControllStatu;
|
(device.CommonDevice as ZigBee.Device.Rollershade).CurtainUpDownStopControl(0);
|
//控制延时回调
|
DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
|
{
|
if (Parent == null)
|
{
|
return;
|
}
|
RemoveUpdateControlDeviceStatuAction();
|
if (sendedControlCommand == false)
|
{
|
DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
|
}
|
});
|
}
|
|
/// <summary>
|
/// 下、关
|
/// </summary>
|
/// <param name="sender">Sender.</param>
|
/// <param name="eventArgs">Event arguments.</param>
|
private void Down(object sender, MouseEventArgs eventArgs)
|
{
|
sendedControlCommand = false;
|
zbGateway.ReportAction += UpdateDeviceControllStatu;
|
(device.CommonDevice as ZigBee.Device.Rollershade).CurtainUpDownStopControl(1);
|
//控制延时回调
|
DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
|
{
|
if (Parent == null)
|
{
|
return;
|
}
|
RemoveUpdateControlDeviceStatuAction();
|
if (sendedControlCommand == false)
|
{
|
DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
|
}
|
});
|
}
|
|
/// <summary>
|
/// 停
|
/// </summary>
|
/// <param name="sender">Sender.</param>
|
/// <param name="eventArgs">Event arguments.</param>
|
private void Stop(object sender, MouseEventArgs eventArgs)
|
{
|
sendedControlCommand = false;
|
zbGateway.ReportAction += UpdateDeviceControllStatu;
|
(device.CommonDevice as ZigBee.Device.Rollershade).CurtainUpDownStopControl(2);
|
//控制延时回调
|
DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
|
{
|
if (Parent == null)
|
{
|
return;
|
}
|
RemoveUpdateControlDeviceStatuAction();
|
if (sendedControlCommand == false)
|
{
|
DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
|
}
|
});
|
}
|
|
#endregion
|
|
#region ◆ 控制反馈_________________________
|
|
/// <summary>
|
/// 显示设备控制状态
|
/// </summary>
|
/// <param name="command">Command.</param>
|
/// <param name="objValue">Object value.</param>
|
private void UpdateDeviceControllStatu(string command, object objValue)
|
{
|
if (command != "DeviceDefaultAck" || objValue == null)
|
{
|
return;
|
}
|
var tempDevice = (CommonDevice)objValue;
|
if (tempDevice.DeviceEpoint != this.device.CommonDevice.DeviceEpoint || tempDevice.DeviceAddr != this.device.CommonDevice.DeviceAddr)
|
{
|
//不是当前设备的推送,则不处理
|
return;
|
}
|
//标记已经发送控制命令到网关
|
sendedControlCommand = true;
|
//成功不提示
|
//DeviceUI.ShowStatuTip(R.MyInternationalizationString.Success);
|
}
|
|
/// <summary>
|
/// 移除更新控制设备的action
|
/// </summary>
|
private void RemoveUpdateControlDeviceStatuAction()
|
{
|
//移除action
|
if (zbGateway != null)
|
{
|
zbGateway.ReportAction -= UpdateDeviceControllStatu;
|
}
|
}
|
|
#endregion
|
|
#region ◆ 更多设置________________________
|
|
/// <summary>
|
/// 更多设置
|
/// </summary>
|
/// <param name="sender">Sender.</param>
|
/// <param name="e">E.</param>
|
private void More(object sender, MouseEventArgs e)
|
{
|
var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
|
UserView.HomePage.Instance.AddChidren(detailInfo);
|
UserView.HomePage.Instance.PageIndex += 1;
|
detailInfo.Show(device, room);
|
detailInfo.action = () =>
|
{
|
Show(device, room);
|
};
|
}
|
|
#endregion
|
|
#region ◆ 收藏到主页_______________________
|
|
/// <summary>
|
/// 收藏到主页
|
/// </summary>
|
/// <param name="sender">Sender.</param>
|
/// <param name="e">E.</param>
|
private void Collection(object sender, MouseEventArgs e)
|
{
|
//collection
|
if (collectionBtn.IsSelected)
|
{
|
Shared.Common.Room.Lists[0].DeleteDevice(device.FileName);
|
collectionBtn.IsSelected = false;
|
}
|
else
|
{
|
Shared.Common.Room.Lists[0].AddDevice(device.FileName);
|
collectionBtn.IsSelected = true;
|
}
|
}
|
|
#endregion
|
|
#region ◆ 回到主页________________________
|
|
/// <summary>
|
/// 回到主页
|
/// </summary>
|
/// <param name="sender">Sender.</param>
|
/// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
|
private void BackToRoomHandler(object sender, MouseEventArgs mouseEventArgs)
|
{
|
//backToRoom
|
|
}
|
|
#endregion
|
|
}
|
}
|