Use binding to control MinWidth and MaxWidth

This commit is contained in:
Kevin Zhang 2021-10-22 23:06:26 -05:00
parent 22fb3f4bc2
commit fe90ebc7a1
2 changed files with 2 additions and 5 deletions

View file

@ -26,7 +26,8 @@
LocationChanged="OnLocationChanged"
Deactivated="OnDeactivated"
PreviewKeyDown="OnKeyDown"
Width="{Binding MainWindowWidth, Mode=OneTime}"
MinWidth="{Binding MainWindowWidth, Mode=OneWay}"
MaxWidth="{Binding MainWindowWidth, Mode=OneWay}"
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
d:DataContext="{d:DesignInstance vm:MainViewModel}">
<Window.Resources>

View file

@ -132,10 +132,6 @@ namespace Flow.Launcher
_viewModel.QueryTextCursorMovedToEnd = false;
}
break;
case nameof(MainViewModel.MainWindowWidth):
MinWidth = _viewModel.MainWindowWidth;
MaxWidth = _viewModel.MainWindowWidth;
break;
}
};
_settings.PropertyChanged += (o, e) =>