Open
Conversation
HelloWRC
reviewed
Mar 15, 2026
Member
HelloWRC
left a comment
There was a problem hiding this comment.
建议考虑使用 Flyout 这类轻量级弹出对话框进行确认,不然使用 ContentDialog 时删除组件时有些太繁琐了。
另外,如果可以,也请将此功能同步到编辑模式中。
HelloWRC
requested changes
Apr 11, 2026
Member
HelloWRC
left a comment
There was a problem hiding this comment.
请在后续提交前至少在本地测试一遍。
请注意,如果您继续使用 AI 生成没有审核过,甚至是连编译都无法通过的的代码并提交 PR,我们可能会临时或永久限制您向本仓库发起 PR 的能力。
Comment on lines
-179
to
-252
| private void ButtonChildrenViewClose_OnClick(object sender, RoutedEventArgs e) | ||
| { | ||
| CloseComponentChildrenView(); | ||
| } | ||
|
|
||
| private void CloseComponentChildrenView() | ||
| { | ||
| ViewModel.IsComponentChildrenViewOpen = false; | ||
| ViewModel.ChildrenComponentSettingsNavigationStack.Clear(); | ||
| ViewModel.CanChildrenNavigateBack = false; | ||
| ViewModel.SelectedComponentContainerChildren = []; | ||
| ViewModel.SelectedRootComponent = null; | ||
| } | ||
|
|
||
| private void ButtonOpenRuleset_OnClick(object sender, RoutedEventArgs e) | ||
| { | ||
| if (this.FindResource("RulesetControl") is not RulesetControl control || | ||
| ViewModel.SelectedMainWindowLineSettings == null) | ||
| return; | ||
| control.Ruleset = ViewModel.SelectedMainWindowLineSettings.HidingRules; | ||
| OpenDrawer("RulesetControl"); | ||
| } | ||
|
|
||
| private void ButtonShowChildrenComponents_OnClick(object sender, RoutedEventArgs e) | ||
| { | ||
| SetCurrentSelectedComponentContainer(ViewModel.SelectedComponentSettings); | ||
| } | ||
|
|
||
| private void SetCurrentSelectedComponentContainer(ComponentSettings? componentSettings, bool isBack=false) | ||
| { | ||
| if (componentSettings?.AssociatedComponentInfo?.IsComponentContainer != true) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| var type = componentSettings.AssociatedComponentInfo.ComponentType?.BaseType; | ||
| if (componentSettings.Settings is JsonElement && type != null) | ||
| { | ||
| componentSettings.Settings = ComponentsService.LoadComponentSettings(componentSettings, type); | ||
| } | ||
| if (componentSettings.Settings is not IComponentContainerSettings settings) | ||
| { | ||
| return; | ||
| } | ||
| if (componentSettings == ViewModel.SelectedComponentSettingsMain) | ||
| { | ||
| ViewModel.ChildrenComponentSettingsNavigationStack.Clear(); | ||
| ViewModel.SelectedRootComponent = componentSettings; | ||
| } else if (ViewModel.SelectedContainerComponent != null && !isBack) | ||
| { | ||
| ViewModel.ChildrenComponentSettingsNavigationStack.Push(ViewModel.SelectedContainerComponent); | ||
| } | ||
| ViewModel.SelectedComponentContainerChildren = settings.Children; | ||
| ViewModel.SelectedContainerComponent = componentSettings; | ||
| ViewModel.IsComponentChildrenViewOpen = true; | ||
| ViewModel.CanChildrenNavigateBack = ViewModel.ChildrenComponentSettingsNavigationStack.Count >= 1; | ||
| } | ||
|
|
||
| private void ListBoxComponents_OnPointerPressed(object? sender, PointerPressedEventArgs e) | ||
| { | ||
| // 这里应该把指针按下的事件吞掉,这样在拖动这里面的在组件时就不会把事件往上传送到上级,让上级 ListBoxItem 也跟着被拖动。 | ||
| e.Handled = true; | ||
| } | ||
|
|
||
| private void ButtonCreateMainWindowLine_OnClick(object? sender, RoutedEventArgs e) | ||
| { | ||
| var index = ViewModel.SelectedMainWindowLineSettings == null | ||
| ? 0 | ||
| : Math.Max(0, | ||
| ViewModel.ComponentsService.CurrentComponents.Lines.IndexOf(ViewModel.SelectedMainWindowLineSettings) + 1); | ||
| var lineSettings = new MainWindowLineSettings(); | ||
| ViewModel.ComponentsService.CurrentComponents.Lines.Insert(index, lineSettings); | ||
| ViewModel.SelectedMainWindowLineSettings = lineSettings; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这个 Pull Request 做了什么?
feat: 删除主界面组件/行确认功能。
相关 Issue
Fixes #1647
检查清单