Skip to content

Commit

Permalink
Исправил размер окна и nullref
Browse files Browse the repository at this point in the history
  • Loading branch information
KGubin committed Dec 12, 2024
1 parent b7e9647 commit c7bf7de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/RevitMirroredElements/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,19 @@ private bool CanAcceptView() {

private void LoadConfig() {
var setting = _pluginConfig.GetSettings(_revitRepository.Document);

if(setting == null) {
SelectedElementScope = ElementScope.NotSelected;
SelectedGroupType = ElementGroupType.NotSelected;
EnableFilter = false;
SelectedCategories = new List<Category>();
return;
}

SelectedElementScope = setting.ElementScope;
SelectedGroupType = setting.ElementGroupType;
EnableFilter = setting.EnableFilter;
SelectedCategories = _revitRepository.GetSaveCategories(setting.SelectedCategories).ToList();
SelectedCategories = _revitRepository.GetSaveCategories(setting.SelectedCategories)?.ToList() ?? new List<Category>();
}

private void SaveConfig() {
Expand Down
4 changes: 2 additions & 2 deletions src/RevitMirroredElements/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
x:Name="mainWindow"
mc:Ignorable="d"
Title="Проверка на зеркальность"
Height="350"
Width="300"
Height="400"
Width="350"
ResizeMode="NoResize"
d:DataContext="{d:DesignInstance vms:MainViewModel, IsDesignTimeCreatable=False}">

Expand Down

0 comments on commit c7bf7de

Please sign in to comment.