File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 1919 AllowDrop =" True"
2020 Drop =" OnDrop"
2121 IconVisibility =" Collapsed"
22- Topmost =" True "
22+ Topmost =" {Binding IsTopMost, ElementName=root} "
2323 mc : Ignorable =" d" >
2424
2525 <!-- DataContext: ShellViewModel -->
142142 ToolTip =" Open logs" >
143143 <icons : PackIconFontAwesome Kind =" AlignLeftSolid" />
144144 </Button >
145+
146+ <ToggleButton DockPanel.Dock=" Right"
147+ IsChecked =" {Binding IsTopMost, ElementName=root}"
148+ ToolTip =" Toggle keep window on top" >
149+
150+ <ToggleButton .Style>
151+ <Style BasedOn =" {StaticResource {x:Static adonisUi:Styles.WindowToggleButton}}" TargetType =" {x:Type ToggleButton}" >
152+ <Setter Property =" Content" >
153+ <Setter .Value>
154+ <icons : PackIconFontAwesome Kind =" ToggleOffSolid" />
155+ </Setter .Value>
156+ </Setter >
157+ <Style .Triggers>
158+ <Trigger Property =" IsChecked" Value =" True" >
159+ <Setter Property =" Content" >
160+ <Setter .Value>
161+ <icons : PackIconFontAwesome Kind =" ToggleOnSolid" />
162+ </Setter .Value>
163+ </Setter >
164+ </Trigger >
165+ </Style .Triggers>
166+ </Style >
167+ </ToggleButton .Style>
168+ </ToggleButton >
145169 </DockPanel >
146170 </controls : AdonisWindow .TitleBarContent>
147171
Original file line number Diff line number Diff line change @@ -27,6 +27,18 @@ public bool IsLightTheme
2727 typeof ( Shell ) ,
2828 new PropertyMetadata ( false ) ) ;
2929
30+ public bool IsTopMost
31+ {
32+ get { return ( bool ) GetValue ( IsTopMostProperty ) ; }
33+ set { SetValue ( IsTopMostProperty , value ) ; }
34+ }
35+
36+ public static readonly DependencyProperty IsTopMostProperty = DependencyProperty . Register (
37+ nameof ( IsTopMost ) ,
38+ typeof ( bool ) ,
39+ typeof ( Shell ) ,
40+ new PropertyMetadata ( true ) ) ;
41+
3042 public Visibility StagingVisibility
3143 {
3244 get { return ( Visibility ) GetValue ( StagingVisibilityProperty ) ; }
You can’t perform that action at this time.
0 commit comments