mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Move initialization to constructor
This commit is contained in:
parent
569cb8bd44
commit
6614771c3d
2 changed files with 12 additions and 17 deletions
|
|
@ -108,7 +108,6 @@
|
|||
Expanded="Expander_Expanded"
|
||||
Header="{DynamicResource plugin_explorer_generalsetting_header}"
|
||||
IsExpanded="False"
|
||||
Loaded="GeneralSettingsExpander_Loaded"
|
||||
Style="{StaticResource CustomExpanderStyle}">
|
||||
|
||||
<!-- Margin="32 -10 0 0" is to make sure elements is left aligned to the text in the expander text -->
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
|||
public partial class ExplorerSettings
|
||||
{
|
||||
private readonly SettingsViewModel _viewModel;
|
||||
private readonly List<Expander> _expanders = new();
|
||||
private readonly List<Expander> _expanders;
|
||||
|
||||
public ExplorerSettings(SettingsViewModel viewModel)
|
||||
{
|
||||
|
|
@ -27,6 +27,17 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
|||
DataContext = viewModel;
|
||||
|
||||
ActionKeywordModel.Init(viewModel.Settings);
|
||||
|
||||
_expanders = new List<Expander>
|
||||
{
|
||||
GeneralSettingsExpander,
|
||||
ContextMenuExpander,
|
||||
PreviewPanelExpander,
|
||||
EverythingExpander,
|
||||
ActionKeywordsExpander,
|
||||
QuickAccessExpander,
|
||||
ExcludedPathsExpander
|
||||
};
|
||||
}
|
||||
|
||||
private void AccessLinkDragDrop(string containerName, DragEventArgs e)
|
||||
|
|
@ -114,20 +125,5 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
|||
{
|
||||
lbxExcludedPaths.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
|
||||
}
|
||||
|
||||
private void GeneralSettingsExpander_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var expanders = new List<Expander>
|
||||
{
|
||||
GeneralSettingsExpander,
|
||||
ContextMenuExpander,
|
||||
PreviewPanelExpander,
|
||||
EverythingExpander,
|
||||
ActionKeywordsExpander,
|
||||
QuickAccessExpander,
|
||||
ExcludedPathsExpander
|
||||
};
|
||||
_expanders.AddRange(expanders);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue