private void AddToggleButton() { var pt = contextMenuOpenedHere; if (pt == null) { pt = new Point(0, 0); } AddElement(new RemoteToggleButton { Id = RemoteControlService.CreateId(), LabelOff = "New Toggle Button", LabelOn = "New Toggle Button", IconOff = new IconHolder() { Name = "Builtin: ToggleOff", Source = BuiltinIconSource.Create(FontAwesomeIcon.ToggleOff, Colors.Black) }, IconOn = new IconHolder() { Name = "Builtin: ToggleOn", Source = BuiltinIconSource.Create(FontAwesomeIcon.ToggleOn, Colors.Black) }, X = pt.X, Y = pt.Y, ZIndex = RemoteControlService.Count + 1 }); }
private static void OnSelectedBuiltinIconChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) { var picker = dependencyObject as PickerWindow; if (picker.SelectedBuiltinIcon != null) { var iconHolder = new IconHolder() { Source = BuiltinIconSource.Create(picker.SelectedBuiltinIcon.Icon, picker.BuiltinIconColor), Name = picker.SelectedBuiltinIcon.ToString() }; picker.IconHolder.Apply(iconHolder); picker.SelectedCustomIcon = null; } }
private void AddButton() { var pt = contextMenuOpenedHere; if (pt == null) { pt = new Point(0, 0); } AddElement(new RemoteButton { Id = RemoteControlService.CreateId(), Label = "New Button", Icon = new IconHolder() { Name = "Builtin: PlusSquareOutline", Source = BuiltinIconSource.Create(FontAwesomeIcon.PlusSquareOutline, Colors.Black) }, X = pt.X, Y = pt.Y, ZIndex = RemoteControlService.Count + 1 }); }