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 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; } }); }