| | |
| | | UnSelectedImagePath = "Item/Collection.png", |
| | | SelectedImagePath = "Item/CollectionSelected.png" |
| | | }; |
| | | midTopFrameLayout.AddChidren(btnCollect); |
| | | midTopFrameLayout.AddChidren(btnCollect);
|
| | | var de = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == deviceUI.FileName);
|
| | | if (de == null)
|
| | | {
|
| | | btnCollect.IsSelected = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnCollect.IsSelected = true;
|
| | | } |
| | | btnCollect.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | btnCollect.IsSelected = !btnCollect.IsSelected; |
| | | if (btnCollect.IsSelected) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(deviceUI.FileName); //取消收藏 |
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().AddDevice(deviceUI.FileName);//收藏 |
| | | } |
| | | else |
| | | { |
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().AddDevice(deviceUI.FileName);//收藏 |
| | | {
|
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(deviceUI.FileName); //取消收藏 |
| | | } |
| | | }; |
| | | |