Skip to content

Commit 5487834

Browse files
committed
Add back field to avoid duplicate plugin control loading
1 parent 8a59e87 commit 5487834

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Flow.Launcher/SettingWindow.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@
774774
<Style TargetType="{x:Type Border}">
775775
<Setter Property="Visibility" Value="Visible" />
776776
<Style.Triggers>
777-
<DataTrigger Binding="{Binding ElementName=SettingControl, Path=ActualHeight}" Value="0">
777+
<DataTrigger Binding="{Binding ElementName=PluginSettingControl, Path=ActualHeight}" Value="0">
778778
<Setter Property="Visibility" Value="Collapsed" />
779779
<Setter Property="BorderThickness" Value="0" />
780780
<Setter Property="Padding" Value="0" />
@@ -784,7 +784,7 @@
784784
</Border.Style>
785785
</Border>
786786
<!--#endregion-->
787-
<ContentControl x:Name="SettingControl"
787+
<ContentControl x:Name="PluginSettingControl"
788788
Content="{Binding SettingControl}"
789789
Padding="1" Margin="0" VerticalAlignment="Stretch"
790790
MaxWidth="750" MaxHeight="550">

Flow.Launcher/ViewModel/PluginViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public bool PluginState
3131
set => PluginPair.Metadata.Disabled = !value;
3232
}
3333

34-
public Control SettingControl => PluginPair.Plugin is not ISettingProvider settingProvider ? new Control() : settingProvider.CreateSettingPanel();
34+
private Control _settingControl;
35+
public Control SettingControl => _settingControl ??= PluginPair.Plugin is not ISettingProvider settingProvider ? new Control() : settingProvider.CreateSettingPanel();
3536

3637
public Visibility ActionKeywordsVisibility => PluginPair.Metadata.ActionKeywords.Count == 1 ? Visibility.Visible : Visibility.Collapsed;
3738
public string InitilizaTime => PluginPair.Metadata.InitTime + "ms";

0 commit comments

Comments
 (0)