public ControlPanel() { tabControl = new TabControl { Pages = { new TabPage { Text = "Output", Content = outputModeEditor = new OutputModeEditor() }, new TabPage { Text = "Filters", Padding = 5, Content = filterEditor = new PluginSettingStoreCollectionEditor <IPositionedPipelineElement <IDeviceReport> >() }, new TabPage { Text = "Pen Settings", Content = penBindingEditor = new PenBindingEditor() }, new TabPage { Text = "Auxiliary Settings", Content = auxBindingEditor = new AuxiliaryBindingEditor() }, new TabPage { Text = "Mouse Settings", Content = mouseBindingEditor = new MouseBindingEditor() }, new TabPage { Text = "Tools", Padding = 5, Content = toolEditor = new PluginSettingStoreCollectionEditor <ITool>() }, new TabPage { Text = "Console", Padding = 5, Content = new LogView() } } }; outputModeEditor.ProfileBinding.Bind(ProfileBinding); penBindingEditor.ProfileBinding.Bind(ProfileBinding); auxBindingEditor.ProfileBinding.Bind(ProfileBinding); mouseBindingEditor.ProfileBinding.Bind(ProfileBinding); filterEditor.StoreCollectionBinding.Bind(ProfileBinding.Child(p => p.Filters)); toolEditor.StoreCollectionBinding.Bind(App.Current, a => a.Settings.Tools); var virtualScreen = AppInfo.PluginManager.BuildServiceProvider().GetService <IVirtualScreen>(); outputModeEditor.SetDisplaySize(virtualScreen.Displays); this.Content = tabControl; }
public OutputModeEditor() { this.Content = new StackLayout { Padding = 5, Spacing = 5, HorizontalContentAlignment = HorizontalAlignment.Stretch, Items = { new StackLayoutItem(editorContainer, true), new StackLayoutItem(outputModeSelector, HorizontalAlignment.Left) } }; absoluteModeEditor.SettingsBinding.Bind(ProfileBinding.Child(p => p.AbsoluteModeSettings)); relativeModeEditor.SettingsBinding.Bind(ProfileBinding.Child(p => p.RelativeModeSettings)); outputModeSelector.SelectedItemBinding.Convert <PluginSettingStore>( c => PluginSettingStore.FromPath(c?.FullName), v => v?.GetTypeInfo() ).Bind(ProfileBinding.Child(c => c.OutputMode)); outputModeSelector.SelectedValueChanged += (sender, e) => UpdateOutputMode(Profile?.OutputMode); App.Driver.AddConnectionHook(i => i.TabletsChanged += (sender, e) => UpdateTablet(e)); UpdateTablet(); }
public ControlPanel() { tabControl = new TabControl { Pages = { new TabPage { Text = "Output", Content = outputModeEditor = new OutputModeEditor() }, new TabPage { Text = "Bindings", Content = bindingEditor = new BindingEditor() }, new TabPage { Text = "Filters", Padding = 5, Content = filterEditor = new PluginSettingStoreCollectionEditor <IPositionedPipelineElement <IDeviceReport> >() }, new TabPage { Text = "Tools", Padding = 5, Content = toolEditor = new PluginSettingStoreCollectionEditor <ITool>() }, new TabPage { Text = "Console", Padding = 5, Content = new LogView() } } }; outputModeEditor.ProfileBinding.Bind(ProfileBinding); bindingEditor.SettingsBinding.Bind(ProfileBinding.Child(p => p.BindingSettings)); filterEditor.StoreCollectionBinding.Bind(ProfileBinding.Child(p => p.Filters)); toolEditor.StoreCollectionBinding.Bind(App.Current, a => a.Settings.Tools); outputModeEditor.SetDisplaySize(DesktopInterop.VirtualScreen.Displays); this.Content = tabControl; }
public ControlPanel() { new TabPage { Text = "Output", Content = outputModeEditor = new() }; new TabPage { Text = "Filters", Padding = 5, Content = filterEditor = new() }; new TabPage { Text = "Pen Settings", Content = penBindingEditor = new PenBindingEditor() }; new TabPage { Text = "Auxiliary Settings", Content = auxBindingEditor = new AuxiliaryBindingEditor() }; new TabPage { Text = "Mouse Settings", Content = mouseBindingEditor = new MouseBindingEditor() }; new TabPage { Text = "Tools", Padding = 5, Content = toolEditor = new() }; new TabPage { Text = "Info", Padding = 5, Content = placeholder = new Placeholder { Text = "No tablets are detected." } }; new TabPage { Text = "Console", Padding = 5, Content = logView = new() }; outputModeEditor.ProfileBinding.Bind(ProfileBinding); penBindingEditor.ProfileBinding.Bind(ProfileBinding); auxBindingEditor.ProfileBinding.Bind(ProfileBinding); mouseBindingEditor.ProfileBinding.Bind(ProfileBinding); filterEditor.StoreCollectionBinding.Bind(ProfileBinding.Child(p => p.Filters)); toolEditor.StoreCollectionBinding.Bind(App.Current, a => a.Settings.Tools); outputModeEditor.SetDisplaySize(DesktopInterop.VirtualScreen.Displays); this.Content = tabControl = new TabControl(); Log.Output += (_, message) => Application.Instance.AsyncInvoke(() => { if (message.Level > LogLevel.Info) { tabControl.SelectedPage = logView.Parent as TabPage; } }); }