Skip to content

Commit fe90ebc

Browse files
committed
Use binding to control MinWidth and MaxWidth
1 parent 22fb3f4 commit fe90ebc

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Flow.Launcher/MainWindow.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
LocationChanged="OnLocationChanged"
2727
Deactivated="OnDeactivated"
2828
PreviewKeyDown="OnKeyDown"
29-
Width="{Binding MainWindowWidth, Mode=OneTime}"
29+
MinWidth="{Binding MainWindowWidth, Mode=OneWay}"
30+
MaxWidth="{Binding MainWindowWidth, Mode=OneWay}"
3031
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
3132
d:DataContext="{d:DesignInstance vm:MainViewModel}">
3233
<Window.Resources>

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,6 @@ private void OnLoaded(object sender, RoutedEventArgs _)
132132
_viewModel.QueryTextCursorMovedToEnd = false;
133133
}
134134
break;
135-
case nameof(MainViewModel.MainWindowWidth):
136-
MinWidth = _viewModel.MainWindowWidth;
137-
MaxWidth = _viewModel.MainWindowWidth;
138-
break;
139135
}
140136
};
141137
_settings.PropertyChanged += (o, e) =>

0 commit comments

Comments
 (0)