Public Access
Merge branch 'claude/windows-update-bar-buttons-b19b2d'
This commit is contained in:
@@ -376,12 +376,25 @@
|
||||
buttons and a version string of unknown length is exactly the shape that arranges one of them off the
|
||||
edge. See UpdateBanner.axaml.
|
||||
|
||||
◆ THE DATA CONTEXT IS SET HERE, and the banner did nothing at all until it was.
|
||||
|
||||
Unlike the titlebar and the status bar, which are typed to this window's own view model and inherit its
|
||||
context, the banner is typed to UpdateViewModel — it is one screen's control and its layout suite hosts
|
||||
it over that view model alone. Inheriting the shell's context instead left every compiled binding
|
||||
inside it resolving against the wrong type and failing silently: no headline, and both Commands null,
|
||||
so the strip appeared, hovered and pressed like a real banner and neither button did anything.
|
||||
|
||||
IsVisible is unqualified because the context is set on this same element, which resolves it against
|
||||
UpdateViewModel too — the rule the page area's wrappers above are wrapped for. It needs no wrapper: the
|
||||
flag it binds is the banner's own, unlike IsHostsScreen and its siblings, which belong to the shell.
|
||||
|
||||
FallbackValue, for the reason the WebView and the connecting card carry one: a compiled binding with
|
||||
no DataContext yields UnsetValue, IsVisible falls back to true, and the previewer would show a banner
|
||||
announcing an update that does not exist.
|
||||
-->
|
||||
<views:UpdateBanner Grid.Row="2"
|
||||
IsVisible="{Binding Updates.IsBannerShowing, FallbackValue=False}" />
|
||||
DataContext="{Binding Updates}"
|
||||
IsVisible="{Binding IsBannerShowing, FallbackValue=False}" />
|
||||
|
||||
<views:StatusBar Grid.Row="3" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user