What kind of layout, etc. do you use for your user interface? If you make the logon window a modal dialog, do you need to hide the main window?
Alternatively, you can have some kind of flag "successfully logged in" and bind the visibility of each window to this value - using converters to get the desired result? Sort of:
<Grid>
<MainWindow Visibility="{Binding Authorized,
Converter={StaticResource BoolToVisibilityConverter}}"/>
<LoginWindow Visibility="{Binding Authorized,
Converter={StaticResource InvertedBoolToVisibilityConverter}}"/>
</Grid>
It makes sense?
EDIT: Obviously, elements in a Grid cannot be Windows - so my initial question is about the layout used!
source
share